; UnlockBuffer Example ; -------------------- Graphics 640,480,0,2 SetBuffer BackBuffer() t#=0 While Not KeyDown(1) Cls t=t+4 ; Lock the buffer so the fast pixel commands are allowed LockBuffer BackBuffer() ; Write a plasma pattern pixel by pixel into a small panel For y=0 To 95 For x=0 To 127 v#=Sin(x*4+t)+Sin(y*5-t)+Sin((x+y)*3+t*2) r=128+v*42 g=128+Sin(v*60+t)*127 b=255-r WritePixelFast 256+x,192+y,$FF000000 Or (r Shl 16) Or (g Shl 8) Or b Next Next ; UnlockBuffer MUST run before any other drawing command - ; while locked, only the read/write pixel commands may be used UnlockBuffer BackBuffer() Color 255,255,255 Rect 255,191,130,98,0 Text 0,0,"Esc: exit" Text 0,20,"UnlockBuffer frees the buffer so Rect, Text and Flip work again" Flip Wend End