Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Swap screen buffer?

Author
Message
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 18th Mar 2013 19:17
Hi all,

whenever I create a sprite or text in AppGameKit, it is displayed immediately when I sync, unless I set it to be invisible. In DBPro, I used to be able to create a screenbuffer (or bitmap) and swap the screen for drawing. In code, it would look like this:



Is such a thing possible in AppGameKit? (Maybe using the Update(n) and Swap() commands?)
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Mar 2013 20:00
The Sync() command performs three steps: Update(), Render() and Swap()

The Update() command updates the object movements and handles the changes from physics operations.

The Render() command does the actual drawing of everything and does NOT swap the backbuffer, where all the active drawing is done, with the screen.

The Swap() command swaps the backbuffer and the screen, making stuff visible.

So, you can do all sorts of things and render them, then copy it (there are screen grab commands) and then wipe it and put something else in place without any of that being visible. As long as it is done without calling Swap() or Sync().

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Zwarteziel
13
Years of Service
User Offline
Joined: 22nd Jan 2011
Location: Netherlands
Posted: 19th Mar 2013 07:52
Thank you kindly, Ancient Lady! Your explanation makes it very clear how to use the commands.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Mar 2013 15:05
Basically, I read the help pages after remembered what others have posted.

Happy Programming!

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-11-24 09:53:29
Your offset time is: 2024-11-24 09:53:29