Jump to content
  • Advertisement
Sign in to follow this  
besh81

dx8: render, take bitmap and more

This topic is 4612 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'm working on an simple application and I need to render some 3D object (with zbuffer, transparency, light, ect ect) and then copy some rectangle of the backbuffer (or surface??? which is the better???) to a bitmap (16/32bit) or raw image. I'm in trouble with the color format and with the routine to read the backbuffer. [EDIT] when I getbackbuffer the returned surface is 117x2 pixel (application works in 640x480), why??? [Edited by - besh81 on January 4, 2006 5:30:44 AM]

Share this post


Link to post
Share on other sites
Advertisement
Where are you getting the 117x2 value from? are you querying the surfaces GetDesc() or is it based on information you get from locking it?

Locking a resource will give you the direct binary representation which you are responsible for decoding line by line (you have to take the 'stride' into account when addressing). It's difficult for us (or you) to do anything without knowing both the input and output formats.

hth
Jack

Share this post


Link to post
Share on other sites
Is using D3DXSaveSurfaceToFile not an option?

[EDIT] Oh, this is DX8. Is that function available there? [/EDIT]

Share this post


Link to post
Share on other sites
Quote:
Original post by sirob
Is using D3DXSaveSurfaceToFile not an option?

[EDIT] Oh, this is DX8. Is that function available there? [/EDIT]

I'm pretty sure that function was new to D3DX9, and it doesn't get mentioned in my DX8 SDK documentation file either...

Jack

Share this post


Link to post
Share on other sites
I get the 117x2 value from the surfaces GetDesc() if I don't set the backbuffer width/heigth in windowed mode (I use the base drunkenHyena framework). If I set those values the retrieved surface is ok.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!