Your library

I’m thinking about writing a game for X11/Linux and your library
seems very usable for the task. I have written something similar
msyself on the Amiga a couple of years ago, and recently I dug
out the old code and made some adaptions and found it very usable
under X. My library was only for 8bit graphics, but could do things
like RLE-coded sprites, sprite layers, color palette reduction and
dithering of graphics. All these routines are plain C, and use direct
access to a screenbuffer. I’m thinking of making a new OS-independant
version of the library the runs on top of SDL. RLE-sprites are really
the way to go for fast blitting.

My library also supported compiling and reading from resource-files,
but the format is unfortunatly not endian-portable so I’ll have to
think about that some more.

Have you looked into DGA - something you can use under X11 for direct
screen access in fullscreen mode? I know UAE can use it, but I have
not found any documentation over this, but seems like it could be
usable. I’d really like to see fullscreen apps/games in X.

//Jonas Minnberg

All these routines are plain C, and use direct
access to a screenbuffer. I’m thinking of making a new OS-independant
version of the library the runs on top of SDL. RLE-sprites are really
the way to go for fast blitting.

It sounds perfect for SDL. I’m also (slowly) working on a compiled-sprite
class on top of SDL for the Maelstrom port, and compiled sprites are, I
think, the same as RLE-sprites. I’ve also gotten fast dynamic recompiling
of the sprites to handle clipping.

My library also supported compiling and reading from resource-files,
but the format is unfortunatly not endian-portable so I’ll have to
think about that some more.

Have you looked at the functions in SDL_endian.h?
They may be useful for you:

/* This is called by SDL_Init(), returns 1234/4321 for little/big endianness */
SDL_DEFUN(int, SDL_CalculateEndian, (void))

SDL_DEFUN(Uint16, SDL_ReadLE16, (FILE *fp))
SDL_DEFUN(Uint16, SDL_ReadBE16, (FILE *fp))
SDL_DEFUN(Uint32, SDL_ReadLE32, (FILE *fp))
SDL_DEFUN(Uint32, SDL_ReadBE32, (FILE *fp))

SDL_DEFUN(void, SDL_WriteLE16, (FILE *fp, Uint16 value))
SDL_DEFUN(void, SDL_WriteBE16, (FILE *fp, Uint16 value))
SDL_DEFUN(void, SDL_WriteLE32, (FILE *fp, Uint32 value))
SDL_DEFUN(void, SDL_WriteBE32, (FILE *fp, Uint32 value))

Have you looked into DGA - something you can use under X11 for direct
screen access in fullscreen mode? I know UAE can use it, but I have
not found any documentation over this, but seems like it could be
usable. I’d really like to see fullscreen apps/games in X.

Yup, it’s on my list of supported interfaces for Linux/SDL, right
after GGI support.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Linux Maelstrom -
http://www.devolution.com/~slouken/Maelstrom/

Sam Lantinga wrote:

All these routines are plain C, and use direct
access to a screenbuffer. I’m thinking of making a new OS-independant
version of the library the runs on top of SDL. RLE-sprites are really
the way to go for fast blitting.

It sounds perfect for SDL. I’m also (slowly) working on a compiled-sprite
class on top of SDL for the Maelstrom port, and compiled sprites are, I
think, the same as RLE-sprites. I’ve also gotten fast dynamic recompiling
of the sprites to handle clipping.

Compiled sprites are pushing it I think, especially since you have to
write
one separate routine for each processortype. I just RLE blocks of data
first, and then unRLE it to the screen (but not on the fly).
You say you use dynamic recompiling for splitting - can this really be
quick? I’m thinking of using another routine as memcpy() in the RLE
decoder when clipping against X is necessary, which clips the actual
memcpy against the screen. Y clipping can be done before drawing the
sprite.

Have you looked into DGA - something you can use under X11 for direct
screen access in fullscreen mode? I know UAE can use it, but I have
not found any documentation over this, but seems like it could be
usable. I’d really like to see fullscreen apps/games in X.

Yup, it’s on my list of supported interfaces for Linux/SDL, right
after GGI support.

I tried it yesterday, it was much easier than I thought. Very nice to
have
direct access to the videomemory and being able to doublebuffer AND wait
for the VBL (Vertical Retrace). I also found a few routines for checking
available screen modes and switching.
I only got one problem - how the F**K do you find out bits_per_pixel for
the display?! I run 32bit but this is always reported as 24bits, no
matter
if I use DefaultDepth(), or search all visuals with XMatcvhVisualInfo().
The only thing I can come up with is check the X-process and see what
arguments it was started with (and thats NOT very nice).

// Jonas