Hello Keyan,
On 08/14/2012 03:00 PM, Keyan wrote:
> I tried google and surfing the source-code, but I can't get a hello world
> printed, when using the SimpleTextForeground. Here is my code:
>
> _pwin = OSG::PassiveWindow::create();
> _osd = SimpleTextForeground::createEmpty();
createEmpty() is for when you want to create an object that is not
cloned from the prototype for that type - it's only for special
purposes, mostly creation of the prototype instance itself, and should
only be used when really needed.
> _osd->setSize(25.0);
> _osd->setColor(Color4f(0.5, 0.5, 0.5, 0.5));
> _osd->setFamily("Helvetica");
> _osd->setHorizontalAlign(2);
> _osd->setVerticalAlign(0);
>
> _osd->addLine("hello world");
> _pwin->getPort(0)->editMFForegrounds()->push_back(_fileGrabber);
you are adding _fileGrabber not _osd to the window. Typo?
> The source compiles and runs, but there is no text visible. I also tried it
> with the SimpleSceneManager, using the provided addForeground function, which
> also didn't work.
Just to be sure, you are not creating an OpenGL 3+ core only context -
or have set OSG_OGL_COREONLY or OSG_CHECK_COREONLY compile time options?
Does text rendering with e.g. testTextTXFTexture work? Does it list the
font you are using for the foreground?
Cheers,
Carsten
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users