Fullscreen Problem
Hi, i try to setup a fullscreenmode, but i dont see anythink on the screen. Here is my setupcode
here my rendercode
there are no errors.
any suggestions?
Code:
CGDisplayErr err;
//capture main display
err = CGDisplayCapture(kCGDirectMainDisplay);
NSAssert(err == CGDisplayNoErr, @"Error CGDisplayCapture");
//Get best Mode
CFDictionaryRef newMode = CGDisplayBestModeForParameters(kCGDirectMainDisplay, 24, _screenWidth, _screenHeight, NULL);
NSAssert(err == CGDisplayNoErr, @"Error CGDisplayBestModeForParameters");
//Switch to selected resolution.
err = CGDisplaySwitchToMode(kCGDirectMainDisplay, newMode);
NSAssert(err == CGDisplayNoErr, @"Error CGDisplaySwitchToMode");
NSOpenGLPixelFormatAttribute attr[] = {
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAAccelerated,
NSOpenGLPFAColorSize, 24,
NSOpenGLPFADepthSize, 16,
NSOpenGLPFAFullScreen,
NSOpenGLPFAScreenMask,CGDisplayIDToOpenGLDisplayMask(kCGDirectMainDisplay),
0 };
NSOpenGLPixelFormat *nsglFormat = [[NSOpenGLPixelFormat alloc] initWithAttributes:attr];
_context = [[NSOpenGLContext alloc] initWithFormat: nsglFormat shareContext: nil];
[nsglFormat release];
//set openGL context to draw to screen
[_context setFullScreen];
[_context makeCurrentContext];here my rendercode
Code:
glViewport( 0, 0, _screenWidth, _screenHeight);
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 45.0, _screenWidth/_screenHeight, 1.0, 5.0 );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0f, 0.85f, 0.35f);
glBegin(GL_TRIANGLES);
{
glVertex3f( -0.2, -0.3, -2.0);
glVertex3f( 0.2, -0.3, -2.0);
glVertex3f( 0.0, 0.3, -2.0);
}
glEnd();
//glFlush();
[_context flushBuffer];there are no errors.
any suggestions?
argh, 
there is no error, in this code, i try and try and try, and now it works (no changes in the code).
i don't know whats going on, with my mac ?????

there is no error, in this code, i try and try and try, and now it works (no changes in the code).
i don't know whats going on, with my mac ?????
using Xcode 3? Maybe it couldn't be bothered compiling the last change to your source for a while...
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Mac OSX fullscreen application problem | e40pud | 7 | 5,532 |
Mar 12, 2010 05:41 AM Last Post: OneSadCookie |
|
| Fullscreen change problem | madjerry | 5 | 2,908 |
Aug 4, 2008 10:22 AM Last Post: AnotherJake |
|
| Fullscreen SDL/OpenGL & CMD-TAB problem | NicholasFrancis | 5 | 4,110 |
Dec 2, 2004 01:00 PM Last Post: NicholasFrancis |
|

