| Summary: | PATCH: Improve support for OpenGL ES under X11 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Scott Percival <code> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | HG 2.0 | ||
| Hardware: | ARM | ||
| OS: | Linux | ||
| Attachments: |
Fix X11 OpenGL ES support - hg export
X11 OpenGL ES minor corrections |
||
This patch looks pretty good. It'll need some rework for Android and iOS, which was the platforms where the dynamic functions were removed. Okay, I tweaked a couple things and made sure it still works with OpenGL ES 1 and 2 on iOS. http://hg.libsdl.org/SDL/rev/e82023802002 Please check and make sure I haven't broken anything. Thanks! Created attachment 764 [details]
X11 OpenGL ES minor corrections
Man, you're quick! I was reworking the patch for the latest hg as well, but you beat me to it.
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
I incorporated your patch, thanks! I did remove the line making the OpenGL context current in the gles2 renderer since the context is supposed to be current upon leaving the CreateContext() call. If that's not the case in the X11 code, then that's a different issue. |
Created attachment 644 [details] Fix X11 OpenGL ES support - hg export Heya, Firstly a huge thanks to everyone at Team SDL, it really does take the misery out of cross-platforming. 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.