• Advertisement
Sign in to follow this  

DX9 and Locking the BackBuffer

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

I notice that in DX8, basic rendering went like this: //Step 1: Clear the Back Buffer //Step 2: Get a Pointer to the Back Buffer //Step 3: Lock the back buffer //Step 4: Render into the back buffer //Step 5: Unlock the back buffer //Step 6: Release the Surface //Step 7: Copy the back buffer to the primary surface I'm noticing in DX9, that you don't always need to lock the back buffer. Like if you use "UpdateSurface", it locks the back buffer for you. Did something change or am I maybe just not far enough along in my learning? I'm sort of shooting from the hip here since I know why we lock and unlock the backbuffer, etc, but I'm not sure if more advanced DX stuff, you don't have to do this.

Share this post


Link to post
Share on other sites
Advertisement
mmmm

codesampler.com has alot of dx9 tutorials ...

I'm not that much into dx functions yet(I'm a beginner myself), but you should lock the backbuffer ... one way or the other ...

Share this post


Link to post
Share on other sites
You should *never* lock the backbuffer in a D3D app. It's unbelievably bad for performance. I know Andre LaMothe does it in his books, but it's really a terrible thing to do. Firstly, it'll slow you application down to a crawl, and secondly not all cards support lockable backbuffers (although most do).

The only time you "need" to lock the backbuffer is if you're altering pixels manually, which you shouldn't need to do (you can render textured quads to do whatever you need to do). You should never lock the backbuffer before rendering, render, and then unlock it - it's not nessecary.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement