Sign in to follow this  
Billr17

Rendering 24 bit bitmap to a 24 bpp DX7 Surface.

Recommended Posts

Can anyone point me in the right direction as to rendering a 24 bit bitmap to a 24 bpp DirectX 7 Surface. I am using code from LaMothes Tips and Tricks For the Windows Game Programming Guru. He shows you how to render a 24 bit bitmap to a 16 or 32 bit surface but not to an 24 bpp surface. I've tried several methods with little success. I've looked for tutorials, and searched the forums but have only found information on the loading the 16 and 32 bpp surfaces. I'd like to give the user the choice of 24 bpp if their video card supports it. Thank you. - Bill

Share this post


Link to post
Share on other sites
That's pretty easy, when you look at the code for 16/32 bit rendering:

After locking you can basically memcpy each line to the target position, advance the surface pointer by the pitch and continue on (if you use locking).

You just have to be aware that probably not all cards support a 24 bit buffer (it's a bitch speedingly wise, 32bits will probably be faster anyway), so you may fall back to another depth.


Are you having trouble with a certain kind of operation? (setting a pixel, setting up the surface?)

Share this post


Link to post
Share on other sites

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