2D OpenGL SDL Engine Help

Started by
7 comments, last by Inmate2993 17 years, 4 months ago
To use just SDL, you want SDL_BlitSurface. Perfect for the most simple of graphic work. It doesn't require that much work to get your own 2d game engine going. Basically, you could load an image in to a SDL_Surface, and keep a list of SDL_Rects that square off the tiles and sprites in that image. Make sure to set a Color Key, and each frame cycle, copy the tiles and sprites to the screen surface. For speed consideration, try to place both surfaces in hardware memory.

OpenGL is a bit more complex. I'm still learning it all myself, but apparently the process is to use Orthographic mode, load the graphics into 2d Textures in the hardware memory, and then draw polygons that use those textures. You lose some features, like Palettes since, lets face it, the support for it sucks, and SDL's opengl headers don't cover much. Although, I did figure out a few highspeed texture procedures that could kind of simulate palettes, but I guess that slows down the front side bus.
william bubel
Advertisement

.

This topic is closed to new replies.

Advertisement