Jump to content
  • Advertisement

Archived

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

Yratelev

DirectX 8 How do you lock a surface?

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

Advertisement
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

  • 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!