GL Problems/Examples

Well, OK, I’m finally getting around to workong on 3D graphics w/ SDL. I’m
having a few problems, however - I can’t get OpenGL and SDL to play nice.
My while system freezes for about 5-10 seconds during the call to
SDL_SetVideoMode, and then it starts - I know this is a problem, since no
other SDL+OpenGL app does this. Also, I can’t find any decent
documentation on how to properly and efficiently use the SDL GL functions.

Are there any good examples or simple (I don’t want to dig thru the
source code of a 200,000 line app) apps out there I can take a look at?

And no, I don’t really know OpenGL yet, but I need to get it init right
with SDL before I can play with it. ~,^

Thanks in advance, everyone!–
Sean Middleditch
of
AwesomePlay Productions, Inc.

Sean Middleditch wrote:

Are there any good examples or simple (I don’t want to dig thru the
source code of a 200,000 line app) apps out there I can take a look at?

If you look in the “test” subdirectory of your SDL source distribution you’ll
see “testgl.c”. While it’s not exactly a jaw-dropping visual treat, it does
provide a good example framework for using OpenGL under SDL.

And no, I don’t really know OpenGL yet, but I need to get it init right
with SDL before I can play with it. ~,^

Here’re a rather splendid pair of short articles which give a good
introduction to OpenGL fundamentals:

http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_build.html
http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_render.html

The example code is very simple and well commented. Although it uses the GLUT
framework rather than SDL’s framework, it shouldn’t be hard for you to see how
the OpenGL concepts it illustrates could be used equally well under SDL.

Thanks in advance, everyone!

Sean Middleditch
of
AwesomePlay Productions, Inc.

Good luck!

David.

Sean Middleditch wrote:

Are there any good examples or simple (I don’t want to dig thru the
source code of a 200,000 line app) apps out there I can take a look at?

If you look in the “test” subdirectory of your SDL source distribution
you’ll
see “testgl.c”. While it’s not exactly a jaw-dropping visual treat, it
does
provide a good example framework for using OpenGL under SDL.

Ah, OK. I hadn’t installed from source, so I didn’t even think of that.
Shows how bright I am, hmm? ~,^

Hmm… I keep getting file not found errors when trying to download
SDL-1.17.tar.gz from libsdl.org… Guess I should try again a little later.
^,^

And no, I don’t really know OpenGL yet, but I need to get it init right
with SDL before I can play with it. ~,^

Here’re a rather splendid pair of short articles which give a good
introduction to OpenGL fundamentals:

http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_build.html
http://www.oreillynet.com/pub/a/network/2000/06/23/magazine/opengl_render.html

Nifty! I’ll check them out!

I remember there being some tutorials be NeHe or somesuch; I thought there
were links to it from the libsdl.org site, but I can’t find them. I recall
them being fairly good-looking (not that I looked to closely at them at the
time, I was still experimenting with 2D).

The example code is very simple and well commented. Although it uses the
GLUT
framework rather than SDL’s framework, it shouldn’t be hard for you to
see how
the OpenGL concepts it illustrates could be used equally well under SDL.

Ya, I would think so, too. ^,^

Thanks a lot!On 2001.01.29 05:21:43 -0500 David Bateman wrote:

Thanks in advance, everyone!

Sean Middleditch
of
AwesomePlay Productions, Inc.

Good luck!

David.


Sean Middleditch
of
AwesomePlay Productions, Inc.

Hmm… I keep getting file not found errors when trying to download
SDL-1.17.tar.gz from libsdl.org… Guess I should try again a little later.

It’s SDL-1.1.7.tar.gz

I remember there being some tutorials be NeHe or somesuch; I thought there
were links to it from the libsdl.org site, but I can’t find them. I recall
them being fairly good-looking (not that I looked to closely at them at the
time, I was still experimenting with 2D).

http://www.libsdl.org/opengl/intro.html

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

Hmm… I keep getting file not found errors when trying to download
SDL-1.17.tar.gz from libsdl.org… Guess I should try again a little
later.

It’s SDL-1.1.7.tar.gz

Ya, I know, that was just a typo. ^,^ The link on the download page of
libsdl.org wasn’t working, though. And I just now tried it, and it still
isn’t working.

I remember there being some tutorials be NeHe or somesuch; I thought
there
were links to it from the libsdl.org site, but I can’t find them. I
recall
them being fairly good-looking (not that I looked to closely at them at
the
time, I was still experimenting with 2D).

http://www.libsdl.org/opengl/intro.html

Ya, I just found the link… either I need less caffeine, or a lot more of
it… Thanks though!On 2001.01.30 00:46:28 -0500 Sam Lantinga wrote:

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


Sean Middleditch
of
AwesomePlay Productions, Inc.