X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fegl%2Ffg_init_egl.c;h=d5bc927d6d97e6482bd6b51f66537663a43d5b63;hb=49df0cf2fb8f84ff03fcfc91f4e2b4c4e5774854;hp=1bd4b14b6051a0f56da28c71ffdd8bd31a9f3171;hpb=d1cccef518bc222b3733706aa1e5776c6cb9fec9;p=freeglut diff --git a/src/egl/fg_init_egl.c b/src/egl/fg_init_egl.c index 1bd4b14..d5bc927 100644 --- a/src/egl/fg_init_egl.c +++ b/src/egl/fg_init_egl.c @@ -1,5 +1,5 @@ /* - * freeglut_init_android.c + * freeglut_init_egl.c * * Various freeglut initialization functions. * @@ -27,16 +27,11 @@ #include #include "fg_internal.h" -#include - /* * A call to this function should initialize all the display stuff... */ -void fgPlatformInitialize( const char* displayName ) +void fghPlatformInitializeEGL() { - fprintf(stderr, "fgPlatformInitialize\n"); - fgState.Initialised = GL_TRUE; - /* CreateDisplay */ /* Using EGL_DEFAULT_DISPLAY, or a specific native display */ EGLNativeDisplayType nativeDisplay = EGL_DEFAULT_DISPLAY; @@ -44,16 +39,22 @@ void fgPlatformInitialize( const char* displayName ) FREEGLUT_INTERNAL_ERROR_EXIT(fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY, "No display available", "fgPlatformInitialize"); - if (!eglInitialize(fgDisplay.pDisplay.egl.Display, NULL, NULL)) + if (eglInitialize(fgDisplay.pDisplay.egl.Display, NULL, NULL) != EGL_SUCCESS) fgError("eglInitialize: error %x\n", eglGetError()); +# ifdef GL_VERSION_1_1 /* or later */ + eglBindAPI(EGL_OPENGL_API); +# else + eglBindAPI(EGL_OPENGL_ES_API); +# endif + // fgDisplay.ScreenWidth = ...; // fgDisplay.ScreenHeight = ...; // fgDisplay.ScreenWidthMM = ...; // fgDisplay.ScreenHeightMM = ...; } -void fgPlatformCloseDisplay ( void ) +void fghPlatformCloseDisplayEGL() { if (fgDisplay.pDisplay.egl.Display != EGL_NO_DISPLAY) { eglTerminate(fgDisplay.pDisplay.egl.Display);