A lot of SDL Question and Suggestion for Sam Imglib and SDLttf

Hi Everyone/Sam :slight_smile:

As I said earlier, I'm working on a C++ Game Construction Set called

RPGen (Role Playing Game Generator) that aim to be a complete construction kit
to create your own RPG Game (a la Chrono Trigger/FF Like) without even having
to write a single line of code.

I've decided to use simple Linked list for my object database cause I

feel confortable with them (BSP Tree look so complicated and much more for 3D
Game like Doom…). Of Course it will require me Z Buffering and I wanted to
know if anyone have an efficient way doing Z buffering under SDL…

Of course I could go across my linked list looking at each object.z

variable and first blit the 0, go across again and blit the obj.z == 1 … but
that isn’t much efficient if you got like up to 10 layers…

I've wondered if there was any kind of Algorithm that can sort the

Linked list by Z Buffers and then I would just have to blit my list in order by
going trought it only once :slight_smile: (That would save some process :slight_smile:

Every Suggestion are welcome for this Z Buffering stuff :)

Also, About graphic programming, I would like to have people toughts

about the best way to refresh the screen (and viewports) of a game… Thread or
in the main loop using threads for other function such as Event Trap and Sound
? Also, my BIG concern is getting the Best FPS result possible :slight_smile: and is the
SDL_SWSURFACE the best for the Screen in a scrolling game or SDL_HWSURFACE ?

Sam, could you give me some hints of the Way game like Civ refresh

their Game window ? (that would help:)

A last question, I've seen file such as  IMG_jpg.c and IMG_tif.c in

SDL Imglib library but the Readme said this lib doesn’t support them. Is there
a way to have Jpeg support (I don’t really care about Tiff file)

Enuff Questions ... Now for Suggestions :)

It's just a little  #ifdef stuff I think people could really appreciate.

In SDLttf and Imglib. there is no

#ifdef __cplusplus
extern “C” {
#endif

#ifdef __cplusplus
}
#endif

Those 6 little line could save many frustrations for New C++ programmers like
me :slight_smile: I had OP from the Effnet C++ channel working on this problem for 1:30
hour before they make me realize that was the problem :slight_smile:

It's just to be sure that C++ codes don't get Undefined References to

… Functions :slight_smile:

That's  IT !!!   Sorry for the Size of this message .. it's just that I

put my questions on hold and then Ask in a row :wink:

That's to all of you to answering this and my old messages and Special

Thanks to Sam for his incredibly dedicated work on SDL and Cool Games Port to
Linux (Loki Rules !! how you make it ??? So much games to port :slight_smile:

	Good Luck Everyone

Jeremie Plante   --> Smiley Addicted

When added items to your linked list, add them in order of the z value. So
when going across your list the first items in the linked list will be 1, then
2…

-Garrett, WPI student majoring in Computer Science.

“He who joyfully marches in rank and file has already earned
my contempt. He has been given a large brain by mistake, since
for him the spinal cord would suffice.” -Albert EinsteinOn Mon, 26 Jul 1999, you wrote:

Of course I could go across my linked list looking at each object.z
variable and first blit the 0, go across again and blit the obj.z == 1 … but
that isn’t much efficient if you got like up to 10 layers…

Jeremie Plante wrote:

Hi Everyone/Sam :slight_smile:

    As I said earlier, I'm working on a C++ Game Construction Set called

RPGen (Role Playing Game Generator) that aim to be a complete construction kit
to create your own RPG Game (a la Chrono Trigger/FF Like) without even having
to write a single line of code.

What is the current status of RPGen?
Do you plan on updating the web site?

Paul Lowe
spazz at ulink.net

Also, About graphic programming, I would like to have people toughts
about the best way to refresh the screen (and viewports) of a game… Thread or
in the main loop using threads for other function such as Event Trap and Sound
? Also, my BIG concern is getting the Best FPS result possible :slight_smile: and is the
SDL_SWSURFACE the best for the Screen in a scrolling game or SDL_HWSURFACE ?

Most of the games I’ve seen use the main thread for graphics updates and
other threads for networking and sound and possibly events. Graphics and
AI tend to be the more CPU intensive and complicated portions of your game.
Threads can be a pain, especially if you don’t follow a few simple rules:
Keep thread routines simple
Avoid interaction with other threads
Design them so they need to lock resources as little as possible
Use system services as little as possible
Stick a delay in them occasionally so they don’t starve other threads

If you can find a way to solve your problem without threads, it will probably
be simpler and less headaches in the long run.

Unfortunately SDL provides no way of changing the display offset in video
memory (most systems have to emulate this with a blit copy anyway) so in
general scrolling involves blitting the portion that scrolled, along with
the new area. You can’t blit from a surface to that same surface in a
left or up direction. This is a limitation of the SDL blitters.

Any tips from other people who have done scrollers in SDL?

Sam, could you give me some hints of the Way game like Civ refresh
their Game window ? (that would help:)

Civ just redraws the entire screen.

A last question, I’ve seen file such as IMG_jpg.c and IMG_tif.c in
SDL Imglib library but the Readme said this lib doesn’t support them. Is there
a way to have Jpeg support (I don’t really care about Tiff file)

Implement the functions stubbed in the files. :slight_smile:

It’s just a little #ifdef stuff I think people could really appreciate.
In SDLttf and Imglib. there is no

#ifdef __cplusplus
extern “C” {
#endif

#ifdef __cplusplus
}
#endif

Those 6 little line could save many frustrations for New C++ programmers like
me :slight_smile: I had OP from the Effnet C++ channel working on this problem for 1:30
hour before they make me realize that was the problem :slight_smile:

I’ll add that.

That’s to all of you to answering this and my old messages and Special
Thanks to Sam for his incredibly dedicated work on SDL and Cool Games Port to
Linux (Loki Rules !! how you make it ??? So much games to port :slight_smile:

Thanks! :slight_smile:

-Sam Lantinga				(slouken at devolution.com)

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