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
Link error with programs compiled without OpenGL
Emmanuel Gil Peyrot
Guest

Hi,

I have found that latest SDL 2.0 includes a change that force programs
to be linked against the libGL (or any other one that provide glEnable,
glScissor and glDisable). I bisected and fount it was the changeset
e276777b4247 (7141 here), if someone want to look at how it added that
dependency and remove it -I take it shouldn’t be there in the first
place.

The error is as follow when linking any program against SDL2:
/usr/lib/libSDL2.so: undefined reference to `glScissor'
/usr/lib/libSDL2.so: undefined reference to `glEnable'
/usr/lib/libSDL2.so: undefined reference to `glDisable'

changeset: 7141:e276777b4247
user: Sam Lantinga
date: Sat May 04 04:46:00 2013 -0700
summary: First pass on SDL render clip rect functionality

--
Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Link error with programs compiled without OpenGL
Emmanuel Gil Peyrot
Guest

On Thu, May 09, 2013 at 02:48:19AM +0200, Emmanuel Gil Peyrot wrote:
Quote:
Hi,

I have found that latest SDL 2.0 includes a change that force programs
to be linked against the libGL (or any other one that provide glEnable,
glScissor and glDisable). I bisected and fount it was the changeset
e276777b4247 (7141 here), if someone want to look at how it added that
dependency and remove it -I take it shouldn’t be there in the first
place.

[snip]

Here is a fix, the issue was that the gl* functions were used instead
of taking them from the GLES/GLES2 renderer.

http://linkmauve.fr/files/fix-7141.patch

--
Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Link error with programs compiled without OpenGL
Martin Gerhardy
Guest

Am 10.05.2013 14:01, schrieb Emmanuel Gil Peyrot:

Quote:
Quote:
On Thu, May 09, 2013 at 02:48:19AM +0200, Emmanuel Gil Peyrot wrote:
Quote:
Hi,

I have found that latest SDL 2.0 includes a change that force programs
to be linked against the libGL (or any other one that provide glEnable,
glScissor and glDisable). I bisected and fount it was the changeset
e276777b4247 (7141 here), if someone want to look at how it added that
dependency and remove it -I take it shouldn’t be there in the first
place.

[snip]

Here is a fix, the issue was that the gl* functions were used instead
of taking them from the GLES/GLES2 renderer.

http://linkmauve.fr/files/fix-7141.patch



Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
The glScissor calls are wrong, too? The rect is not given in x, y, w, h to glScissor.
Link error with programs compiled without OpenGL
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2013/5/10 Martin Gerhardy
Quote:
Am 10.05.2013 14:01, schrieb Emmanuel Gil Peyrot:

Quote:
Quote:
On Thu, May 09, 2013 at 02:48:19AM +0200, Emmanuel Gil Peyrot wrote:
Quote:
Hi,

I have found that latest SDL 2.0 includes a change that force programs
to be linked against the libGL (or any other one that provide glEnable,
glScissor and glDisable). I bisected and fount it was the changeset
e276777b4247 (7141 here), if someone want to look at how it added that
dependency and remove it -I take it shouldn’t be there in the first
place.

[snip]

Here is a fix, the issue was that the gl* functions were used instead
of taking them from the GLES/GLES2 renderer.

http://linkmauve.fr/files/fix-7141.patch



Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
The glScissor calls are wrong, too? The rect is not given in x, y, w, h to glScissor.





And I think it also doesn't translate the convention from SDL coordinates (origin at top, left) to OpenGL (origin at bottom,left).




--
Gabriel.
Link error with programs compiled without OpenGL
Mason Wheeler
Guest

Wow, who wrote the patch in question? I sure hope it wasn't me... o_0


Mason



From: Gabriel Jacobo
To: SDL Development List
Sent: Friday, May 10, 2013 5:51 AM
Subject: Re: [SDL] Link error with programs compiled without OpenGL





2013/5/10 Martin Gerhardy
Quote:
Am 10.05.2013 14:01, schrieb Emmanuel Gil Peyrot:

Quote:
Quote:
On Thu, May 09, 2013 at 02:48:19AM +0200, Emmanuel Gil Peyrot wrote:
Quote:
Hi,

I have found that latest SDL 2.0 includes a change that force programs
to be linked against the libGL (or any other one that provide glEnable,
glScissor and glDisable). I bisected and fount it was the changeset
e276777b4247 (7141 here), if someone want to look at how it added that
dependency and remove it -I take it shouldn’t be there in the first
place.

[snip]

Here is a fix, the issue was that the gl* functions were used instead
of taking them from the GLES/GLES2 renderer.

http://linkmauve.fr/files/fix-7141.patch



Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
The glScissor calls are wrong, too? The rect is not given in x, y, w, h to glScissor.





And I think it also doesn't translate the convention from SDL coordinates (origin at top, left) to OpenGL (origin at bottom,left).




--
Gabriel.



_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Link error with programs compiled without OpenGL
Emmanuel Gil Peyrot
Guest

On Fri, May 10, 2013 at 09:51:47AM -0300, Gabriel Jacobo wrote:
Quote:
2013/5/10 Martin Gerhardy
[snip]
Quote:
Quote:
The glScissor calls are wrong, too? The rect is not given in x, y, w, h
to glScissor.

True, I didn’t look at the arguments at all, assuming they were
correct. It seems they used the same coordinates as the d3d renderer.

Quote:
And I think it also doesn't translate the convention from SDL coordinates
(origin at top, left) to OpenGL (origin at bottom,left).

I fixed that in my latest patch[1].

[1] http://linkmauve.fr/files/fix-7141.patch

--
Emmanuel Gil Peyrot
XMPP:
OpenPGP: 24B1D609

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Link error with programs compiled without OpenGL
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2013/5/10 Emmanuel Gil Peyrot
Quote:
On Fri, May 10, 2013 at 09:51:47AM -0300, Gabriel Jacobo wrote:
Quote:
2013/5/10 Martin Gerhardy
[snip]
Quote:
Quote:
 The glScissor calls are wrong, too? The rect is not given in x, y, w, h
to glScissor.

True, I didn’t look at the arguments at all, assuming they were
correct.  It seems they used the same coordinates as the d3d renderer.

Quote:
And I think it also doesn't translate the convention from SDL coordinates
(origin at top, left) to OpenGL (origin at bottom,left).

I fixed that in my latest patch[1].

[1] http://linkmauve.fr/files/fix-7141.patch



Thanks! http://hg.libsdl.org/SDL/rev/bfb5f8f4f006



--
Gabriel.
Link error with programs compiled without OpenGL
Martin Gerhardy
Guest

Am 10.05.2013 15:13, schrieb Emmanuel Gil Peyrot:
Quote:
On Fri, May 10, 2013 at 09:51:47AM -0300, Gabriel Jacobo wrote:
Quote:
2013/5/10 Martin Gerhardy
[snip]
Quote:
Quote:
The glScissor calls are wrong, too? The rect is not given in x, y, w, h
to glScissor.
True, I didn’t look at the arguments at all, assuming they were
correct. It seems they used the same coordinates as the d3d renderer.

Quote:
And I think it also doesn't translate the convention from SDL coordinates
(origin at top, left) to OpenGL (origin at bottom,left).
I fixed that in my latest patch[1].

[1] http://linkmauve.fr/files/fix-7141.patch


sorry, but this is still not correct.

you have to do:

int lowerLeft = window->height - rect.y - rect.height;
glScissor(rect.x, lowerLeft, rect.width, rect.height);

I hope there is no typo in this... and I hope I'm right with this ;)

Greetings
Martin

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Link error with programs compiled without OpenGL
gabomdq


Joined: 28 Jul 2011
Posts: 495
Location: Argentina
2013/5/10 Martin Gerhardy
Quote:
Am 10.05.2013 15:13, schrieb Emmanuel Gil Peyrot:
Quote:
On Fri, May 10, 2013 at 09:51:47AM -0300, Gabriel Jacobo wrote:
Quote:
2013/5/10 Martin Gerhardy
[snip]
Quote:
Quote:
  The glScissor calls are wrong, too? The rect is not given in x, y, w, h
to glScissor.
True, I didn’t look at the arguments at all, assuming they were
correct.  It seems they used the same coordinates as the d3d renderer.

Quote:
And I think it also doesn't translate the convention from SDL coordinates
(origin at top, left) to OpenGL (origin at bottom,left).
I fixed that in my latest patch[1].

[1] http://linkmauve.fr/files/fix-7141.patch


sorry, but this is still not correct.

you have to do:

int lowerLeft = window->height - rect.y - rect.height;
glScissor(rect.x, lowerLeft, rect.width, rect.height);

I hope there is no typo in this... and I hope I'm right with this ;)

Greetings
Martin



Yes, you are absolutely right!

--
Gabriel.
Link error with programs compiled without OpenGL
Martin Gerhardy
Guest

Am 10.05.2013 21:15, schrieb Gabriel Jacobo:

Quote:



2013/5/10 Martin Gerhardy
Quote:
Am 10.05.2013 15:13, schrieb Emmanuel Gil Peyrot:
Quote:
On Fri, May 10, 2013 at 09:51:47AM -0300, Gabriel Jacobo wrote:
Quote:
2013/5/10 Martin Gerhardy
[snip]
Quote:
Quote:
The glScissor calls are wrong, too? The rect is not given in x, y, w, h
to glScissor.
True, I didn’t look at the arguments at all, assuming they were
correct. It seems they used the same coordinates as the d3d renderer.

Quote:
And I think it also doesn't translate the convention from SDL coordinates
(origin at top, left) to OpenGL (origin at bottom,left).
I fixed that in my latest patch[1].

[1] http://linkmauve.fr/files/fix-7141.patch


sorry, but this is still not correct.

you have to do:

int lowerLeft = window->height - rect.y - rect.height;
glScissor(rect.x, lowerLeft, rect.width, rect.height);

I hope there is no typo in this... and I hope I'm right with this ;)

Greetings
Martin



Yes, you are absolutely right!

--
Gabriel.



http://bugzilla.libsdl.org/show_bug.cgi?id=1844

here is the patch for the issue.

Regards
Martin