You should do the sequence as this (pseudo code):

g3d->BeginDraw (3D);
view->Draw();
g3d->BeginDraw (2D);
hud->Draw();
g3d->FinishDraw();
g3d->Print(0);

Your code below is violating this order in several ways.

Greetings,

On 2/18/07, Thomas Teufel <[EMAIL PROTECTED]> wrote:
> Hello,
> I tried some different ways now, but everytime I cut out g2d->Print(0)
> the HUD isn't displayed anymore.
>
> Here you have some more according code:
>
> void TheHill::ProcessFrame() {
> if (!this->g3d->BeginDraw(this->csp_engine->GetBeginDrawFlags() |
> CSDRAW_3DGRAPHICS))
> return;
> if (!this->g3d->BeginDraw(CSDRAW_2DGRAPHICS))
> return;
>
> // processing and writing text onto the hud
>
> this->g2d->FinishDraw();
> this->g2d->Print(0);
>
> this->view->Draw();
> }
>
> void TheHill::FinishFrame() {
> this->csp_g3d->FinishDraw();
> this->csp_g3d->Print(0);
> }
>
> this->g2d->FinishDraw() and this->g2d->Print(0) do not work if they are
> called after this->view->Draw().
> The same if I call those functions within FinishFrame().
>
> Greetings,
> Thomas
>
>
> Jörg Fischer wrote:
> > 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]
> >
> >
>
>
> -------------------------------------------------------------------------
> 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]
>


-- 
Project Manager of Crystal Space (http://www.crystalspace3d.org)
and CEL (http://cel.crystalspace3d.org)
Support Crystal Space. Donate at
https://sourceforge.net/donate/index.php?group_id=649

-------------------------------------------------------------------------
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