Hi Sajjadul,

On 13 July 2013 07:05, Sajjadul Islam <[email protected]> wrote:

> Hi forum,
>
> I believe that there are 3 ways to integrate opengl commands into the OSG.
>
> 1. Derive and customize a osg::Drawable class.
> 2. Define the pre-draw and post-draw callbacks that are defined in the
> osg::Camera class.
> 3. Make use of the rendering context directly. Now is it fine to issue
> OpenGL command once the rendering context is made current ?
>
> At the very beginning of the initialization i make sure that i am dealing
> with single threaded application.


What route is best will depend upon what problem you are trying to solve,
all of the above can be appropriate in different contexts, what might be
best for you I can't say as I dohn't know the wide problem you are
attempting to tackle.

W.r.t 3. If you are running single threaded and have made the OpenGL
context current then it will be safe to issue OpenGL commands, one still
has to take care of how you manage OpenGL state as you'll either need to
restore the state that the OSG was last in, or tell the OSG that this state
has changed so it knows to reset it when it next does rendering.  The
osg::State class has a range of State:haveApplied*() methods to allow you
to tell it that you've modified various modes and state attributes.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to