Painful newbie questions

Hello, all,

I think SDL is fantastic; it took me literally less
than 24 hours from opening the tarball to produce
a fairly nice-looking, functional game. However, I
cheated: I robbed the FrameBuf class from Maelstrom.
That class is so mind-bogglingly useful and well-
designed that it inspires my first silly question:

Why is libscreen.a not part of the SDL distribution?
Or distributed as a distinct entity from Maelstrom,
at any rate. I know SDL is supposed to be a low-level mechanism, but the
screen library seems like a perfect candidate for a distributable,
SDL-based component.

Second question:

I have never written an actual video game before,
or even much in the way of GUI stuff (other than
Tk scripts), so I am confused and intimidated by
all the complicated-looking code and discussion about
pixel depth, screen resolutions, color mapping,
etc. (I stole that code from Maelstrom, too :slight_smile:
Are there any good general references on the net
that explain such things in a simple and, preferably,
platform-neutral manner? Specifically, at the moment
I want to understand how to make part of an icon
(sprite?) transparent so that I can use a pretty
background bitmap without having big black bricks
around all my screen objects.

Incidentally, the game I’m working on is a highly
modernized version of the old curses game “worm”.
The source is available at

http://whyme.penguinpwered.com/xnake-0.1.tar.gz

I’d appreciate comments (via private mail, naturally).

Thanks a lot,

– Joe Knapka

  • What happens when a mysterious force meets an inscrutable object?

Hi Joe,On Fri, Jan 28, 2000 at 02:48:49AM -0500, Joe Knapka wrote:

Specifically, at the moment
I want to understand how to make part of an icon
(sprite?) transparent so that I can use a pretty
background bitmap without having big black bricks
around all my screen objects.

Look for SDL_SetColorKey in the docs. With it you can
specify a color that is not to be drawn. You have to
make everything that is not to be plotted in you sprite
the same color (which is not used in pixels you want to
show). Setting this color as the colorkey should do it.

All the best,
rob (in a hurry)

Why is libscreen.a not part of the SDL distribution?

It used to be part of the demos, but since Maelstrom was the only game
that used it, and since there are other graphic libraries for SDL now,
I just bundled it with Maelstrom.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec