Archived

This topic is now archived and is closed to further replies.

Yratelev

DirectX 8 How do you lock a surface?

Recommended Posts

After that you will get a D3DLOCKED_RECT structure. I havnt really worked with is but as far as I know you can just copy in the appropriate bits into void* pBits;

Share this post


Link to post
Share on other sites
You must pass a D3D_LOCKRECT (or similar) struct to Surface->LockRect(). After the function returns, this struct will hold a pointer to the pixel data of the surface, and a pitch (hte actual length of a line in memory).

What you might want to do now is Read/Write pixel (i, j) : this pixel is located at pPixelData[i*sizeof(PixelFormat) + j*Pitch](this is not really called "pixeldata", but i don't remember the actual name, same thing for pitch).

[EDIT]Encountered some 500's before I could post...

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

[edited by - ToohrVyk on January 20, 2003 3:16:43 PM]

Share this post


Link to post
Share on other sites