KiroNeem
2005.03.30, 09:41 PM
I just purchased a Powerbook g4 and everything was going fine. Then when i finally sat down to compile some of my projects on the new machine my OpenGL code was skrewing up. For some reason whenever I add the attribute AGL_FULLSCREEN to my pixelformat it doesn't actually make a context. If anyone has any insite to this please tell me, because I have been working at it and have gotten no where. Here is the code I'm using. Also the video card I have is a GeForce FX Go5200 64mb.
//Init Full Screen Context--------------------------------------------------
AGLContext aglContext;
AGLPixelFormat aglPixFmt;
GLint attrib[] = { AGL_RGBA, AGL_ACCELERATED, AGL_DOUBLEBUFFER, AGL_FULLSCREEN, AGL_NO_RECOVERY, AGL_NONE };
aglPixFmt = aglChoosePixelFormat( NULL, 0, attrib );
aglContext = aglCreateContext( aglPixFmt, NULL );
aglDestroyPixelFormat( aglPixFmt );
HideCursor();
aglSetFullScreen( aglContext, kScreenWidth, kScreenHeight, 30, 0 );
aglSetCurrentContext( aglContext );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, kScreenWidth, 0, kScreenHeight );
glMatrixMode( GL_MODELVIEW );
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glShadeModel( GL_SMOOTH );
glEnable( GL_TEXTURE_2D );
glEnable( GL_ALPHA_TEST );
glAlphaFunc( GL_GREATER, 0 );
glDisable( GL_CULL_FACE );
glColor3f( 1, 1, 1 );
glClear( GL_COLOR_BUFFER_BIT );
if( aglContext == NULL )
printf("No OpenGL Context was created\n");
return err;
//Init Full Screen Context--------------------------------------------------
AGLContext aglContext;
AGLPixelFormat aglPixFmt;
GLint attrib[] = { AGL_RGBA, AGL_ACCELERATED, AGL_DOUBLEBUFFER, AGL_FULLSCREEN, AGL_NO_RECOVERY, AGL_NONE };
aglPixFmt = aglChoosePixelFormat( NULL, 0, attrib );
aglContext = aglCreateContext( aglPixFmt, NULL );
aglDestroyPixelFormat( aglPixFmt );
HideCursor();
aglSetFullScreen( aglContext, kScreenWidth, kScreenHeight, 30, 0 );
aglSetCurrentContext( aglContext );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, kScreenWidth, 0, kScreenHeight );
glMatrixMode( GL_MODELVIEW );
glClearColor( 0.0, 0.0, 0.0, 0.0 );
glShadeModel( GL_SMOOTH );
glEnable( GL_TEXTURE_2D );
glEnable( GL_ALPHA_TEST );
glAlphaFunc( GL_GREATER, 0 );
glDisable( GL_CULL_FACE );
glColor3f( 1, 1, 1 );
glClear( GL_COLOR_BUFFER_BIT );
if( aglContext == NULL )
printf("No OpenGL Context was created\n");
return err;