Hardcoded the RGB bitdepths for EGL surface creation.
authorRcmaniac25 <rcmaniac25@hotmail.com>
Fri, 24 Jan 2014 10:34:32 +0000 (10:34 +0000)
committerDiederick Niehorster <dcnieho@gmail.com>
Fri, 24 Jan 2014 10:34:32 +0000 (10:34 +0000)
git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1672 7f0cb862-5218-0410-a997-914c9d46530a

src/blackberry/fg_window_blackberry.c
src/egl/fg_window_egl.c

index 0cc14c9..5689394 100644 (file)
@@ -59,7 +59,7 @@ 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
index 6c4a7de..0e06233 100644 (file)
@@ -36,9 +36,18 @@ int fghChooseConfig(EGLConfig* config) {
 #else
     EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
 #endif
+#ifdef TARGET_HOST_BLACKBERRY
+    /* Only 888 and 565 seem to work. Based on
+       http://qt.gitorious.org/qt/qtbase/source/893deb1a93021cdfabe038cdf1869de33a60cbc9:src/plugins/platforms/qnx/qqnxglcontext.cpp
+       That's all that is used, and that's what BlackBerry uses for their own internal OpenGL setup, so unless something else is determined, use it */
+    EGL_BLUE_SIZE, 8,
+       EGL_GREEN_SIZE, 8,
+       EGL_RED_SIZE, 8,
+#else
     EGL_BLUE_SIZE, 1,
     EGL_GREEN_SIZE, 1,
     EGL_RED_SIZE, 1,
+#endif
     EGL_ALPHA_SIZE, (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0,
     EGL_DEPTH_SIZE, (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0,
     EGL_STENCIL_SIZE, (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0,