Fixes for OpenGL ES implementation

This commit is contained in:
zicodxx 2011-03-28 01:57:15 +02:00
parent e2607aaff1
commit c8f4008878
2 changed files with 18 additions and 1 deletions

View file

@ -3,6 +3,7 @@ D1X-Rebirth Changelog
20110328
--------
main/endlevel.c, main/newdemo.c: Properly record the event of reset_rear_view() while switching levels to make it work right when rewinding as well; Properly record Countdown seconds for each newdemo frame instead of second change to get display showing up right while playback and still preserving backwards compability
arch/ogl/gr.c: Fixes for OpenGL ES implementation
20110327
--------

View file

@ -109,7 +109,16 @@ int ogl_init_window(int x, int y)
Window x11Window = 0;
Display* x11Display = 0;
EGLint ver_maj, ver_min;
EGLint configAttribs[] = { EGL_SURFACE_TYPE, EGL_WINDOW_BIT, EGL_NONE };
EGLint configAttribs[] =
{
EGL_RED_SIZE, 5,
EGL_GREEN_SIZE, 6,
EGL_BLUE_SIZE, 5,
EGL_DEPTH_SIZE, 16,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT,
EGL_NONE
};
int iConfigs;
#endif
@ -125,6 +134,13 @@ int ogl_init_window(int x, int y)
}
#ifdef OGLES
if( eglSurface || eglContext || eglDisplay )
{
eglMakeCurrent(eglDisplay, NULL, NULL, EGL_NO_CONTEXT);
eglDestroyContext(eglDisplay, eglContext);
eglDestroySurface(eglDisplay, eglSurface);
}
SDL_VERSION(&info.version);
if (SDL_GetWMInfo(&info) > 0) {