What's up with back buffers?

Blitz3D Forums/Blitz3D Programming/What's up with back buffers?

SkyCube(Posted 2005) [#1]
Hi,

I'm still new to Blitz and had not used BlitzBasic before either, so this question might seem dumb, but here goes: I was trying out code(a cube that moves over a plane with the cursor keys, very simple) and nothing moved, even though my "world" was rendered the first time. In the end, I solved the problem by adding the SetBuffer Backbuffer() instruction at the beggning and the Flip instruction at the end of the loop. I thought these two instructions were only for 2D stuff, and I am almost certain I have seen 3D examples that don't use them. Can anyone explain when these instructions are necessary?


Conan(Posted 2005) [#2]
http://www.blitzbasic.com/b3ddocs/command.php?name=FrontBuffer&ref=2d_cat

http://www.blitzbasic.com/b3ddocs/command.php?name=BackBuffer&ref=2d_cat

You're welcome ;)


DJWoodgate(Posted 2005) [#3]
Renderworld only draws to the backbuffer. So you need the flip to swap the backbuffer with the frontbuffer, because as you probably know you only ever see the frontbuffer.

Usually you do not need to set the backbuffer every loop unless you are setting another buffer for some reason.

Oh and there are differences in the way windowed modes handle the two buffers. But usually you will not be aware of them.


SkyCube(Posted 2005) [#4]
Cool! Thanks for clearing that up.