dx8: render, take bitmap and more

Started by
3 comments, last by besh81 18 years, 3 months ago
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]
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Is using D3DXSaveSurfaceToFile not an option?

[EDIT] Oh, this is DX8. Is that function available there? [/EDIT]
Sirob Yes.» - status: Work-O-Rama.
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

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.

This topic is closed to new replies.

Advertisement