Create YUV Overlay to match data?

I’m new to SDL, and am interested in using it for .avi playing.

Is there a way to Create a YUV overlay that maps to YUV data (an .avi
frame in a supported YUV format, such as YV12) that I’ve loaded, or do I
need to create a YUV overlay then copy my data into it?

Also, where are YUV overlays physicaly located - in user memory, X
server memory or on the graphics card itself? I assume this may be
different for software YUV-RGB conversion vs XFree 4.0 Xv support.

Ben

The cvs version I got yesterday seems to have mistakenly set the version
in sdl-config to 1.0.9

Andrew.

Sorry, I seem to have checked out the wrong branch. Poop.On Sun, 22 Oct 2000, Andrew Ford wrote:

The cvs version I got yesterday seems to have mistakenly set the version
in sdl-config to 1.0.9

Andrew.

I’m new to SDL, and am interested in using it for .avi playing.

Is there a way to Create a YUV overlay that maps to YUV data (an .avi
frame in a supported YUV format, such as YV12) that I’ve loaded, or do I
need to create a YUV overlay then copy my data into it?

Create a YUV overlay and then copy your data into it. This is because
(in answer to your next question), when the YUV overlays are hardware
accelerated, they usually reside in video memory, requiring you to lock
the memory, fill it, and update it on the screen.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Why in heaven the sdl-config script isn’t included in the MingW

binaries? It is fundamental, since practically all projects require it.
The result is that one is forced to build SDL from source. Please add it
to the binary package.–
[] Guido Imperiale
[] CRV?ADER//KY
[] CVI.SCIENTIA.IMPERIVM

crusaderky at libero.it
http://crusaderky.da.ru

“Nam et ipsa scientia potestas est” (Knowledge is power)
– Sir Francis Bacon (1561-1626)
Meditationes Sacrae, de Haeresibus

“I worry about my child and the Internet all the time, even though she’s too young to have logged on yet. Here’s what I worry about. I worry that 10 or 15 years from now, she will come to me and say ‘Daddy, where were you when they took freedom of the press away from the Internet?’”
–Mike Godwin, Electronic Frontier Foundation


[] Guido Imperiale
[] CRV?ADER//KY
[] CVI.SCIENTIA.IMPERIVM

crusaderky at libero.it
http://crusaderky.da.ru

“Nam et ipsa scientia potestas est” (Knowledge is power)
– Sir Francis Bacon (1561-1626)
Meditationes Sacrae, de Haeresibus

“I worry about my child and the Internet all the time, even though she’s too young to have logged on yet. Here’s what I worry about. I worry that 10 or 15 years from now, she will come to me and say ‘Daddy, where were you when they took freedom of the press away from the Internet?’”
–Mike Godwin, Electronic Frontier Foundation

Hi, I am having a problem statically linking SDL with openGL support,
and wonder if someone can throw some light on this.

Using Linux, Ubuntu Breezy, the debian packaging for 1.2.8,
sdl-config reports

skaller at rosella:/work/felix/flx$ sdl-config --cflags
-I/usr/include/SDL -D_REENTRANT

skaller at rosella:/work/felix/flx$ sdl-config --libs
-L/usr/lib -lSDL -lpthread

skaller at rosella:/work/felix/flx$ sdl-config --static-libs
-L/usr/lib -lSDL -lpthread -lm -ldl -L/usr/lib -lasound -lm -ldl
-lpthread -L/usr/lib -ldl -lartsc -lpthread -lgmodule-2.0 -ldl
-lgthread-2.0 -lglib-2.0 -L/usr/lib -lesd -laudiofile -lm -laudio -lXt
-lX11 -lXext -laa

No openGL libs are mentioned. Yet, 1.2.9 CVS ./configure --help
reports

–enable-video-opengl include OpenGL context creation default=yes

Despite that:

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --cflags
-I/usr/local/include/SDL -D_REENTRANT -D_GNU_SOURCE

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --static-libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -lm -ldl
-L/usr/X11R6/lib

again seems to fail to support openGL. Spec file says:

%ifos linux
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
–disable-video-svga --disable-video-ggi --disable-video-aalib
–disable-debug --enable-dlopen
–enable-esd-shared --enable-arts-shared
%else
%configure --disable-debug --enable-dlopen
%endif

which indicates openGL should be supported. Can anyone explain
what’s going on?

Stuff runs, if one adds -lGL -lGLU to dynamic link.
Is something misconfigured, or do I misunderstand something?

We’re trying to figure out what switches to give linkers
etc in a platform independent way. SDL_opengl already
contains opengl definitions it seems. Does the user still
have to supply an actual openGL library at link time?
So … SDL provides its own headers but the client must
supply an implementation. Deliberate?–
John Skaller
Felix, successor to C++: http://felix.sf.net

skaller wrote:

