Ultimate Amiga
Network Boards => AMOS Programming Environment => AMOS Factory => AMOS BASIC => Topic started by: robertframpton on March 31, 2006, 02:17:16 PM
-
I have written a large program in AMOS. I have designed it so that you do not see the display being drawn. However in between diferent screens whilst navigating whithin the program I cannot design it so that a blank screen is not visible inbetween different screens.
My intention is for the whole program to be displayed seamlessly and only the graphics that make up the the program being showed, with no flickering/ black screens in between.
I have experimented with screenswap, screen copy and the logic and physic commands, but with out any sucess.
The general pattern to my code for each screen is this:-
hide the display,
unpack a picture,
onscreen drawing operations including text output with grwriting,
show the resulting screen.
Any help with this would be much appreciated.
-
Try turning off the automatic double buffering with the autoback command. Then wait until after you unpack the picture onto the logical screen before you swap screens.
I can't guarentee that this technique will work but the autoback is probably the problem you have been having so far.
-
I have tried what you said, but without any luck. This resulted in being able to see the display being drawn.
Please could you tell me:-
What screens need to be opened. And how they are managed.
To which screen I should unpack to. I have tried omitting the screen number, but this messes up the colours.
What code is required prior to my unpacking pictures, graphic and text operations.
The instructions after the drawing operatioins in order for no visible drawing or flickering in between displaying static screens.
How best to replace the current screen with the new one, taking into account that each background has a different pallete, showing no screen in between.
Please could you advise me of the fastest, and best way to do this.
Thanks.
-
It seems that Amos' double-buffer feature doesn't adequately account for different palettes so I guess the only way to do it properly would be with the Screen Hide and Screen Show commands using variables to hold which screen is the back and which is the front. I'll have to do some experimenting and then get back to you.
-
@robertframpton
The typical loop for a double buffered display is:
Double Buffer
Autoback 0
Do
' Clear the screen or update damaged sections here
' Redraw the background here
' Redraw any foreground graphics here
Screen Swap
Wait Vbl
Loop
If you don't actually issue the Double Buffer command first, then no buffers are set up and the screen will flicker. Also, if you're only going to be drawing foreground graphics (like bobs or drawing commands) during your main loop, you will need to draw the background on both the front and the back buffers before you start using them or the screen will also flicker.
-
This might sound obvious but are you (WAIT)ing (V)ertical (B)(L)ank?
You could try offsetting the screen outside of the physical screen area also whilst any drawing is taking place then flick it back