X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fegl%2Ffg_state_egl.c;h=cea0405fc69812db6f66393888ebde9791e7aa1e;hb=af47c3f93c7834b4006c49ec9df6a6ffdd3025de;hp=79da6d147ae7f9adbb7170b65c5c3ac253ce0aa2;hpb=b27ccc213edf4168d445037cf3dceb82772f1b2b;p=freeglut diff --git a/src/egl/fg_state_egl.c b/src/egl/fg_state_egl.c index 79da6d1..cea0405 100644 --- a/src/egl/fg_state_egl.c +++ b/src/egl/fg_state_egl.c @@ -25,6 +25,7 @@ #include #include "fg_internal.h" +#include "egl/fg_window_egl.h" /* * Queries the GL context about some attributes @@ -32,7 +33,7 @@ static int fgPlatformGetConfig( int attribute ) { int returnValue = 0; - int result; /* Not checked */ + int result __fg_unused; /* Not checked */ if( fgStructure.CurrentWindow ) result = eglGetConfigAttrib( fgDisplay.pDisplay.egl.Display, @@ -76,17 +77,20 @@ int fghPlatformGlutGetEGL ( GLenum eWhat ) /* I do not know yet if there will be a fgChooseVisual() function for Win32 */ case GLUT_DISPLAY_MODE_POSSIBLE: { - /* We should not have to call fgPlatformChooseFBConfig again here. */ + /* We should not have to call fghChooseConfig again here. */ EGLConfig config; - return fghChooseConfigEGL(&config); + return fghChooseConfig(&config); } - /* This is system-dependant */ + /* This is system-dependent */ case GLUT_WINDOW_FORMAT_ID: if( fgStructure.CurrentWindow == NULL ) return 0; return fgPlatformGetConfig( EGL_NATIVE_VISUAL_ID ); + case GLUT_WINDOW_DOUBLEBUFFER: + return 1; /* EGL is always double-buffered */ + default: fgWarning( "glutGet(): missing enum handle %d", eWhat ); break; @@ -122,7 +126,6 @@ int* fgPlatformGlutGetModeValues(GLenum eWhat, int *size) attribute_name = EGL_SAMPLES; EGLConfig* configArray; - EGLConfig* config; EGLint configArraySize = 0; /* Get number of available configs */ @@ -139,21 +142,19 @@ int* fgPlatformGlutGetModeValues(GLenum eWhat, int *size) /* We get results in ascending order */ { - int * temp_array; - int previous_value; + int previous_value = 0; int i; array = malloc(sizeof(int) * configArraySize); - previous_value = 0; for (i = 0; i < configArraySize; i++) { - int value; + int value = 0; eglGetConfigAttrib(fgDisplay.pDisplay.egl.Display, configArray[i], attribute_name, &value); if (value > previous_value) { previous_value = value; - temp_array[*size] = value; + array[*size] = value; (*size)++; } }