Bmx help states that "Flip swap the front and back buffers of the current graphics objects".So if I have some movement in program logic achieved by drawing new object position to back buffer and then flipping buffers and then I do this:if KeyDown(KEY_SPACE) While 1 Flip 1 WendEndif So when I press space I should see my movement going back and forward in a loop right? So why I just see still frame?
graphics(640,460,60,GRAPHICS_BACKBUFFER) 'Set graphics; using backbuffer is recommended. 60 = hertz. writing 60 fixes to 60 so it's better to detect.While not app_terminate() 'App_terminate can be a user variable too; whatever you use to keep the game running cls 'clear the screen '--------------------------------- 'do your app crap here '--------------------------------- flip 'see flip document for vsync supportwend
Flip actually copies the back buffer to the front buffer so they are identical after flipping. Yes the word swap does indeed sound like they are exchanged not copied. Bad wording.
SuperStrictSetGraphicsDriver GLMax2DDriver()'SetGraphicsDriver D3D9Max2DDriver()'SetGraphicsDriver D3D7Max2DDriver()'Graphics 800,600 'Windowed modeGraphics 800,600,32 'Fullscreen modeClsDrawRect 10,10,100,100FlipDrawOval 120,10,100,100FlipWhile Not KeyHit(KEY_ESCAPE) And Not AppTerminate() If KeyHit(KEY_SPACE) Then FlipWend
Here is one method for fixing the logic rate...