Jump to content
  • Advertisement


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


Direct Access to Backbuffer in D3D8

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

Hi! Lately I''ve been trying to get direct access to the backbuffer, and it hasn''t been working. Here''s how I tried it:
// Globals

int *iBuffer;

// COnstants

#define _RGB32BIT(a,r,g,b) ((b) + ((g) << 8) + ((r) << 16) + ((a) << 24))

//In my init code

lp3dd->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &lpd3ds);
LockRect.Pitch = 3200;
LockRect.pBits = &iBuffer;

//In my Render loop

lpd3ds->LockRect(&LockRect, NULL, NULL);
iBuffer[x+(y*LockRect.Pitch >> 3)] = _RGB32BIT(255, 255, 100, 255);

I suspect that my problem is the pitch. How do you get the pitch of the backbuffer? I just guessed that it was 3200, because I''m using 800X600X32 Am I on the completely wrong track? -Forcas
"Elvis is alive. He is Barney the purple dinosaur. He is the pied piper that leads our children into the wages of sin and eternal damnation."

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!