Ahh.. the joys of newbie coding

I love picking up a new idea or technology and whacking it with a big
stick util it cries for mercy…

today’s recipient: the SDL library

I have a stupid game programming question…

I plan to use TGA files in my program once I understand how BMP’s
work… Now, I write a loading function to return the image I wish to
load… once I have all my images, I want to know how the following
works…

Hypothetically, this should work the same for either format:

Display Background.TGA and display spaceship.TGA on top. Now, how do
I do that? do I dump the background image to the buffer and then write
the spaceship image to the appropriate space? This is what I would
assume would be the way…

Does anyone have any sample code that does something similar?

I’m envisioning logic that does the following:

Loop

check for event

if event, process… (i.e. keyboard, joystick)

else

display

calculate spaceship location
write background
write spaceship based on current location data
flip buffers

End Loop

Is this roughly correct?

Daniel

Oh, an incidentally, I mean simple sample code… I can download half the
games on libSDL.org but they are full of crap that I would rather not dig
through trying to understand this if someone already has an easier one…

Daniel

Daniel Davis wrote:> I love picking up a new idea or technology and whacking it with a big

stick util it cries for mercy…

today’s recipient: the SDL library

I have a stupid game programming question…

I plan to use TGA files in my program once I understand how BMP’s
work… Now, I write a loading function to return the image I wish to
load… once I have all my images, I want to know how the following
works…

Hypothetically, this should work the same for either format:

Display Background.TGA and display spaceship.TGA on top. Now, how do
I do that? do I dump the background image to the buffer and then write
the spaceship image to the appropriate space? This is what I would
assume would be the way…

Does anyone have any sample code that does something similar?

I’m envisioning logic that does the following:

Loop

check for event

if event, process… (i.e. keyboard, joystick)

else

display

calculate spaceship location
write background
write spaceship based on current location data
flip buffers

End Loop

Is this roughly correct?

Daniel

Oh, an incidentally, I mean simple sample code… I can download half the
games on libSDL.org but they are full of crap that I would rather not dig
through trying to understand this if someone already has an easier one…

I did a talk on SDL at my LUG and a game design club. It was a while ago,
so the API may have changed a little, but the examples should still be
usable.

http://www.lugod.org/presentations/

Look for the SDL Talk ones. There are two. Enjoy!!!

-bill!

I plan to use TGA files in my program once I understand how BMP’s
work… Now, I write a loading function to return the image I wish to
load… once I have all my images, I want to know how the following
works…

the SDL_image library has a pretty complete TGA image loader, and handles
many other formats

Ok, I didn’t realize that…

Thanks,

Daniel

Mattias Engdeg?rd wrote:> >I plan to use TGA files in my program once I understand how BMP’s

work… Now, I write a loading function to return the image I wish to
load… once I have all my images, I want to know how the following
works…

the SDL_image library has a pretty complete TGA image loader, and handles
many other formats

Cool, I will check it out… Thanks

Daniel

William Kendrick wrote:> >

Oh, an incidentally, I mean simple sample code… I can download half the
games on libSDL.org but they are full of crap that I would rather not dig
through trying to understand this if someone already has an easier one…

I did a talk on SDL at my LUG and a game design club. It was a while ago,
so the API may have changed a little, but the examples should still be
usable.

http://www.lugod.org/presentations/

Look for the SDL Talk ones. There are two. Enjoy!!!

-bill!

“William Kendrick” schrieb im Newsbeitrag news:200104150557.f3F5vNh20204 at sonic.net

Oh, an incidentally, I mean simple sample code… I can download half the
games on libSDL.org but they are full of crap that I would rather not dig
through trying to understand this if someone already has an easier one…

I did a talk on SDL at my LUG and a game design club. It was a while ago,
so the API may have changed a little, but the examples should still be
usable.

http://www.lugod.org/presentations/

The page is pretty nice :=)> Look for the SDL Talk ones. There are two. Enjoy!!!

-bill!

Are there any AUDIO Recordings on that page available ???

CU

“William Kendrick” schrieb im Newsbeitrag news:200104150557.f3F5vNh20204 at sonic.net…> >

Oh, an incidentally, I mean simple sample code… I can download half the
games on libSDL.org but they are full of crap that I would rather not dig
through trying to understand this if someone already has an easier one…

I did a talk on SDL at my LUG and a game design club. It was a while ago,
so the API may have changed a little, but the examples should still be
usable.

http://www.lugod.org/presentations/

Look for the SDL Talk ones. There are two. Enjoy!!!

-bill!

Are there any AUDIO Recordings on that page available ???

No, sorry. We did videotape Matt Bishop when he talked about security,
but have yet to look into digitizing the video and posting it.

-bill!