this "hack" forces the nVidia card to be preferred on mobile Windows systems equipped with an Intel/nVidia combo on the mainboard - also known as nVidia Optimus (TM). Putting an #if WIN32 around it might work.
Christian 2014-11-25 15:54 GMT+01:00 Robert Osfield <[email protected]>: > Hi Chris, > > I have just done a quick test of your changes and get a compiler error: > > /home/robert/OpenSceneGraph/examples/osgtessellationshaders/osgtessellationshaders.cpp:7:23: > error: expected constructor, destructor, or type conversion before ‘(’ token > extern "C" { _declspec(dllexport) extern const int NvOptimusEnablement = > 1; } > > This looks like a platforms specific hack to me, and something that > doesn't belong in cross platform example. I'm building under Kubuntu > 14.10. Removing this line fixes the problem. > > As a general comment, I think the original code path and the approach you > have taken and both useful examples so just replacing the old version with > your own changes isn't appropriate. A better approach would be to wrap > each code path up in a create scene graph function have the main create > both subgraphs or create which one depending upon the parameters passed to > the example. > > Robert. > > > On 22 November 2014 at 13:17, Chris Kuliukas <[email protected]> wrote: > >> Hi, >> >> Attached is an osgtesselationshaders.cpp but designed for quads, which I >> think a lot of people would appreciate since often when doing terrain or >> ocean (certainly when coming from legacy code) you'll most likely be using >> quads rather than triangles. >> >> I found some of the material online (especially the material the >> osgtesselationshaders.cpp was based on) was very unhelpful when it came to >> quads. So this is practically the same code, but modified to use quads >> instead of triangles, so that people have a good starting point for quad >> tesselation for a terrain / ocean setting. >> >> It is a drop-in replacement for >> examples/osgtesselationshaders/osgtesselationshaders.cpp in openscenegraph >> 3.2.1 . It will draw an 8x8 quad grid in a single geometry, of the type >> that a heightmap could be easily applied to. >> >> I add no license further to what was already there, in case that needed >> to be said. >> >> Regards, >> Chris >> >> ------------------ >> Read this topic online here: >> http://forum.openscenegraph.org/viewtopic.php?p=61799#61799 >> >> >> >> >> Attachments: >> http://forum.openscenegraph.org//files/osgtessellationquadshaders_154.cpp >> >> >> _______________________________________________ >> osg-submissions mailing list >> [email protected] >> >> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org >> > > > _______________________________________________ > osg-submissions mailing list > [email protected] > > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org > >
_______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
