Sign in to follow this  

SDL Question

This topic is 4303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

It basically breaks down like this.

SDL - simple, easy pixel manipulation, easy colorkey, good at low bits per pixel and resolution

OpenGL (with good graphics card) - fast at high resolutions, much faster for transformations, can enable vsync, blending options

SDL is very good if you want to build a retro game with not much rotation and scaling, and 800x600 with 16bpp or less.

Share this post


Link to post
Share on other sites
You can, but unlike with Direct3D or OpenGL, where you often see a speed increase if you move from 16bpp to 32bpp, in SDL it is not unusual to see very noticeable decreases in speed when doubling the bits per pixel. Whether or not the increase in quality is worth it to you is a matter of preference.

Also if you use indexed color modes, SDL is a good choice. Probably a better one than OGL/D3D.

Share this post


Link to post
Share on other sites
Quote:
Original post by baumep
If you want SDL to use OpenGL when blitting, with all the advantages when using transparency and high resolution, you might give glsdl a try. It's quite easy to setup and you don't have to rewrite your SDL related code or implement blitting on your own.


In the same spirit, you might want to take a look at hxrender. I have not used it myself so I cannot comment on it or recommend it, but it seems to be an easy and lightweight library to use OpenGL rendering with SDL.

Share this post


Link to post
Share on other sites
If you are used to using SDL then glsdl is great. You can finally use the destination rectangle in SDL_BlitSurface to scale an object and as long as you have decent OpenGL drivers you will see a nice performance boost when using alpha. I never really looked for rotation and am unsure if/how it supports that but with the scaling and alpha support why not give it a shot? If all else fails you can always look at the code and figure out what they did, it is after all freely available to look at and use.

If you are a little more familiar with some 3d terminology then I would highly recommend hxRender. It isn't really for the complete 3d newbie but the learning curve is pretty low with it compared to using SDL and OpenGL without any help from a 3rd party library. The best part about hxRender (IMHO) is that it is relatively small and isn't very complicated under the hood.

Lastly but definitely not least I also recommend using irrlicht if you have the time. It has some great 2d capabilities using OpenGL or D3D under the hood and it comes with built in GUI support. As with anything of this size, there is a bit of a learning curve but there is no reason that with a few days playing with it that you couldn't do anything you can do in SDL and more than likely much more. There is a great community and really offers quite a bit of flexibility.

Share this post


Link to post
Share on other sites

This topic is 4303 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this