I`m trying to draw multiple viewports on screen. The problem is I don`t want to update the viewports in each beginScene() cycle. I.e each viewport gets updated once uponatime. However on each beginScene all the viewports get cleared so it all white until the viewport is drawn again
If draw a viewport per frame, with 4 vp I end up with the each viewport being white 3/4 of the time.
[update] I got it to work with setting the beginScene clear Backbuffer to false however I still get the gui flikering. Unlike the viewports I want the gui updated on a per frame basis.
viewport flikering
put your gui to another separate viewport?
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
DavidJE13 your right that's pseudo code for how things used to be but I changed things in the mean time .
DrawViewport(int Frame)
{
if(Frame == 0)
{
setVP(1);
sceneManager->DrawEverything
}
if(Frame == 1)
{
setVP(2);
sceneManager->DrawEverything
}
if(Frame == 2)
{
//setVP(3);
sceneManager->DrawEverything
}
}
int Frame
beginScene()
Frame++
if(Frame ==4)
{
Frame =0
}
DrawViewport(Frame)
setVp(5);
guiManager->DrawEverything
endScene();
DrawViewport(int Frame)
{
if(Frame == 0)
{
setVP(1);
sceneManager->DrawEverything
}
if(Frame == 1)
{
setVP(2);
sceneManager->DrawEverything
}
if(Frame == 2)
{
//setVP(3);
sceneManager->DrawEverything
}
}
int Frame
beginScene()
Frame++
if(Frame ==4)
{
Frame =0
}
DrawViewport(Frame)
setVp(5);
guiManager->DrawEverything
endScene();
hmm, again that should work (although you will have a problem with the gui showing ~3 previous frames in each segment)
Either the code you posted isn't entirely representative of your app, or the bug is elsewhere. Possibly in the setup - what driver/OS are you using?
I'm going to do a few tests with this, see if I can reproduce the glitch.
Either the code you posted isn't entirely representative of your app, or the bug is elsewhere. Possibly in the setup - what driver/OS are you using?
I'm going to do a few tests with this, see if I can reproduce the glitch.
No, this will not work because it only draws one viewport between the begin and end scene calls. If you want to avoid flicker, you need to draw all viewports between those calls.Code: Select all
int Frame beginScene() Frame++ if(Frame ==4) { Frame =0 } DrawViewport(Frame) setVp(5); guiManager->DrawEverything endScene();
Travis