Updated BlackBerry references to make note of the change from FREEGLUT_GLES2/1 to...
[freeglut] / src / blackberry / fg_window_blackberry.c
index c0e2ce4..a1450d1 100644 (file)
@@ -61,7 +61,7 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
     int screenFormat = SCREEN_FORMAT_RGBA8888; //Only SCREEN_FORMAT_RGBA8888 and SCREEN_FORMAT_RGB565 are supported. See fg_window_egl for more info
     int configAttri;
 #define EGL_QUERY_COMP(att, comp) (eglGetConfigAttrib(fgDisplay.pDisplay.egl.Display, window->Window.pContext.egl.Config, att, &configAttri) == GL_TRUE && (configAttri comp))
-    if(EGL_QUERY_COMP(EGL_ALPHA_SIZE, <= 0) && EGL_QUERY_COMP(EGL_RED_SIZE, <= 5) &&
+    if (EGL_QUERY_COMP(EGL_ALPHA_SIZE, <= 0) && EGL_QUERY_COMP(EGL_RED_SIZE, <= 5) &&
             EGL_QUERY_COMP(EGL_GREEN_SIZE, <= 6) && EGL_QUERY_COMP(EGL_BLUE_SIZE, <= 5)) {
         screenFormat = SCREEN_FORMAT_RGB565;
     }
@@ -69,11 +69,17 @@ void fgPlatformOpenWindow( SFG_Window* window, const char* title,
 
     /* Set window properties */
     int orientation = atoi(getenv("ORIENTATION"));
-#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;
+    int screenUsage = SCREEN_USAGE_ROTATION;
+#ifdef SCREEN_USAGE_OPENGL_ES3
+    if (fgState.MajorVersion >= 3) {
+        screenUsage |= SCREEN_USAGE_OPENGL_ES3;
+    } else
 #endif
+    if (fgState.MajorVersion >= 2) {
+        screenUsage |= SCREEN_USAGE_OPENGL_ES2;
+    } else {
+        screenUsage |= SCREEN_USAGE_OPENGL_ES1;
+    }
 #if !defined(__X86__) && !defined(__PLAYBOOK__)
     screenUsage |= SCREEN_USAGE_DISPLAY; // Physical device copy directly into physical display
 #endif