Re: [osg-users] OpenGL error 'invalid enumerant' after RenderBin::draw(, )

2010-12-20 Thread Evan Sheffield

Skylark wrote:
 Hello Evan,
 
 We will not be able to help much if you don't show your code, because 
 what you describe is very simple and should work (at least as far as we 
 can see from your description). If we see the code we might be able to 
 tell you what's wrong.
 
 Also, have you looked at the OSG examples and the Getting Started Guide 
 to make sure you're doing things right?
 
 J-S
 -- 
  --
 Post generated by Mail2Forum


Hello,

Yes, I followed the startup guide to get OSG working on my computer. This is 
the simple code that I was trying:



Code:
#include osg/Group
#include osg/LightSource
#include osg/ShapeDrawable

#include osgViewer/Viewer

using namespace osg;

// main function
int main()
{
  // create the root node of the scene graph
  ref_ptrGroup root = new Group;

  // create a node to the geometry of a spherical object
  ref_ptrGeode ballNode = new Geode;
  ballNode-addDrawable(new ShapeDrawable(new Sphere));

  // create a distant light, with 0 for the homogeneous coord
  Vec4 lightDirection(1, -1, 1, 0);
  ref_ptrLightSource ls = new LightSource;
  ls-getLight()-setPosition(lightDirection);
  // set the intensity properties for the light
  ls-getLight()-setAmbient(Vec4(0.2, 0.2, 0.2, 1.0));
  ls-getLight()-setDiffuse(Vec4(1.0, 1.0, 0.7, 1.0));
  ls-getLight()-setSpecular(Vec4(1.0, 0, 0, 1.0)); 

  // assemble the node hierarchy
  root-addChild(ls.get());
  root-addChild(ballNode.get());

  // create the viewer helper object
  osgViewer::Viewer viewer;
  viewer.setSceneData(root.get());
  viewer.realize();

while( !viewer.done() )
{
viewer.frame();
}

return 0;
}



Thanks in advance for your help.

~Evan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=35003#35003





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] OpenGL error 'invalid enumerant' after RenderBin::draw(, )

2010-12-19 Thread Evan Sheffield
Hi,

I've had some problems getting my OSG applications to render properly. I'm 
using Microsoft Visual C++ 2010 Express.

I've written a very simple application which should simply display a sphere. 
The code compiles, but when the viewer runs, the sphere doesn't appear and I 
get the message:
Warning: detected OpenGL error 'invalid enumerant' after RenderBin::draw(,)

I have no idea what this means or how to fix it. I was able to compile and run 
successfully on a Linux system, but I've had no luck with Windows and Visual 
C++. Can anybody help me out?

... 

Thank you!

Cheers,
Evan

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=34950#34950





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org