From b241816870ee0fe5c87147d0db61885ec6519d01 Mon Sep 17 00:00:00 2001 From: Rcmaniac25 Date: Sat, 14 Sep 2013 14:11:36 -0400 Subject: [PATCH] Hardcoded the RGB bitdepths for EGL surface creation. --- freeglut/freeglut/src/blackberry/fg_window_blackberry.c | 2 +- freeglut/freeglut/src/egl/fg_window_egl.c | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/freeglut/freeglut/src/blackberry/fg_window_blackberry.c b/freeglut/freeglut/src/blackberry/fg_window_blackberry.c index 0cc14c9..5689394 100644 --- a/freeglut/freeglut/src/blackberry/fg_window_blackberry.c +++ b/freeglut/freeglut/src/blackberry/fg_window_blackberry.c @@ -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 diff --git a/freeglut/freeglut/src/egl/fg_window_egl.c b/freeglut/freeglut/src/egl/fg_window_egl.c index 6c4a7de..0e06233 100644 --- a/freeglut/freeglut/src/egl/fg_window_egl.c +++ b/freeglut/freeglut/src/egl/fg_window_egl.c @@ -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,