SDL 2.0 OpenGL support completely broken on Linux?

Yeah… I think when both our patches were applied, it ended up with
an additional SDL_free(_this->gles_data) somewhere. I’ll try and fix
it when I get home from work.On Thu, Jul 19, 2012 at 2:06 PM, Andre Heider <a.heider at gmail.com> wrote:

On Thu, Jul 19, 2012 at 12:24 AM, Sam Lantinga wrote:

I went ahead and applied this patch.

One of the advantages of this approach is that the application can
programmatically set whether it wants OpenGL ES or not, which I take
advantage of in the OpenGL ES renderers.

The other advantage is that it can query which one is the default in the
API, which can be useful if an application supports both code paths already
and wants to use whichever one is appropriate for the system.

We may want an environment variable override on top of this, but I figured
it’s a good place to start.

Feedback? Comments? Testing results?

A quick test yields this on my setup yields:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
397 _this->gles_data->eglCreateWindowSurface(_this->gles_data->
(gdb) bt
#0 0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
#1 0x00007ffff7263a3d in SDL_CreateWindow (
title=title at entry=0x7ffff7282a1b “OpenGL test”, x=x at entry=-32,
y=y at entry=-32, w=w at entry=32, h=h at entry=32, flags=flags at entry=10)
at /home/andre/devel/libsdl/src/video/SDL_video.c:1202
#2 0x00007ffff7263874 in ShouldUseTextureFramebuffer ()
at /home/andre/devel/libsdl/src/video/SDL_video.c:174
#3 SDL_VideoInit (driver_name=, driver_name at entry=0x0)
at /home/andre/devel/libsdl/src/video/SDL_video.c:523
#4 0x00007ffff71db737 in SDL_InitSubSystem (flags=flags at entry=33)
at /home/andre/devel/libsdl/src/SDL.c:74
#5 0x00007ffff71db79c in SDL_Init (flags=33)
at /home/andre/devel/libsdl/src/SDL.c:150

Don’t have time right now for hunting that down, but can do later if
nobody beats me.

Regards,
Andre


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

Ah, right. It was a case I missed of SDL_VIDEO_OPENGL_ES2 being used
as the authority on which engine to use. I’ve done a fix (along with
adding in those extra 2 error cases), Andre would you mind running
that same test case again with this patch to see if it gets caught?On Thu, Jul 19, 2012 at 2:51 PM, Scott Percival wrote:

Yeah… I think when both our patches were applied, it ended up with
an additional SDL_free(_this->gles_data) somewhere. I’ll try and fix
it when I get home from work.

On Thu, Jul 19, 2012 at 2:06 PM, Andre Heider <a.heider at gmail.com> wrote:

On Thu, Jul 19, 2012 at 12:24 AM, Sam Lantinga wrote:

I went ahead and applied this patch.

One of the advantages of this approach is that the application can
programmatically set whether it wants OpenGL ES or not, which I take
advantage of in the OpenGL ES renderers.

The other advantage is that it can query which one is the default in the
API, which can be useful if an application supports both code paths already
and wants to use whichever one is appropriate for the system.

We may want an environment variable override on top of this, but I figured
it’s a good place to start.

Feedback? Comments? Testing results?

A quick test yields this on my setup yields:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
397 _this->gles_data->eglCreateWindowSurface(_this->gles_data->
(gdb) bt
#0 0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
#1 0x00007ffff7263a3d in SDL_CreateWindow (
title=title at entry=0x7ffff7282a1b “OpenGL test”, x=x at entry=-32,
y=y at entry=-32, w=w at entry=32, h=h at entry=32, flags=flags at entry=10)
at /home/andre/devel/libsdl/src/video/SDL_video.c:1202
#2 0x00007ffff7263874 in ShouldUseTextureFramebuffer ()
at /home/andre/devel/libsdl/src/video/SDL_video.c:174
#3 SDL_VideoInit (driver_name=, driver_name at entry=0x0)
at /home/andre/devel/libsdl/src/video/SDL_video.c:523
#4 0x00007ffff71db737 in SDL_InitSubSystem (flags=flags at entry=33)
at /home/andre/devel/libsdl/src/SDL.c:74
#5 0x00007ffff71db79c in SDL_Init (flags=33)
at /home/andre/devel/libsdl/src/SDL.c:150

