Files
BlitzNext/_release/help/commands/2d_commands/BackBuffer.htm
T
2014-02-26 16:08:39 +13:00

22 lines
2.2 KiB
HTML

<html><head><title>Command: BackBuffer() </title><meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'><link rel='stylesheet' href='../css/commands.css' type='text/css'></head><body><span class='Command'>&nbsp;&nbsp;BackBuffer() &nbsp;&nbsp;</span></p><span class='header'>Definition:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>Indicates the BackBuffer drawing buffer.</td></tr></table><span class='header'><br>Parameter Description:</span> <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>None.</td></tr></table><p class='header'>Command Description: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>This is a value usually used with <a href='SETBUFFER.htm'>SETBUFFER</a> to denote the secondary non-visible drawing buffer called the Back Buffer. In MOST gaming situations, you will want to be using the BackBuffer() for drawing operations then using <a href='Flip.htm'>Flip</a> to bring that buffer to the <a href='FrontBuffer().htm'>FrontBuffer()</a> where it can be seen. There are other uses for the command, but this is the biggie. See <a href='SETBUFFER.htm'>SETBUFFER</a> for more info, and check out the example. Once again - if you set drawing operations to the BackBuffer() you will NOT see any of them until you call FLIP.</td></tr></table><p class='header'>Example: <br><br><table width='100%' border='0' cellspacing='2' cellpadding='2' align='center'><tr><td>; Flip/Backbuffer()/Rect Example<br>
<br>
; Set Graphics Mode<br>
Graphics 640,480<br>
<br>
; Go double buffering<br>
SetBuffer BackBuffer()<br>
<br>
; Setup initial locations for the box<br>
box_x = -20 ; negative so it will start OFF screen<br>
box_y = 100<br>
<br>
While Not KeyHit(1)<br>
Cls ; Always clear screen first<br>
Rect box_x,box_y,20,20,1 ; Draw the box in the current x,y location<br>
Flip ; Flip it into view<br>
box_x = box_x + 1 ; Move the box over one pixel<br>
If box_x = 640 Then box_x=-20 ; If it leaves the Right edge, reset its x location<br>
Wend<br>
<br></td></tr></table><p><b><a target="_top" href="../index.htm">Index</a></b></p></body>
</html>