fullscreen display surrounding flickering

Discuss OpenGL® programming with the GL Galore plugin here
Post Reply
User avatar
lazi
Posts: 286
Joined: Fri Feb 25, 2011 12:08 am

fullscreen display surrounding flickering

Post by lazi » Tue Jan 09, 2018 12:55 am

OS4.1
Radeon (not hd) driver.
Hollywood 7.0
GL Galore 1.1

Trying it tells more then thousand words, so change SmoothScroll.hws GL Galore example scripts line 45 to this:

@DISPLAY {width=600,mode="fullscreen",Color = #WHITE, Title = "Smooth scroll"}

I have changed it to fullscreen, and made the display smaller than the screen width. Here the displays right side (a 40x480 block) flickering black and white on every display refresh/flip.

Is there a solution for this?

User avatar
airsoftsoftwair
Posts: 2481
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: fullscreen display surrounding flickering

Post by airsoftsoftwair » Wed Jan 10, 2018 12:55 am

Yes, this should be fixable. Thanks for reporting!

User avatar
airsoftsoftwair
Posts: 2481
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: fullscreen display surrounding flickering

Post by airsoftsoftwair » Thu Jan 11, 2018 12:39 am

Ok, so this turned out to be a bug in the script. The problem is this line:

Code: Select all

Cls(#WHITE)
This will just draw a filled white rectangle but this is not a proper GL buffer clearing which should be done whenever flipping buffers. Thus, the following code should be used instead:

Code: Select all

Cls                 ; first clear buffers
Cls(#WHITE)   ; now draw
When Cls() is used with #BLACK (or no argument) it will properly clear the GL buffers which is needed when flipping buffers.

User avatar
lazi
Posts: 286
Joined: Fri Feb 25, 2011 12:08 am

Re: fullscreen display surrounding flickering

Post by lazi » Thu Jan 11, 2018 10:34 pm

Yeah, that fixes the SmoothScroll example, but I just realized that GL Galore works on the full screen even if @display width and height parameters define smaller area.

It can affect speed too. Working on a small display can be much slower on fullscreen than in window if the corresponding fullscreen screen is much larger than @display defines.

Is it some miniGL or GPU limitation that only standard resolutions can be used effectively?

User avatar
lazi
Posts: 286
Joined: Fri Feb 25, 2011 12:08 am

Re: fullscreen display surrounding flickering

Post by lazi » Thu Jan 11, 2018 10:40 pm

Here is a better fix.
Instead of the two cls inside the loop:

Code: Select all

BeginDoubleBuffer(True)
Cls
Flip
Cls       
Clear both buffers after BeginDoubleBuffer.
This will not affect speed.

User avatar
airsoftsoftwair
Posts: 2481
Joined: Fri Feb 12, 2010 3:33 pm
Location: Germany
Contact:

Re: fullscreen display surrounding flickering

Post by airsoftsoftwair » Thu Jan 11, 2018 11:25 pm

lazi wrote:Is it some miniGL or GPU limitation that only standard resolutions can be used effectively?
I honestly don't know. Ask Hans de Ruiter... he should be able to tell :)

Post Reply