Let me further describe my situation. I think I may not have as many issues as first thought.

First, I mispoke.  The existing OpenGL application is actually a library.

The ONLY reason I am investigating the possibility of putting OSG code into this existing library, is that there is a history, or traceability, of the library, based on several years of government spending. If I can simply add another interface function to add the ability to render scene type C, then the current user base should, in theory, be able to drop the new lib into their apps, and call my function and voila.... Scene Type C.

Granted I could just brute force straight opengl into the new render code, but I think OSG will do the job better and faster.

At the point where I take control of the opengl state with my new OpenGL render function, I don't know that state control will be returned to the original lib code. In other words, the lib code establishes the X-Window, Render Context, Set OpenGL State, etc. Then I render my OSG scene then quit. In this case, can I simply wrap the OSG code, as Paul mentioned, with gl(Push/Pop)Attrib? Does this additional information change any indications that it is possible, but maybe more straight forward?

Ed


Robert Osfield wrote:
HI Ed,

Others users have embedded the OSG into existing OpenGL applications
so it is possible.  It it isn't all straight forward, mainly due to
the issues of managing OpenGL state.

I'm hoping Paul Martz will volunteer his experiences, as he did just
this at his previous job ;-)

Robert.

On 11/9/06, Ed <[EMAIL PROTECTED]> wrote:
How difficult is it to integrate OSG code into an existing OpenGL
application?

Let's say I have an application which renders 2 different types of
scene.  The app reads in object data, material information etc. etc.
then enters a framing loop and calls the main Render function.
Something like this:

InitializeXWindowGLContextEtc()
InitializeObjects()
InitializeRest()
while (still need to render)
    RenderSceneA()

Or  maybe the app calls RenderSceneB()

while (still need to render)
    RenderSceneB()

I want to add my own Render function which uses OSG

while (still need to render)
    RenderSceneC_OSG()

Is this possible?  Difficult?  Are there examples?

Ed


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to