From 987513d309a620bce50c6f324ca6d343f8380ae8 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 2 Sep 2016 17:00:44 +0100 Subject: [PATCH] Added --simple command line option and accompanying code to create a very simple text object for basic testing of osgText --- examples/osgtext/osgtext.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/examples/osgtext/osgtext.cpp b/examples/osgtext/osgtext.cpp index f29cf7894..778598f4f 100644 --- a/examples/osgtext/osgtext.cpp +++ b/examples/osgtext/osgtext.cpp @@ -693,9 +693,19 @@ int main(int argc, char** argv) Threads operationThreads; osg::ref_ptr updateOperation; - unsigned int numThreads = 0; - if (arguments.read("--mt", numThreads) || arguments.read("--mt")) + + if (arguments.read("--simple")) + { + osg::ref_ptr text = new osgText::Text; + text->setFont("fonts/times.ttf"); + text->setAxisAlignment(osgText::Text::XZ_PLANE); + text->setDrawMode(osgText::Text::TEXT|osgText::Text::ALIGNMENT|osgText::Text::BOUNDINGBOX|osgText::Text::FILLEDBOUNDINGBOX); + text->setText("This is a simple test"); + + viewer.setSceneData(text.get()); + } + else if (arguments.read("--mt", numThreads) || arguments.read("--mt")) { // construct a multi-threaded text updating test. if (numThreads==0) numThreads = 1;