Re: [osg-users] How integrate openGL code inside OSG

2014-04-17 Thread Robert Osfield
Hi JacaYang,

You don't say what the problem you are seeing is. In general you are
going the direction that should work, but there is too little
information about how you assinging your callback or what the problems
you are seeing are.

In general I'd say that integrating OpenGL code can be a bit awkward
because both OSG OpenGL code and 3rd party OpenGL code change OpenGL
state so they can influence each other.

Robert.

On 28 February 2014 11:35, JacaYang jacay...@sina.com wrote:
 Hi,

I want to integrate openGL code inside OSG except for using osg::Drawable 
 callback method.I have tried to use get GraphiContex and then call openGL 
 code.but it not work at all.below is my code .
 glPushAttrib(GL_ALL_ATTRIB_BITS);
   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
   glMatrixMode(GL_TEXTURE);
   glPushMatrix();
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();

   //drawing in your own openGL code

   glMatrixMode(GL_PROJECTION);
   glPopMatrix();
   glMatrixMode(GL_TEXTURE);
   glPopMatrix();
   glMatrixMode(GL_MODELVIEW);
   glPopMatrix();
   glPopAttrib();


 Thank you!

 Cheers,
 JacaYang

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





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


[osg-users] How integrate openGL code inside OSG

2014-03-04 Thread JacaYang
Hi,

   I want to integrate openGL code inside OSG except for using osg::Drawable 
callback method.I have tried to use get GraphiContex and then call openGL 
code.but it not work at all.below is my code .
glPushAttrib(GL_ALL_ATTRIB_BITS);
  glMatrixMode(GL_PROJECTION);
  glPushMatrix();
  glMatrixMode(GL_TEXTURE);
  glPushMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPushMatrix();

  //drawing in your own openGL code
 
  glMatrixMode(GL_PROJECTION);
  glPopMatrix();
  glMatrixMode(GL_TEXTURE);
  glPopMatrix();
  glMatrixMode(GL_MODELVIEW);
  glPopMatrix();
  glPopAttrib();


Thank you!

Cheers,
JacaYang

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





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