src/render/opengles2/SDL_gles2funcs.h
author Sam Lantinga <slouken@libsdl.org>
Sun, 08 Jan 2012 02:23:37 -0500
changeset 6188 e82023802002
child 6232 37e8d0736366
permissions -rw-r--r--
Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11 Scott Percival 2011-07-03 06:41:51 PDT This submission is aimed at making life easier for OpenGL ES capable devices running a X11 stack (e.g. Maemo, Meego, TrimSlice, other ARM SoC boards not running Android). SDL's Pandora support already has the neccesary GLES-to-X11 glue code, however it's all ghetto'd off in Makefile.pandora and not very flexible. The patch: - adds an awesome --enable-video-opengles option to configure - re-modifies the opengles and opengles2 SDL_renderers to use function pointers - no idea why this was removed? - for SDL_Renderers, links in libGLESv1_CM, libGLES_CM (for PowerVR fans) or libGLESv2 at runtime - links in libEGL.so at runtime - the old code made an assumption that eglFunctions could be pulled from the active GLES library, PowerVR for one doesn't let you do that with their libGLESv2 - allows you to pick which of GLES v1 or v2 to load via SDL_GL_CONTEXT_MAJOR_VERSION So far I've tested this on a Nokia N900 (OMAP 3430/SGX 530 running Maemo 5) and a Toshiba AC100 (Tegra 2 running Ubuntu 10.10). I haven't tested it on... well, everything that isn't those two, such as a Pandora, iOS or Android device. The Pandora specific code should be kept intact (fingers crossed), and nothing painfully drastic has been added to the SDL_renderers. The library loading sequence in SDL_x11opengles has been updated to accomodate both NVIDIA's propensity to let developers get away with murder and PowerVR's alternative of punishing every missed step. The test apps work okay with GLES or GLES2 as the renderer. For some reason alpha blending doesn't seem to work on the Tegra 2; last week NVIDIA pushed out a new set of X11 GLES drivers, so I'll try and investigate once I upgrade those. Also, this patch adds things to configure.in, include/SDL_config.h.in and test/configure.in. I didn't know what the policy was re. committing generated spaghetti from autotools, so ./autogen.sh has to be run again. Sorry. I think that's about everything, let me know if there's anything I've overlooked.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6188
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     1
SDL_PROC(void, glActiveTexture, (GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     2
SDL_PROC(void, glAttachShader, (GLuint, GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     3
SDL_PROC(void, glBindAttribLocation, (GLuint, GLuint, const char *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     4
SDL_PROC(void, glBindTexture, (GLenum, GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     5
SDL_PROC(void, glBlendFunc, (GLenum, GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     6
SDL_PROC(void, glClear, (GLbitfield))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     7
SDL_PROC(void, glClearColor, (GLclampf, GLclampf, GLclampf, GLclampf))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     8
SDL_PROC(void, glCompileShader, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
     9
SDL_PROC(GLuint, glCreateProgram, (void))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    10
SDL_PROC(GLuint, glCreateShader, (GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    11
SDL_PROC(void, glDeleteProgram, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    12
SDL_PROC(void, glDeleteShader, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    13
SDL_PROC(void, glDeleteTextures, (GLsizei, const GLuint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    14
SDL_PROC(void, glDisable, (GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    15
SDL_PROC(void, glDisableVertexAttribArray, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    16
SDL_PROC(void, glDrawArrays, (GLenum, GLint, GLsizei))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    17
SDL_PROC(void, glEnable, (GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    18
SDL_PROC(void, glEnableVertexAttribArray, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    19
SDL_PROC(void, glFinish, (void))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    20
SDL_PROC(void, glGenTextures, (GLsizei, GLuint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    21
SDL_PROC(void, glGetBooleanv, (GLenum, GLboolean *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    22
SDL_PROC(const GLubyte *, glGetString, (GLenum))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    23
SDL_PROC(GLenum, glGetError, (void))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    24
SDL_PROC(void, glGetIntegerv, (GLenum, GLint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    25
SDL_PROC(void, glGetProgramiv, (GLuint, GLenum, GLint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    26
SDL_PROC(void, glGetShaderInfoLog, (GLuint, GLsizei, GLsizei *, char *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    27
SDL_PROC(void, glGetShaderiv, (GLuint, GLenum, GLint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    28
SDL_PROC(GLint, glGetUniformLocation, (GLuint, const char *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    29
SDL_PROC(void, glLinkProgram, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    30
SDL_PROC(void, glPixelStorei, (GLenum, GLint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    31
SDL_PROC(void, glReadPixels, (GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid*))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    32
SDL_PROC(void, glShaderBinary, (GLsizei, const GLuint *, GLenum, const void *, GLsizei))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    33
SDL_PROC(void, glShaderSource, (GLuint, GLsizei, const char **, const GLint *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    34
SDL_PROC(void, glTexImage2D, (GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const void *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    35
SDL_PROC(void, glTexParameteri, (GLenum, GLenum, GLint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    36
SDL_PROC(void, glTexSubImage2D, (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    37
SDL_PROC(void, glUniform1i, (GLint, GLint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    38
SDL_PROC(void, glUniform4f, (GLint, GLfloat, GLfloat, GLfloat, GLfloat))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    39
SDL_PROC(void, glUniformMatrix4fv, (GLint, GLsizei, GLboolean, const GLfloat *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    40
SDL_PROC(void, glUseProgram, (GLuint))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    41
SDL_PROC(void, glVertexAttribPointer, (GLuint, GLint, GLenum, GLboolean, GLsizei, const void *))
e82023802002 Fixed bug 1242 - PATCH: Improve support for OpenGL ES under X11
Sam Lantinga <slouken@libsdl.org>
parents:
diff changeset
    42
SDL_PROC(void, glViewport, (GLint, GLint, GLsizei, GLsizei))