X11 OpenGL ES minor corrections
Scott Percival 2012-01-08 04:21:22 PST I tested the new build on my two ARM machines, and fixed a few bugs: - if SDL_VIDEO_DRIVER_UIKIT, SDL_VIDEO_DRIVER_ANDROID or SDL_VIDEO_DRIVER_PANDORA are specified, function pointers are grabbed from the compile-linked library instead of through SDL_GL_GetProcAddress. (not sure if this is the best way to go about it) - removing "/usr/lib/" from all the library names (hey, with multiarch you can't be too sure anymore) - added glFinish to glesfuncs.h - changed the eglGetProcAddress arg type to "const char *" as per the EGL spec - filled in the stubs for X11_GLES_SetSwapInterval and X11_GLES_GetSwapInterval
This commit is contained in:
parent
73b21090a2
commit
f7ad18f9fc
5 changed files with 55 additions and 13 deletions
|
@ -10,6 +10,7 @@ SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei))
|
|||
SDL_PROC(void, glDrawTexiOES, (GLint, GLint, GLint, GLint, GLint))
|
||||
SDL_PROC(void, glEnable, (GLenum))
|
||||
SDL_PROC(void, glEnableClientState, (GLenum))
|
||||
SDL_PROC(void, glFinish, (void))
|
||||
SDL_PROC(void, glGenTextures, (GLsizei, GLuint *))
|
||||
SDL_PROC(GLenum, glGetError, (void))
|
||||
SDL_PROC(void, glGetIntegerv, (GLenum, GLint *))
|
||||
|
|
|
@ -40,7 +40,7 @@ glDrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
|
|||
|
||||
/* OpenGL ES 1.1 renderer implementation, based on the OpenGL renderer */
|
||||
|
||||
/* Used to re-create the window with OpenGL capability */
|
||||
/* Used to re-create the window with OpenGL ES capability */
|
||||
extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
|
||||
|
||||
static const float inv255f = 1.0f / 255.0f;
|
||||
|
@ -151,6 +151,14 @@ GLES_SetError(const char *prefix, GLenum result)
|
|||
|
||||
static int GLES_LoadFunctions(GLES_RenderData * data)
|
||||
{
|
||||
#if SDL_VIDEO_DRIVER_UIKIT
|
||||
#define __SDL_NOGETPROCADDR__
|
||||
#elif SDL_VIDEO_DRIVER_ANDROID
|
||||
#define __SDL_NOGETPROCADDR__
|
||||
#elif SDL_VIDEO_DRIVER_PANDORA
|
||||
#define __SDL_NOGETPROCADDR__
|
||||
#endif
|
||||
|
||||
#ifdef __SDL_NOGETPROCADDR__
|
||||
#define SDL_PROC(ret,func,params) data->func=func;
|
||||
#else
|
||||
|
@ -318,6 +326,8 @@ GLES_CreateRenderer(SDL_Window * window, Uint32 flags)
|
|||
static void
|
||||
GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
||||
{
|
||||
GLES_RenderData *data = (GLES_RenderData *) renderer->driverdata;
|
||||
|
||||
if (event->event == SDL_WINDOWEVENT_SIZE_CHANGED) {
|
||||
/* Rebind the context to the window area and update matrices */
|
||||
SDL_CurrentContext = NULL;
|
||||
|
@ -325,7 +335,7 @@ GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
|
|||
|
||||
if (event->event == SDL_WINDOWEVENT_MINIMIZED) {
|
||||
/* According to Apple documentation, we need to finish drawing NOW! */
|
||||
glFinish();
|
||||
data->glFinish();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue