X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fblackberry%2Ffg_window_blackberry.c;h=e88653ca0d213fa148b51ee3c4269c65fe2b571f;hb=265a4c1c07f001dce197024c77ecad3d6aa9b111;hp=0cc14c97053dc24464cd3bf7659826aabc7ebc1f;hpb=5f89d95bd3ce9d96f28b457afe53e68098a8380e;p=freeglut diff --git a/src/blackberry/fg_window_blackberry.c b/src/blackberry/fg_window_blackberry.c index 0cc14c9..e88653c 100644 --- a/src/blackberry/fg_window_blackberry.c +++ b/src/blackberry/fg_window_blackberry.c @@ -32,7 +32,6 @@ #include "fg_internal.h" #include "egl/fg_window_egl.h" #include -#include /* * Opens a window. Requires a SFG_Window object created and attached @@ -59,13 +58,13 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, /* Set window properties */ int orientation = atoi(getenv("ORIENTATION")); - int screenFormat = SCREEN_FORMAT_RGBA8888; //XXX Should this be determined by config? + int screenFormat = SCREEN_FORMAT_RGBA8888; //Only SCREEN_FORMAT_RGBA8888 and SCREEN_FORMAT_RGB565 are supported. See fg_window_egl for more info #ifdef GL_ES_VERSION_2_0 int screenUsage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_ROTATION; #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 | SCREEN_USAGE_ROTATION; #endif -#ifndef __X86__ +#if !defined(__X86__) && !defined(__PLAYBOOK__) screenUsage |= SCREEN_USAGE_DISPLAY; // Physical device copy directly into physical display #endif if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) { @@ -182,7 +181,11 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title, /* Create context */ fghChooseConfig(&window->Window.pContext.egl.Config); - window->Window.Context = fghCreateNewContextEGL(window); + window->Window.Context = EGL_NO_CONTEXT; + if( fgState.UseCurrentContext == GL_TRUE ) + window->Window.Context = eglGetCurrentContext(); + if( window->Window.Context == EGL_NO_CONTEXT ) + window->Window.Context = fghCreateNewContextEGL(window); /* Create EGL window */ fghPlatformOpenWindowEGL(window);