English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. AMOS

 
 
Thread Tools
Old 03 November 2017, 17:37   #1
ricky500
Registered User
ricky500's Avatar
 
Join Date: Nov 2008
Location: New Hampshire, USA
Age: 32
Posts: 129
AMOS - Double Buffering

I'm working on my first AMOS program -so sorry if I sound like a newbie!

I have some BOBs that I need animated without flicker so I am using the DOUBLE BUFFER command to turn on double buffering.

Once I turn on double buffering, I found that CLS does not clear the screen. I played around with the AUTOBACK command, but wasn't able to find a solution. I found a work around - I call a CLS then SWITCH SCREEN and then another CLS - SWITCH SCREEN and CLS again. (With some WAITs in-between) Is this the best method?

Also is there a way to turn off double buffering once you turned it on?
ricky500 is offline  
AdSense AdSense  
Old 03 November 2017, 19:03   #2
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 259
1) CLS 0
Strangely enough I never encountered this problem until I tested today, but I suppose it's good practice to specify the colour to CLS to, just incase the PAPER colour has been changed during your program run.

and

2) BOB UPDATE OFF/ON
Should start/stop the DB process for you.

Last edited by volvo_0ne; 03 November 2017 at 22:02.
volvo_0ne is offline  
Old 04 November 2017, 02:07   #3
ricky500
Registered User
ricky500's Avatar
 
Join Date: Nov 2008
Location: New Hampshire, USA
Age: 32
Posts: 129
Quote:
Originally Posted by volvo_0ne View Post
1) CLS 0
Strangely enough I never encountered this problem until I tested today, but I suppose it's good practice to specify the colour to CLS to, just incase the PAPER colour has been changed during your program run.
I tried CLS with the 0 and it worked! Must be a weird glitch, since according to the manual, CLS by itself is supposed to fill with colour 0 by default.

Quote:
2) BOB UPDATE OFF/ON
Should start/stop the DB process for you.
Yes, that worked! Thanks!!
ricky500 is offline  
Old 04 November 2017, 22:03   #4
volvo_0ne
Registered User

 
Join Date: Mar 2015
Location: Sheffield UK
Posts: 259
Quote:
Originally Posted by ricky500 View Post
I tried CLS with the 0 and it worked! Must be a weird glitch, since according to the manual, CLS by itself is supposed to fill with colour 0 by default.



Yes, that worked! Thanks!!
Don't forget that the "0" could be any colour of your palette (sometimes handy for effects)
volvo_0ne is offline  
Old 01 January 2018, 12:28   #5
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 360
Quote:
Also is there a way to turn off double buffering once you turned it on?
I guess Double buffer turns off when you close and open the screen again.
Dan is offline  
Old 01 January 2018, 12:43   #6
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,182
Doesn't the Autoback command control that?
idrougge is offline  
Old 01 January 2018, 14:48   #7
Dan
Registered User
Dan's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 360
No.

As far as i know, amos pro does not automatically make a double buffered screen.
As this would take up more memory and slow everything down.

You need to use "Double Buffer" command, to create an invisible buffer copy of the screen.

But to turn off this system, then the screen has to be closed and to be reopened.

Quote:
Originally Posted by http://www.ultimateamiga.co.uk/HostedProjects/AMOSFactory/AMOSProManual/index.html

DOUBLE BUFFER
instruction: activate Double Buffering system
Double Buffer

Throughout this Chapter, extensive reference is made to the technique known as "double buffering". The DOUBLE BUFFER command creates an invisible copy of the current screen and stores it as a "logical screen". All graphics operations, including Bob movements, are now performed directly on this logical screen, without disturbing your existing display at all. This is because the existing display on your television screen is taken straight from the original screen area, now called the "physical screen".

Once the image has been re-drawn, the logical screen and physical screen are swapped over. The old logical screen is flicked onto the display, and the old physical screen is hidden away to become the new logical screen. The entire process now cycles continuously, producing a solid, smooth display, even when dozens of Bobs are moving on the same screen.
Autoback modes then sets how the things are drawn on physical screen and on the buffered copy:

Quote:
There are three AUTOBACK modes, and you can toggle between them by setting the mode values as follows:

X> Autoback 0
Manual mode. This mode deactivates the AUTOBACK system completely, so that graphics are drawn directly on the logical screen, for maximum speed. It is recommended for use with the BOB DRAW and BOB CLEAR commands.

AUTOBACK 0 is useful when large amounts of graphics are drawn on screens being switched manually with SCREEN SWAP, because it is much faster than the standard system. But remember that you must take responsibility for synchronising between the logical and physical screens.

X> Autoback 1
Semi-automatic. In mode 1, AUTOBACK performs all graphical operations on both the logical and physical screens. Although Bob updates are not taken into account, this is an ideal mode for displaying hi-score tables and control panels. So as long as your Bobs are kept clear of any new graphics, this mode is perfect.

X> Autoback 2
here are few links to the amos pro manual which explains this a bit better:

AutoBack

Double Buffering

Blitter Objects

and the last one, but important for bobs on Single buffered screen:

Updating objects


It sounds a bit complicated, but only practice and the examples can show you how it is done.

Last edited by Dan; 01 January 2018 at 14:53.
Dan is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Double Buffering MartinW Coders. C/C++ 8 11 October 2017 01:20
Latency tests - No difference between "No buffering" and "Double buffering" Dr.Venom support.WinUAE 6 24 September 2017 11:18
how to display bob correctly with double buffering Blackgoat Coders. AMOS 2 15 March 2016 23:10
flawless double buffering dalton Coders. General 2 17 May 2011 08:09
AGA double buffering using ChangeScreenBuffer() NovaCoder Coders. General 1 03 November 2010 01:34

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 11:14.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Page generated in 0.22503 seconds with 14 queries