flicker with my embedded IE

Blitz3D Forums/Blitz3D Beginners Area/flicker with my embedded IE

tyoud(Posted 2011) [#1]
I think .. that maybe I just have to SetBuffer to the BackBuffer ... then it won't flicker.
I'm not near my development computer but maybe later I can try that.

----


The embedded Internet Explorer thing I'm working on is starting to work, but I noticed it's fine in Windowed mode, but flickers in Full screen mode.

Looking over the forums I found this comment:

http://www.blitzbasic.com/Community/posts.php?topic=25122

"with Blitz Basic and Blitz3D it can depend on whether you're in fullscreen or windowed mode.

Fullscreen = 2 buffers that are flipped.

Windowed = 1 buffer, where the back is copied to the front during a flip."

So that means ...

In full screen mode, I am ping-ponging back and forth writing to front buffer, then back buffer, then front, then back, flipping

and in windowed mode, I am always drawing to back buffer, then copying to front for the flip?

...But I never noticed this in my code, because the Flip command is smart and did the right thing depending on the mode I was using...

----
So from there,

1) First, that I should definitely *test* my game, so that I look out for problems in full screen vs windowed mode (eg not assume that if it works in one mode, that it works in the other)

2) but that also, if I go full screen, that I need to somehow save or preserve the look of the region on screen which has my web browser embedded ...

Yikes, where should I look, command wise to figure out what to do?
Are there some example snippets that do this? I don't remember seeing something.

Last edited 2011


Yasha(Posted 2011) [#2]
Flip copies the contents of the back buffer to the front buffer, so you should always draw to the back buffer and then Flip to copy for display (drawing to the front buffer is safe enough, but not timed in any way).

The thing you can't do is rely on anything to be copied from the front buffer to the back buffer in the same operation: assume that the back buffer is invalid, not necessarily empty or whatever was on the front buffer.

if I go full screen, that I need to somehow save or preserve the look of the region on screen which has my web browser embedded


I ...think... I would recommend using a third buffer for your web browser (either a texture or an image depending on what you're doing). Then draw this to the back buffer by the appropriate method each frame.


xlsior(Posted 2011) [#3]
What YAsha said.

Anyway, depending on the videocard, you may have one backbuffer in full screen mode, or two, or three, or even four or more.
My old videocard used four, so essentially it kept rewinding three frames if you assumed that the background didn't change.

The -only- universal fix is to make sure to redraw everything each and every frame, and never make assumptions on what the backbuffer may contain from previous draws.


tyoud(Posted 2011) [#4]
Thanks for the ideas -
my quick test to see if
SetBuffer BackBuffer()


would fix the flicker, didn't, so

I will definitely try copying to another buffer...

Copy to a Texture buffer if I'm trying to wrap the browser onto a Mesh,

or Copy to an image buffer if I'm trying to make a 2d element for people to click on?