DX8 Surface Locking

Started by
4 comments, last by LoreKeeper 22 years, 1 month ago
Hey... I''ve been recently trying to do a bit of DX8 pixel manipulation, but this seems to be problematic; I''ve done the following: D3DDev8.GetBackBuffer(.., 0, Surface); // gets the surface, works Surface.GetDesc(surfDesc); // works Surface.LockRect(surfRect, nil, 0); // returns an error The surface descriptor says the surface is the current render_target (great) and seems generally right, except that the "size in bytes" is 0. And this although I do 3D renders and font writing to the surface as well. I don''t get it. Help anywhere? Thanks
Advertisement
Turn on DEBUG DX and it should give you an error message, unless its crashing. What error does it return (if no crashing) ?

-------
Happy Coding!
Homepage: www.pcwebvia.f2s.com
-------Homepage: http://www.pclx.com
What exactly are you trying to do? In 99% of the cases, locking the backbuffer is not a good thing to do.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
Try using GetRenderTarget() instead of GetBackBuffer(...)
Thanks, I''ll try it.

I want to be able to perform direct pixel and buffer manipulation, thatZ why I want the surface locked. I don''t know what error is returned (I''ll check that up some time).

It doesn''t actually crash... the function just fails... bluddy function...

I''ll mess with it some more... thanks again
Uhm... *blind* - I just discovered what the problem was, on device creation I had to set the "D3DPRESENTFLAG_LOCKABLE_BACKBUFFER" flag.

Great. :D

This topic is closed to new replies.

Advertisement