Hi, I am having a problem statically linking SDL with openGL support,
and wonder if someone can throw some light on this.

Using Linux, Ubuntu Breezy, the debian packaging for 1.2.8,
sdl-config reports

skaller at rosella:/work/felix/flx$ sdl-config --cflags
-I/usr/include/SDL -D_REENTRANT

skaller at rosella:/work/felix/flx$ sdl-config --libs
-L/usr/lib -lSDL -lpthread

skaller at rosella:/work/felix/flx$ sdl-config --static-libs
-L/usr/lib -lSDL -lpthread -lm -ldl -L/usr/lib -lasound -lm -ldl
-lpthread -L/usr/lib -ldl -lartsc -lpthread -lgmodule-2.0 -ldl
-lgthread-2.0 -lglib-2.0 -L/usr/lib -lesd -laudiofile -lm -laudio -lXt
-lX11 -lXext -laa

No openGL libs are mentioned. Yet, 1.2.9 CVS ./configure --help
reports

–enable-video-opengl include OpenGL context creation default=yes

Despite that:

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --cflags
-I/usr/local/include/SDL -D_REENTRANT -D_GNU_SOURCE

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --static-libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -lm -ldl
-L/usr/X11R6/lib

again seems to fail to support openGL. Spec file says:

%ifos linux
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
–disable-video-svga --disable-video-ggi --disable-video-aalib
–disable-debug --enable-dlopen
–enable-esd-shared --enable-arts-shared
%else
%configure --disable-debug --enable-dlopen
%endif

which indicates openGL should be supported. Can anyone explain
what’s going on?

Stuff runs, if one adds -lGL -lGLU to dynamic link.
Is something misconfigured, or do I misunderstand something?

We’re trying to figure out what switches to give linkers
etc in a platform independent way. SDL_opengl already
contains opengl definitions it seems. Does the user still
have to supply an actual openGL library at link time?
So … SDL provides its own headers but the client must
supply an implementation. Deliberate?

Did you look at bugzilla before asking your question ?

Stephane

We’re trying to figure out what switches to give linkers
etc in a platform independent way. SDL_opengl already
contains opengl definitions it seems. Does the user still
have to supply an actual openGL library at link time?
So … SDL provides its own headers but the client must
supply an implementation. Deliberate?

Did you look at bugzilla before asking your question ?

Nope. Why would i do that? It’s a request for clarification
of intent, not a bug report.On Tue, 2006-02-28 at 00:20 +0100, Stephane Marchesin wrote:


John Skaller
Async PL, Realtime software consultants
Checkout Felix: http://felix.sourceforge.net

Hi, I am having a problem statically linking SDL with openGL support,
and wonder if someone can throw some light on this.

Well first of all AFAIK one should never statically link OpenGL to
anything. libGL.so (or opengl32.dll, or whatever it’s called) is
implementation-specific.

Using Linux, Ubuntu Breezy, the debian packaging for 1.2.8,
sdl-config reports

skaller at rosella:/work/felix/flx$ sdl-config --cflags
-I/usr/include/SDL -D_REENTRANT

skaller at rosella:/work/felix/flx$ sdl-config --libs
-L/usr/lib -lSDL -lpthread

skaller at rosella:/work/felix/flx$ sdl-config --static-libs
-L/usr/lib -lSDL -lpthread -lm -ldl -L/usr/lib -lasound -lm -ldl
-lpthread -L/usr/lib -ldl -lartsc -lpthread -lgmodule-2.0 -ldl
-lgthread-2.0 -lglib-2.0 -L/usr/lib -lesd -laudiofile -lm -laudio -lXt
-lX11 -lXext -laa

No openGL libs are mentioned. Yet, 1.2.9 CVS ./configure --help
reports

–enable-video-opengl include OpenGL context creation default=yes

That’s normal. SDL does not link to libGL. It only abstracts the
OpenGL contexts (ie. GLX, WGL, AGL, etc.), so you can create an OpenGL
context in a platform-independent matter. It knows nothing about
OpenGL itself. Not that it should anyway. OpenGL is fully
platform-independent once you take care of the context.

Despite that:

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --cflags
-I/usr/local/include/SDL -D_REENTRANT -D_GNU_SOURCE

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread

skaller at rosella:/work/sdl/SDL-1.2$ sh sdl-config --static-libs
-L/usr/local/lib -Wl,-rpath,/usr/local/lib -lSDL -lpthread -lm -ldl
-L/usr/X11R6/lib

again seems to fail to support openGL. Spec file says:

%ifos linux
CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
–disable-video-svga --disable-video-ggi --disable-video-aalib
–disable-debug --enable-dlopen
–enable-esd-shared --enable-arts-shared
%else
%configure --disable-debug --enable-dlopen
%endif

which indicates openGL should be supported. Can anyone explain
what’s going on?

