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
OpenGL ES 3.0/3.1
yaronct


Joined: 10 Mar 2015
Posts: 9
Hi, I've been successfully using OpenGL ES 2.0 with SDL on various platforms. However, I'd like to use some more recent OpenGL ES features. Is it possible to use OpenGL ES 3.0/3.1 with SDL?
OpenGL ES 3.0/3.1
Steffen Hein
Guest

Yes, just set the following before creating your OpenGL context:

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); // or 1

Context creation will fail (SDL_GL_CreateContext() will return NULL) on non-ES3 hardware, so make sure to build in a fallback for that case, if you want to support older hardware as well.



Quote:
Am 16.03.2015 um 21:58 schrieb yaronct:

Hi,

I've been successfully using OpenGL ES 2.0 with SDL on various platforms. However, I'd like to use some more recent OpenGL ES features. Is it possible to use OpenGL ES 3.0/3.1 with SDL?
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OpenGL ES 3.0/3.1
Alex Szpakowski
Guest

OpenGL ES 3+ context creation may be broken when the EGL backend (used on Android, Linux, Windows, etc.) is used, FWIW: https://bugzilla.libsdl.org/show_bug.cgi?id=2865

It definitely works on iOS though (since iOS doesn’t use EGL) – provided you’re using the latest SDL source code from Mercurial.
Quote:
On Apr 18, 2015, at 8:15 PM, Steffen Hein wrote:
Yes, just set the following before creating your OpenGL context:SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); // or 1Context creation will fail (SDL_GL_CreateContext() will return NULL) on non-ES3 hardware, so make sure to build in a fallback for that case, if you want to support older hardware as well.
Quote:
Am 16.03.2015 um 21:58 schrieb yaronct:Hi,I've been successfully using OpenGL ES 2.0 with SDL on various platforms. However, I'd like to use some more recent OpenGL ES features. Is it possible to use OpenGL ES 3.0/3.1 with SDL?_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OpenGL ES 3.0/3.1
Emmanuel Gil Peyrot
Guest

On Sat, Apr 18, 2015 at 08:22:33PM -0300, Alex Szpakowski wrote:
Quote:
OpenGL ES 3+ context creation may be broken when the EGL backend (used on Android, Linux, Windows, etc.) is used, FWIW: https://bugzilla.libsdl.org/show_bug.cgi?id=2865 <https://bugzilla.libsdl.org/show_bug.cgi?id=2865>

On Mesa at least, a GLES 2.0 context will automatically be promoted to
3.0 if the driver supports it (most do, AFAIK, and all desktop ones),
so even with this issue you can still use it.

--
Emmanuel Gil Peyrot

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
OpenGL ES 3.0/3.1
Steffen Hein
Guest

Thanks for the info. I had only tested ES3+ support on iOS so far.

Quote:
Am 19.04.2015 um 01:22 schrieb Alex Szpakowski:
OpenGL ES 3+ context creation may be broken when the EGL backend (used on Android, Linux, Windows, etc.) is used, FWIW: https://bugzilla.libsdl.org/show_bug.cgi?id=2865

It definitely works on iOS though (since iOS doesn’t use EGL) – provided you’re using the latest SDL source code from Mercurial.
Quote:
On Apr 18, 2015, at 8:15 PM, Steffen Hein wrote:
Yes, just set the following before creating your OpenGL context:SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); // or 1Context creation will fail (SDL_GL_CreateContext() will return NULL) on non-ES3 hardware, so make sure to build in a fallback for that case, if you want to support older hardware as well.
Quote:
Am 16.03.2015 um 21:58 schrieb yaronct:Hi,I've been successfully using OpenGL ES 2.0 with SDL on various platforms. However, I'd like to use some more recent OpenGL ES features. Is it possible to use OpenGL ES 3.0/3.1 with SDL?_______________________________________________SDL mailing@lists.libsdl.orghttp://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


_______________________________________________SDL mailing://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

OpenGL ES 3.0/3.1
Alex Szpakowski
Guest

Well, that will only work if you request an OpenGL ES 2 context. If you request an OpenGL ES 3 context I believe SDL’s EGL code will try to request an OpenGL ES 1 context instead (and drivers can’t promote ES1 context requests to ES3, since they aren’t compatible.)

Quote:
On Apr 18, 2015, at 8:27 PM, Emmanuel Gil Peyrot wrote:

On Mesa at least, a GLES 2.0 context will automatically be promoted to
3.0 if the driver supports it (most do, AFAIK, and all desktop ones),
so even with this issue you can still use it.

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
yaronct


Joined: 10 Mar 2015
Posts: 9
Thanx, I'll try in with the latest SDL source code from Mercurial.

Btw, it says that my first message in this thread was posted on April 19, 2015. However I posted the message about a month ago. Therefore only now I got answers... Any idea why?
OpenGL ES 3.0/3.1
Emmanuel Gil Peyrot
Guest

On Sun, Apr 19, 2015 at 11:33:04AM +0000, yaronct wrote:
Quote:
Thanx, I'll try in with the latest SDL source code from Mercurial.

Btw, it says that my first message in this thread was posted on April 19, 2015. However I posted the message about a month ago. Therefore only now I got answers... Any idea why?

We got a lot of messages from March on the mailing list just yesterday,
they were probably kept in a queue somewhere.

--
Emmanuel Gil Peyrot

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org