SDL and 3D for 2D games

Hi,

Been using SDL for a bit, half completed a 2D game using pure SDL_BlitSurface and other 2D specific functionality. The big issue now is that the more I look at it the more I think that the advantages of 3D functionality(i.e. scaling of images, alpha blending, particles effect et al) are worth re-write my game. Partially it is a pipeline issue I ran into with my artists.

Would like to know if anybody is using OpenGL and SDL together. Also would like to know how successfully they have been down this route before I think about re-writing the game? Compatibility problems?

Cheers,

Terence

I had the same problem with sdl.
It is hard to get scaling , roating and alphablending at the same time in a
descent speed under SDL.
You have to write a good assembler code for it to get a descant speed but
its hard to do.

So i also moved over to OpenGl for 2D blitting and hell i love it.
You can do everything wihtout losing performence.
Scale your image and Rotate it and do any blending you want.

here you can see the result
http://www.youtube.com/watch?v=GIuaVLmG2lY---------- Forwarded message ----------
From: terence_tan@posdreams.com (terence tan)
Date: 28.07.2006 14:22
Subject: [SDL] SDL and 3D for 2D games
To: sdl at libsdl.org

Hi,

Been using SDL for a bit, half completed a 2D game using pure
SDL_BlitSurface and other 2D specific functionality. The big issue now is
that the more I look at it the more I think that the advantages of 3D
functionality(i.e. scaling of images, alpha blending, particles effect et
al) are worth re-write my game. Partially it is a pipeline issue I ran into
with my artists.

Would like to know if anybody is using OpenGL and SDL together. Also would
like to know how successfully they have been down this route before I think
about re-writing the game? Compatibility problems?

Cheers,

Terence


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

no problems, sdl is made for this :slight_smile:

we use it since two years and sdl rocks on opengl

see
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/index
for a very good introduction into all this

greets
benjamin

terence tan wrote:> Hi,

Been using SDL for a bit, half completed a 2D game using pure SDL_BlitSurface and other 2D specific functionality. The big issue now is that the more I look at it the more I think that the advantages of 3D functionality(i.e. scaling of images, alpha blending, particles effect et al) are worth re-write my game. Partially it is a pipeline issue I ran into with my artists.

Would like to know if anybody is using OpenGL and SDL together. Also would like to know how successfully they have been down this route before I think about re-writing the game? Compatibility problems?

Cheers,

Terence


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Benjamin Grauer wrote:

no problems, sdl is made for this :slight_smile:

we use it since two years and sdl rocks on opengl

see
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/index
for a very good introduction into all this

greets
benjamin

terence tan wrote:

Hi,

Been using SDL for a bit, half completed a 2D game using pure SDL_BlitSurface and other 2D specific functionality. The big issue now is that the more I look at it the more I think that the advantages of 3D functionality(i.e. scaling of images, alpha blending, particles effect et al) are worth re-write my game. Partially it is a pipeline issue I ran into with my artists.

Would like to know if anybody is using OpenGL and SDL together. Also would like to know how successfully they have been down this route before I think about re-writing the game? Compatibility problems?

Cheers,

Terence


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I have been using opengl for some time, and porting game to Linux gave
me real headache (mouse ,keyboard, joystick, sound …). So I switched
to SDL and since then my live is so much easier. I strongly recommend
SDL + GL for both 2d and 3d.

like most ppl said, sdl and gl merge into some portable nice code without
inconvenients.On 7/28/06, Darko Fabijan wrote:

Benjamin Grauer wrote:

no problems, sdl is made for this :slight_smile:

we use it since two years and sdl rocks on opengl

see
http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/ogladv/index
for a very good introduction into all this

greets
benjamin

terence tan wrote:

Hi,

Been using SDL for a bit, half completed a 2D game using pure
SDL_BlitSurface and other 2D specific functionality. The big issue now is
that the more I look at it the more I think that the advantages of 3D
functionality(i.e. scaling of images, alpha blending, particles effect et
al) are worth re-write my game. Partially it is a pipeline issue I ran into
with my artists.

Would like to know if anybody is using OpenGL and SDL together. Also
would like to know how successfully they have been down this route before I
think about re-writing the game? Compatibility problems?

Cheers,

Terence


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I have been using opengl for some time, and porting game to Linux gave
me real headache (mouse ,keyboard, joystick, sound …). So I switched
to SDL and since then my live is so much easier. I strongly recommend
SDL + GL for both 2d and 3d.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

Hi,

Been using SDL for a bit, half completed a 2D game using pure
SDL_BlitSurface and other 2D specific functionality. The big issue
now is that the more I look at it the more I think that the
advantages of 3D functionality(i.e. scaling of images, alpha
blending, particles effect et al) are worth re-write my game.
Partially it is a pipeline issue I ran into with my artists.

In some cases, you can get away with preprocessing (scaling, rotating
etc) graphics at load time.

I do this in Kobo Deluxe (scaling, brightness/contrast, alpha
"contrast" and cleaning and some stuff like that) - but, that is a
retro style 2D game, so real time transforms and the like aren’t
really needed or even desired. (There are some subtle alpha blending
effects and antialiazing to emulate old soft/blurry arcade monitors,
but that’s about it; the rest is plain, old school 2D programming.)

However, it sounds like you need more than what the SDL 1.2 2D API was
really designed to do, so OpenGL - or rather, an accelerated 3D API
(that is, OpenGL - but see below…) - is probably the more sensible
choice.

Would like to know if anybody is using OpenGL and SDL together. Also
would like to know how successfully they have been down this route
before I think about re-writing the game?

No problems. Great solution! OpenGL is very portable as far as the
actual rendering is concerned, and SDL takes care of the rest (input,
sound, threads, …), which would otherwise require platform
dependent code for each platform you want to support.

If your code is reasonably structured, there shouldn’t be much
rewriting involved either. Replacing the SDL rendering calls with
your own thin rendering layer lets you add (optional, if desired)
OpenGL support. The easiest way is probably to just implement a
subset of the SDL 2D functionality in your thin layer; just enough to
make your game work. Then you can extend your rendering layer as
needed to support the extra features you want. (Extreme programming
philosophy; don’t waste time designing and implementing stuff you
don’t need.)

Compatibility problems?

Possibly some issues with OpenGL on low end Windows systems, and on
certain versions of Windows. There are some 3D cards for which no
OpenGL drivers exist, and some that have very poor OpenGL support,
but usable Direct3D support.

Many shareware game developers recommend supporting Direct3D (only, or
as an alternative to OpenGL, if you need OpenGL for other platforms),
because Direct3D is generally a safer bet on Windows, if you want
your game to work on “pretty much anything”. And that is probably
what you want if you want to make money and aren’t making AAA
titles…

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Friday 28 July 2006 14:22, terence tan wrote: