X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fblackberry%2Ffg_window_blackberry.c;h=ff0c08f182c8d7ab21d7b48c068dd2ca54729f87;hb=fc0a807d20dfc5fed06b97bf11da51759392cc90;hp=1f13b554c0559c0c49cc60cbf41dca80af604d9b;hpb=3e7cf561c1470dbee736cd9b371fef14aa5491b1;p=freeglut diff --git a/src/blackberry/fg_window_blackberry.c b/src/blackberry/fg_window_blackberry.c index 1f13b55..ff0c08f 100644 --- a/src/blackberry/fg_window_blackberry.c +++ b/src/blackberry/fg_window_blackberry.c @@ -48,6 +48,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, fgWarning("You can't have more than one window on BlackBerry"); return; } + window->Window.pContext.event = NULL; //XXX Should probably be done elsewhere. Done here so there is no event at the moment /* Create window */ if (screen_create_context(&window->Window.pContext.screenContext, 0)) { @@ -64,10 +65,13 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, /* Set window properties */ int screenFormat = SCREEN_FORMAT_RGBA8888; -#ifdef __X86__ +#ifdef GL_ES_VERSION_2_0 int screenUsage = SCREEN_USAGE_OPENGL_ES2; -#else - int screenUsage = SCREEN_USAGE_DISPLAY | SCREEN_USAGE_OPENGL_ES2; // Physical device copy directly into physical display +#elif GL_VERSION_ES_CM_1_0 || GL_VERSION_ES_CL_1_0 || GL_VERSION_ES_CM_1_1 || GL_VERSION_ES_CL_1_1 + int screenUsage = SCREEN_USAGE_OPENGL_ES1; +#endif +#ifndef __X86__ + screenUsage |= SCREEN_USAGE_DISPLAY; // Physical device copy directly into physical display #endif if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) { screen_destroy_window(sWindow); @@ -94,7 +98,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, }*/ /* Create window buffers */ - if (screen_create_window_buffers(sWindow, 2)) { + if (screen_create_window_buffers(sWindow, (fgState.DisplayMode & GLUT_DOUBLE) ? 2 : 1)) { screen_destroy_window(sWindow); screen_destroy_context(window->Window.pContext.screenContext); fgError("Could not create window buffers"); @@ -104,9 +108,10 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, /* Request window events */ screen_request_events(window->Window.pContext.screenContext); - /* Save window */ + /* Save window and set state */ window->Window.Handle = fgDisplay.pDisplay.single_native_window; window->State.WorkMask |= GLUT_INIT_WORK; + window->State.IsFullscreen = GL_TRUE; //XXX Always fullscreen for now /* Create context */ fghChooseConfig(&window->Window.pContext.egl.Config);