From 3c6f56936074fe5a43ea86f4715b1e6eef372db9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 19 Oct 2017 11:06:23 +0100 Subject: [PATCH] Fixed placement of { and spacing to make the code more readable and consistent with the rest of the OSG --- examples/osgsimpleMDI/osgsimpleMDI.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/examples/osgsimpleMDI/osgsimpleMDI.cpp b/examples/osgsimpleMDI/osgsimpleMDI.cpp index be7bd2c31..bd94c4785 100644 --- a/examples/osgsimpleMDI/osgsimpleMDI.cpp +++ b/examples/osgsimpleMDI/osgsimpleMDI.cpp @@ -86,6 +86,7 @@ int main( int argc, char**argv ) osg::ref_ptr geom=new osg::Geometry(); geom->setUseVertexBufferObjects(true); + osg::BoundingBox bb; bb.set(0,0,0,MAXX,0,MAXY); //set bounds by hand cause of the lack of support of basevertex in PrimitiveFunctors @@ -104,10 +105,10 @@ int main( int argc, char**argv ) osg::Vec3Array * verts=new osg::Vec3Array(); - - for(int j =0 ; jsize(); mdicommands->push_back(cmd); - for(int z=0; z<4; z++) { + for(int z=0; z<4; z++) + { verts->push_back(osg::Vec3(i,0,j)+myCoords[z]); mdi->addElement(myIndices[z]); } } } + geom->setVertexArray(verts); - if(MDIenable) { + + if(MDIenable) + { geom->addPrimitiveSet(mdi); } else - for(int i=0; isetElementBufferObject(ebo); geom->addPrimitiveSet(dre); for(int z=0; z<4; z++)myIndicesUI[z]+=4; } + } + root->addChild(geom); + osgViewer::Viewer viewer; viewer.addEventHandler(new osgViewer::StatsHandler); viewer.setSceneData( root );