Hardcoded the RGB bitdepths for EGL surface creation.

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1672 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
dcnieho 2014-01-24 10:34:32 +00:00
parent d8f19f2481
commit c5201e73ef
2 changed files with 10 additions and 1 deletions

View File

@ -59,7 +59,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
/* Set window properties */ /* Set window properties */
int orientation = atoi(getenv("ORIENTATION")); 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 #ifdef GL_ES_VERSION_2_0
int screenUsage = SCREEN_USAGE_OPENGL_ES2 | SCREEN_USAGE_ROTATION; 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 #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

View File

@ -36,9 +36,18 @@ int fghChooseConfig(EGLConfig* config) {
#else #else
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT, EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
#endif #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_BLUE_SIZE, 1,
EGL_GREEN_SIZE, 1, EGL_GREEN_SIZE, 1,
EGL_RED_SIZE, 1, EGL_RED_SIZE, 1,
#endif
EGL_ALPHA_SIZE, (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0, EGL_ALPHA_SIZE, (fgState.DisplayMode & GLUT_ALPHA) ? 1 : 0,
EGL_DEPTH_SIZE, (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0, EGL_DEPTH_SIZE, (fgState.DisplayMode & GLUT_DEPTH) ? 1 : 0,
EGL_STENCIL_SIZE, (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0, EGL_STENCIL_SIZE, (fgState.DisplayMode & GLUT_STENCIL) ? 1 : 0,