Don’t have time right now for hunting that down, but can do later if
nobody beats me.

Regards,
Andre


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-------------- next part --------------
A non-text attachment was scrubbed…
Name: ohnomoreglesfixes.patch
Type: application/octet-stream
Size: 2857 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120719/3846a2a7/attachment.obj

Another quick test, and it works here without SEGV now.
GL/ES1/ES2 was compiled in, I get GL per default, and with
SDL_GL_SetAttribute(SDL_GL_CONTEXT_EGL, 1) I get ES.

SDL_GL_GetAttribute(SDL_GL_CONTEXT_EGL, &value) also reports the correct value.

Regards,
AndreOn Thu, Jul 19, 2012 at 1:34 PM, Scott Percival wrote:

Ah, right. It was a case I missed of SDL_VIDEO_OPENGL_ES2 being used
as the authority on which engine to use. I’ve done a fix (along with
adding in those extra 2 error cases), Andre would you mind running
that same test case again with this patch to see if it gets caught?

Patch applied!On Thu, Jul 19, 2012 at 7:34 AM, Scott Percival wrote:

Ah, right. It was a case I missed of SDL_VIDEO_OPENGL_ES2 being used
as the authority on which engine to use. I’ve done a fix (along with
adding in those extra 2 error cases), Andre would you mind running
that same test case again with this patch to see if it gets caught?

On Thu, Jul 19, 2012 at 2:51 PM, Scott Percival wrote:

Yeah… I think when both our patches were applied, it ended up with
an additional SDL_free(_this->gles_data) somewhere. I’ll try and fix
it when I get home from work.

On Thu, Jul 19, 2012 at 2:06 PM, Andre Heider <a.heider at gmail.com> wrote:

On Thu, Jul 19, 2012 at 12:24 AM, Sam Lantinga <@slouken> wrote:

I went ahead and applied this patch.

One of the advantages of this approach is that the application can
programmatically set whether it wants OpenGL ES or not, which I take
advantage of in the OpenGL ES renderers.

The other advantage is that it can query which one is the default in
the

API, which can be useful if an application supports both code paths
already

and wants to use whichever one is appropriate for the system.

We may want an environment variable override on top of this, but I
figured

it’s a good place to start.

Feedback? Comments? Testing results?

A quick test yields this on my setup yields:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
397
_this->gles_data->eglCreateWindowSurface(_this->gles_data->

(gdb) bt
#0 0x00007ffff727b841 in X11_CreateWindow (_this=0x329f1d0,
window=)
at /home/andre/devel/libsdl/src/video/x11/SDL_x11window.c:397
#1 0x00007ffff7263a3d in SDL_CreateWindow (
title=title at entry=0x7ffff7282a1b “OpenGL test”, x=x at entry=-32,
y=y at entry=-32, w=w at entry=32, h=h at entry=32, flags=flags at entry=10)
at /home/andre/devel/libsdl/src/video/SDL_video.c:1202
#2 0x00007ffff7263874 in ShouldUseTextureFramebuffer ()
at /home/andre/devel/libsdl/src/video/SDL_video.c:174
#3 SDL_VideoInit (driver_name=, driver_name at entry=0x0)
at /home/andre/devel/libsdl/src/video/SDL_video.c:523
#4 0x00007ffff71db737 in SDL_InitSubSystem (flags=flags at entry=33)
at /home/andre/devel/libsdl/src/SDL.c:74
#5 0x00007ffff71db79c in SDL_Init (flags=33)
at /home/andre/devel/libsdl/src/SDL.c:150

Don’t have time right now for hunting that down, but can do later if
nobody beats me.

Regards,
Andre


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