The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
GLES3?
Colin


Joined: 03 Nov 2014
Posts: 3
Hi,


First of all, since this is my first post, thank you for this swell framework; it's quite nice.

I am currently building a mobile app that will require the specific features of GLES3 (instanced rendering, geometry shaders, point sprites, texture arrays, etc.) In all the files I've read, there seem to be only examples for Desktop OpenGL and GLES2. There will be no risk of deploying to platforms that do not support GLES3. Here are my questions:

1. What does the user need to do in specific to make SDL2 work with GLES3?
2. In the one example I've seen with GLES3 on SDL2, the author redefines many GLES1/2 functions. Is that necessary? Here is the link https://github.com/vodik/opengl
3. I am currently building for Android and will eventually be porting to iOS. Is there a need to create a separate EAGL context on iOS, or does SDL2 abstract that away for us?


Thanks!
Colin
Followup
Colin


Joined: 03 Nov 2014
Posts: 3
Noob mistakes!!

It turns out that all you have to do to enable GLES3 is to use the SDL_gles2 library as shown in the code in SDL2_BASE_DIR/test/testgles2.c and set up GL_MAJOR_VERSION to 3 instead of 2. Also, in the Android.mk file, link it with -lGLES3 instead of -lGLES2. -lGLES1_CM (compat mode?) is still required, however. Code samples coming up on Github soon.

Also, on question # 2, I was wrong about the author redefining many functions. That was actually the gles3jni sample code I read from the NDK. Doh!


Colin
Another noob mistake
Colin


Joined: 03 Nov 2014
Posts: 3
Hi,

Pardon the repeated mistakes. From looking at the source code, it turns out that SDL2 doesn't seem to support GLES3 directly. The reason I thought it worked was because adb logcat was returning my Nexus' GPU info instead of the actual type of context being used.

I am currently working on a carefully-tuned, mobile-focused, GLES3-only port of SDL2. Perhaps DX11 will be allowed to stay in order to quickly port to WinRT devices.

While this breaks (some) compatibility, calling standard SDL2 procedures will allow greater code reusability in the long run as parts of my existing codebase already uses SDL2.

If anyone else has experience pertaining to this task and is willing to share info, please let me know and we can exchange notes.