Hi,
Thomas Teufel schrieb:
> Hello!
> 
> I have a problem with my 2d graphics driver.
> I'm displaying a head up display with g2d which overlays the
> g3d-rendered objects.
> 
> Every thing works but the hud flickers.
> But I am writing text onto the hud every renderloop.
> Is it possible, that the g2d has a lower redraw rate than the g3d?
> 
> Here is some according code I'm using for this:
> // initialises g3d and g2d
> csRef<iGraphics3D> g3d =  csQueryRegistry<iGraphics3D>(GetObjectRegistry());
> csRef<iGraphics2D> g2d = g3d->GetDriver2D();
> 
> g3d->BeginDraw(CSDRAW_2DGRAPHICS);
> 
> // writes text onto the hud
> g2d->Write(font, 30, 30, fg, bg, "Test");
> 
> // finishes 2d drawing
> g2d->FinishDraw();
> g2d->Print(0);
   ^^^^^^
I think this is wrong, you never need to call Fishdraw() or Print() on 
your g2d;
you have to call it on the g3d.

If you call g3d->Print(0) elsewhere, this causes the flickering.
g3d->Print() (and g2d->Print() too) will swap the front- and backbuffer.
This has to be done exactly once in a frame.

-- J.Fischer

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Crystal-main mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-main
Unsubscribe: mailto:[EMAIL PROTECTED]

Reply via email to