Sign in to follow this  

SDL hardware bliting.

This topic is 3661 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

Hi, I have wrote a 2d engine using SDL. I am trying to understand how SDL decide which type of blitting to use. It seems I just can't using hardware blitting while in window mode. is this valid ? Any help in understanding how to benefit from hardware accelartion will be appreciated. Thanks, Nuno1

Share this post


Link to post
Share on other sites
Bob Pendleton has a series of articles on SDL which you may find interesting.

From what I know, you will only get acceleration using the DirectDraw backend of SDL on Windows (recent SDL builds default to the GDI backend) in fullscreen mode. On Linux, hardware acceleration *appears* to be root only, at least under X.

In many cases, using OpenGL can be a lot faster than using SDL.

Share this post


Link to post
Share on other sites
I've found that software rendering with SDL is usually faster than hardware rendering with it. There are a few reasons for this. Most computers nowadays have ample ram and processing power for pretty much any 2D game, most graphics cards are not designed to do blitting fast, and hardware alpha blending is especially slow.

Are you having performance problems in software mode?

Share this post


Link to post
Share on other sites
Well,
doing simple drawing on a framerate of 33 FPS cause my CPU (3gig Dual core) to spike. debugging SDL a little bit and I found out it decide to draw my spirtes pixel by pixel.

I was positive I am doing somthing wrong, but I get the feeling that it just how it works.

Nuno1

Share this post


Link to post
Share on other sites
If you are doing alpha blending, then SDL will draw pixel by pixel.

If you are using an alpha channel, but only with alpha values of exactly transparent and opaque, consider using colour keying instead.

If you depend on lots of alpha blending for your game, I recommend switching from SDL to something like OpenGL, which can hardware accelerate it.

I'm afraid without more information we can but guess.

Share this post


Link to post
Share on other sites

This topic is 3661 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