Jump to content
  • Advertisement
Sign in to follow this  
NiGoea

Read float from video memory

This topic is 3180 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 all ! I have to 'download' a small texture from the video memory, and read it. Problem is that the texture is float, like D3DFMT_G16R16F or D3DFMT_R16F. The first annoying problem is that i can't use CreateOffscreenPlainSurface with D3DFMT_R16F and D3DPOOL_SYSTEMMEM. Does someone know why ? But the big problem is, how do I interpret the raw bytes ? I can copy the data into a buffer, but once there, how can I read the FLOAT values ? THANKS

Share this post


Link to post
Share on other sites
Advertisement
Interpret the bytes as an array of D3DXFLOAT16. That type has an operator for casting to FLOAT.

You can also use D3DXFloat16To32Array().

Share this post


Link to post
Share on other sites
Quote:
Original post by MJP
You can also use D3DXFloat16To32Array().


I used this ! It works ;)

Thank you !!

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!