Read float from video memory

Started by
1 comment, last by NiGoea 14 years, 5 months ago
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
Advertisement
Interpret the bytes as an array of D3DXFLOAT16. That type has an operator for casting to FLOAT.

You can also use D3DXFloat16To32Array().
Quote:Original post by MJP
You can also use D3DXFloat16To32Array().


I used this ! It works ;)

Thank you !!

This topic is closed to new replies.

Advertisement