OpenGL ES 3.0/3.1

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?

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.> 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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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

It definitely works on iOS though (since iOS doesn?t use EGL) ? provided you?re using the latest SDL source code from Mercurial.> 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 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.

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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.On Sat, Apr 18, 2015 at 08:22:33PM -0300, Alex Szpakowski wrote:

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


Emmanuel Gil Peyrot
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20150419/7adac78d/attachment.pgp

Thanks for the info. I had only tested ES3+ support on iOS so far.> 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 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.

On Apr 18, 2015, at 8:15 PM, Steffen Hein <@Steffen_Hein mailto: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 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.

Am 16.03.2015 um 21:58 schrieb yaronct <yaronct at gmail.com <mailto:yaronct at gmail.com>>:

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
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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.)> 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.

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.On Sun, Apr 19, 2015 at 11:33:04AM +0000, yaronct wrote:

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?


Emmanuel Gil Peyrot
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20150419/6064f03e/attachment.pgp