Skip to main content
gamedev.net
🔒 Locked

backbuffer surface ,zbuffer

Started by luasitdown 2 replies 700+ views
Original Post
luasitdown
luasitdown
how to access backbuffer surface or zbuffer? and when is backbuffer surface or z buffer created?
neneboricua19
neneboricua19
The backbuffer and depth buffer are normally created when IDirect3D9::CreateDevice is called. The values in the PRESENT_PARAMETERS structure determine the size and formats of these buffers.

If you need to access the backbuffer, you will need to specify that the backbuffer is "lockable" by using one of the D3DPRESENTFLAG values inside the PRESENT_PARAMETERS structure.

It is possible to lock the depth buffer to access its data, but this is not guaranteed to work on all hardware. Different hardware vendors implement the depth buffer in different ways. Avoid attempting to directly access the data in the depth buffer if at all possible.

In general, it is not a good idea to lock the back buffer or the depth buffer. What is it that you are trying to do? Perhaps there is a better way to do it than trying to lock these two buffers.

neneboricua
luasitdown
luasitdown
Thanks ,I want to do occlusion dectection by z - checking .

Are there better way to do that?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.