Jump to content
  • Advertisement


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


DirectX 8 How do you lock a surface?

This topic is 5803 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

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...

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

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!