We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2040 - SDL_GL_CONTEXT_EGL should be removed
Summary: SDL_GL_CONTEXT_EGL should be removed
Status: ASSIGNED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-14 23:56 UTC by Gabriel Jacobo
Modified: 2015-03-22 05:29 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Jacobo 2013-08-14 23:56:07 UTC
SDL_GL_CONTEXT_EGL and the associated gl_config.use_egl flag should be removed, and instead we should decide what sort of context needs to be created exclusively by checking SDL_GL_CONTEXT_PROFILE_MASK (i.e., gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES would do the work of use_egl).

If we use EGL to make the GL ES context internally it's another matter entirely.
Comment 1 Alex Szpakowski 2013-08-15 01:49:01 UTC
On some systems, EGL can be used to create a regular OpenGL context I believe: http://www.khronos.org/registry/egl/sdk/docs/man/xhtml/eglBindAPI.html

If this isn't what SDL does when SDL_GL_CONTEXT_EGL is specified, maybe it should.
Comment 2 Alex Szpakowski 2013-08-15 01:59:07 UTC
EGL also has an extension which mirrors the functionality of WGL_ARB_create_context and GLX_ARB_create_context for choosing the GL version and making core / debug / etc. contexts: http://www.khronos.org/registry/egl/extensions/KHR/EGL_KHR_create_context.txt
Comment 3 Gabriel Jacobo 2013-08-19 20:01:05 UTC
The EGL stuff is so intermixed with the ES stuff that the configure script for Linux wouldn't check the ES headers if the EGL headers where not available. 

I'm not against having SDL_GL_CONTEXT_EGL mean "use EGL internally but obey SDL_GL_CONTEXT_PROFILE_MASK too", it will have to be implemented though! I don't clearly see what the upside would be...work around buggy implementations on certain platforms?
Comment 4 Ryan C. Gordon 2013-08-20 00:00:04 UTC
My two cents:

I'm totally for removing SDL_GL_CONTEXT_EGL ... before I knew what EGL was, I thought it meant "I want an OpenGL ES context," and couldn't understand why we have two different flags to ask for that.

My thought is that there's a right way to get GL (or ES) on a given video target, and the app shouldn't care which SDL chooses.

The flag can stay for 2.0.x, but be ignored by SDL, and removed in 2.1.

--ryan.
Comment 5 Gabriel Jacobo 2013-08-29 18:05:31 UTC
http://hg.libsdl.org/SDL/rev/aea98cc3e696

I didn't remove use_egl from gl_config because I'm not sure what impact, if any, changing the size of the struct has on binary compatibility.

Changing version to 2.1 so we remember to remove SDL_GL_CONTEXT_EGL then.
Comment 6 Sam Lantinga 2013-09-05 13:13:49 UTC
You can safely remove use_egl from gl_config.  That's an internal structure so it won't affect the ABI.
Comment 7 Ryan C. Gordon 2015-02-19 05:22:21 UTC
Marking a large number of bugs with the "triage-2.0.4" keyword at once. Sorry if you got a lot of email from this. This is to help me sort through some bugs in regards to a 2.0.4 release. We may or may not fix this bug for 2.0.4, though!