From a54dc347520ef85e62dcda2fa17636cedd22336f Mon Sep 17 00:00:00 2001 From: Mathieu MARACHE Date: Fri, 5 Aug 2016 07:49:22 +0200 Subject: [PATCH 1/2] Added CoreProfile selection if OSG_GL3_AVAILABLE defined --- src/osgViewer/GraphicsWindowCocoa.mm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/osgViewer/GraphicsWindowCocoa.mm b/src/osgViewer/GraphicsWindowCocoa.mm index 72220d16b..c2ab32b80 100644 --- a/src/osgViewer/GraphicsWindowCocoa.mm +++ b/src/osgViewer/GraphicsWindowCocoa.mm @@ -1202,6 +1202,11 @@ bool GraphicsWindowCocoa::realizeImplementation() attr[i++] = static_cast(_traits->samples); } +#ifdef OSG_GL3_AVAILABLE + attr[i++] = NSOpenGLPFAOpenGLProfile; + attr[i++] = NSOpenGLProfileVersion3_2Core; + OSG_DEBUG << "GraphicsWindowCocoa::realizeImplementation :: set up for GL3 Core Profile"<< std::endl; +#endif attr[i++] = NSOpenGLPFAAccelerated; attr[i] = static_cast(0); From c77a7ecae920dcfc0c1da1154c626c492ab44f7f Mon Sep 17 00:00:00 2001 From: Mathieu MARACHE Date: Fri, 5 Aug 2016 07:51:33 +0200 Subject: [PATCH 2/2] Added usage of osgUtil::Optimizer to tessellate input geometry --- examples/osgsimplegl3/osgsimplegl3.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/osgsimplegl3/osgsimplegl3.cpp b/examples/osgsimplegl3/osgsimplegl3.cpp index c1385d5d9..6a35b1fb6 100644 --- a/examples/osgsimplegl3/osgsimplegl3.cpp +++ b/examples/osgsimplegl3/osgsimplegl3.cpp @@ -16,7 +16,7 @@ #include #include #include - +#include void configureShaders( osg::StateSet* stateSet ) { @@ -73,6 +73,10 @@ int main( int argc, char** argv ) osg::notify( osg::FATAL ) << "Unable to load model from command line." << std::endl; return( 1 ); } + + osgUtil::Optimizer optimizer; + optimizer.optimize(root.get(), osgUtil::Optimizer::ALL_OPTIMIZATIONS | osgUtil::Optimizer::TESSELLATE_GEOMETRY); + configureShaders( root->getOrCreateStateSet() ); const int width( 800 ), height( 450 );