Stuff runs, if one adds -lGL -lGLU to dynamic link.
Is something misconfigured, or do I misunderstand something?

It’s not a bug, it’s a feature :wink: It is not included in sdl-config
because linking libGL to every SDL application would add an unneeded
dependency, since not every SDL app would need one.

We’re trying to figure out what switches to give linkers
etc in a platform independent way. SDL_opengl already
contains opengl definitions it seems. Does the user still
have to supply an actual openGL library at link time?
So … SDL provides its own headers but the client must
supply an implementation. Deliberate?

SDL provides nothing else than context management. The OpenGL
implementation should provide both headers (GL/gl.h, GL/glext.h, etc)
for the developer to use, and a libGL library to run the resulting
program.

The best way to handle OpenGL in a fully portable manner is to do
run-time dynamic loading, which requires no compile-time linking to
libGL whatsoever. Luckily SDL is great for that.

First off call SDL_GL_LoadLibrary(NULL) to load the GL library. You
can substitute NULL for a string containing the full path to a GL
library, but leaving it to NULL indicates SDL to find the default one
on the system, which usually works out perfectly. Then use the
SDL_GL_GetProcAddress() function to load OpenGL function symbols. This
is a bit trickier to explain in an email, so look at
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fGL_5fGetProcAddress for a
quick 'n dirty example. If you want a more complete example, I’ve
wrote a small (< 300 lines) app a few months ago that does all of the
above and should not be not too hard to understand. Mail me off-list
if you want me to send it to you.

There are also free libraries available to do the ugly symbol loading
stuff mentionned above, but I’ve never used one myself so I can’t give
my opinion on any of them. The most popular of them appears to be the
one called “glew”.On 2/24/06, skaller wrote:

  • SR

Hi, I am having a problem statically linking SDL with openGL support,
and wonder if someone can throw some light on this.

Well first of all AFAIK one should never statically link OpenGL to
anything. libGL.so (or opengl32.dll, or whatever it’s called) is
implementation-specific.

That may be so, but my system supports static linkage in general,
and will support static linkage to GL libraries if they’re available
as static archives. Whether that’s a good thing to do or not is up
to Felix client programmers not Felix developers: if I can give
them a reasonable choice I’d like to.

That’s normal. SDL does not link to libGL.
[]

Stuff runs, if one adds -lGL -lGLU to dynamic link.
Is something misconfigured, or do I misunderstand something?

It’s not a bug, it’s a feature :wink: It is not included in sdl-config
because linking libGL to every SDL application would add an unneeded
dependency, since not every SDL app would need one.

OK. Thanks for your detailed explanation! I think this answers
the question plainly.

The best way to handle OpenGL in a fully portable manner is to do
run-time dynamic loading, which requires no compile-time linking to
libGL whatsoever. Luckily SDL is great for that.

First off call SDL_GL_LoadLibrary(NULL) to load the GL library. You
can substitute NULL for a string containing the full path to a GL
library, but leaving it to NULL indicates SDL to find the default one
on the system, which usually works out perfectly.

Ah, ok. I wasn’t aware of that function – well, I saw it but didn’t
know what it was for because I didn’t really understand the structure
of Open GL and friends. Your explanation here is very good –
thanks!

There are also free libraries available to do the ugly symbol loading
stuff mentionned above, but I’ve never used one myself so I can’t give
my opinion on any of them. The most popular of them appears to be the
one called “glew”.

I’ve had a brief look at glew. It’s an extra dependency,
but again, use or not of it should be up to the client
programmer not me. However the header files looked particularly
difficult to understand. (I have to build a binding to it,
since Felix isn’t C: I have a tool which can do that automatically
but it can’t handle macros since macro variables and
functions don’t have any obvious type)

Anyhow, thanks again for taking the time to give this
explanation, and I hope someone else benefits from it.
May even be worth placing in the FAQ?On Tue, 2006-02-28 at 02:06 -0500, Simon Roby wrote:

On 2/24/06, skaller <@john_skaller> wrote:


John Skaller
Async PL, Realtime software consultants
Checkout Felix: http://felix.sourceforge.net

Hello,

I’ve noticed that `sdl-config’ usage reports that --static-libs is
available even when it’s not.
I’ve modified the ‘sdl-config.in’ file so that it no longer reports
’–static-libs’ if SDL was compiled with --disable-static.
I didn’t change --disable-shared behavior.

Attached is a u3 patch.

Julien

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed…
Name: sdl-config.patch
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060420/2676b4fa/attachment.txt

Hello,

I’ve noticed that `sdl-config’ usage reports that --static-libs is
available even when it’s not.
I’ve modified the ‘sdl-config.in’ file so that it no longer reports
’–static-libs’ if SDL was compiled with --disable-static.
I didn’t change --disable-shared behavior.

Thanks! Your patch is in CVS.

See ya,
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment