Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Luc Peurière <jlp@nerim.net>2004-07-28 20:47:08 +0400
committerJean-Luc Peurière <jlp@nerim.net>2004-07-28 20:47:08 +0400
commitbbdfacfde30df4fc0a402d0c19490a5ff3670e69 (patch)
treea4b2dfc54447279de17e6cd27c70e05c49755653
parent7047817c3687679cfd2f442b7563a51b9a08ce1a (diff)
added a nice alert box when blender is run on a mac with less than 8Mb VRAM
-rw-r--r--intern/ghost/intern/GHOST_WindowCarbon.cpp1
-rw-r--r--source/blender/src/ghostwinlay.c26
2 files changed, 22 insertions, 5 deletions
diff --git a/intern/ghost/intern/GHOST_WindowCarbon.cpp b/intern/ghost/intern/GHOST_WindowCarbon.cpp
index 518fdf605bc..0c68a571a68 100644
--- a/intern/ghost/intern/GHOST_WindowCarbon.cpp
+++ b/intern/ghost/intern/GHOST_WindowCarbon.cpp
@@ -134,6 +134,7 @@ GHOST_WindowCarbon::GHOST_WindowCarbon(
//void *handler = &GHOST_WindowCarbon::myWEventHandlerProc;
::SetWRefCon(m_windowRef,(SInt32)this);
+ setTitle(title);
err = InstallWindowEventHandler (m_windowRef, myWEventHandlerProc, GetEventTypeCount(kWEvents), kWEvents,NULL,NULL);
if ( err != noErr) {
fprintf(stderr," error creating handler %i \n",err);
diff --git a/source/blender/src/ghostwinlay.c b/source/blender/src/ghostwinlay.c
index ec7b6926aa8..954388b3db7 100644
--- a/source/blender/src/ghostwinlay.c
+++ b/source/blender/src/ghostwinlay.c
@@ -66,6 +66,7 @@
#ifdef __APPLE__
#include <OpenGL/OpenGL.h>
+#include <Carbon/Carbon.h>
#endif
///
@@ -115,6 +116,8 @@ int checkAppleVideoCard() {
long nrend;
int j;
long value;
+ long maxvram = 0; /* we get always more than 1 renderer, check one, at least, has 8 Mo */
+
display_mask = CGDisplayIDToOpenGLDisplayMask (CGMainDisplayID() );
@@ -123,12 +126,14 @@ int checkAppleVideoCard() {
theErr = CGLDescribeRenderer (rend, 0, kCGLRPRendererCount, &nrend);
if (theErr == 0) {
for (j = 0; j < nrend; j++) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value);
- if ((theErr == 0) && (value != 0)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value);
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value);
+ if (value > maxvram)
+ maxvram = value;
+ if ((theErr == 0) && (value >= 10000000)) {
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPAccelerated, &value);
if ((theErr == 0) && (value != 0)) {
- theErr = CGLDescribeRenderer (rend, j, kCGLRPVideoMemory, &value);
- if ((theErr == 0) && (value >= 10000000)) {
+ theErr = CGLDescribeRenderer (rend, j, kCGLRPCompliant, &value);
+ if ((theErr == 0) && (value != 0)) {
/*fprintf(stderr,"make it big\n");*/
CGLDestroyRendererInfo (rend);
macPrefState = 8;
@@ -139,6 +144,17 @@ int checkAppleVideoCard() {
}
}
}
+ if (maxvram < 7500000 ) { /* put a standard alert and quit*/
+ SInt16 junkHit;
+ char inError[] = "* Not enough VRAM ";
+ char inText[] = "* blender needs at least 8Mb ";
+ inError[0] = 16;
+ inText[0] = 28;
+
+ fprintf(stderr, " vram is %i. not enough, aborting\n", maxvram);
+ StandardAlert ( kAlertStopAlert, &inError,&inText,NULL,&junkHit);
+ abort();
+ }
CGLDestroyRendererInfo (rend);
return 0;
}