Archived

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

DenisY

direct access to backbuffer

Recommended Posts

DenisY    122
I''m newbie to directx and I want to get direct access to backbuffer. I found IDirect3DDevice8::GetBackBuffer, IDirect3DSurface8::LockRect and UnlockRect functions in SDK help, but how should I use them? my current version (call GetBackBuffer in initialization section and Lock/Unlock after EndScene() but before Present()) isn''t work: Lock/Unlock fails. maybe there is another, more correct way to get backbuffer bits? Big thanks to everyone who will try to help!

Share this post


Link to post
Share on other sites
EbonySeraph    122
That is how you are supposed to get the back buffer directly...but make sure you unlock the same rect of the BackBuffer that you locked - if you used the whole surface, then the rect should be NULL for both lock and unlock calls.

"Ogun''s Laughter Is No Joke!!!" - Ogun Kills On The Right, A Nigerian Poem.

Share this post


Link to post
Share on other sites
DenisY    122
Yes, i''m using rect = NULL.
And i''m doing Unlock just after Lock (and it[unlock] doesn''t need any parameters)
Lock fails - here is the problem

Share this post


Link to post
Share on other sites
a person    118
you have to create the device with the ability to lock the buffer since it slows things down when this feature is on. furthermore accessing the backbuffer like this is slow. so unless this is for a screenshot feature, rethink what you are really trying to do.

post the error (ie get the number that returns fomr the bad lockrect() and look up what the error code means, it will help solve your problem)

Share this post


Link to post
Share on other sites