[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
WhatLinksHere » arrays » Sun » CppStdioH » The GPRMC Sentence » QbasicFAQ_Mouse » scripting » CppCodeSnippets » Bill Gates » Programmer » QbasicFAQ_Double buffer
It is not possible to use double-buffred graphics for all screenmodes. The best resolution to use is SCREEN 9 (640x350).

Here a skeleton program that uses double-buffers and also  ?video synch:

  ' * Buffer indexes: *
  Frontbuffer% = 0
  Backbuffer% = 1
  ' * Main-loop: (until [Escape] is pressed) *
  WHILE INKEY$ <> CHR$(&H1B)
    ' * Swap buffers: *
    SWAP Frontbuffer%, Backbuffer%
    SCREEN 9, , Frontbuffer%, Backbuffer%
    ' * Wait for video synch: *
    DO WHILE (INP(&H3DA) AND 8) = 0
    LOOP
    DO WHILE (INP(&H3DA) AND 8)
    LOOP
    ' * Clear old screen-buffer: *
    LINE (0, 0)-(639, 349), 0, BF
    ' ********************************************
    ' Do your realtime graphic animations here =)
    ' ********************************************
  WEND ' * End of mainloop *


last edited (May 27, 2005) by Solkoll, Number of views: 3301, Current Rev: 2 (Diff)

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Site Management by Lars Hagelin at Kontantkort.se.