Hi Oliver,

These are pure Producer question, so based asked on the Producer-users
mailing list.

Robert.

On 5/31/07, Oliver Kutter <[EMAIL PROTECTED]> wrote:

 Hi,

 I have two questions concerning closing a window which uses the
Producer::RenderSurface.

 1. I wrote a class which has a camera, a rendersurface and a render
context. Its task is to display images which will be drawn to the render
context by using glDrawPixels.
 I set it up like this:

 osg::ref_ptr<Producer::Camera> _camera = new Producer::Camera();
 osg::ref_ptr<Producer::RenderSurface> _renderSurface = new
Producer::RenderSurface();
 osg::ref_ptr<ImagePreviewContext> _imagePreviewContext =
new ImagePreviewContext();
 // _imagePreviewContext inherits the Producer::Camera::SceneHandler and
overwrites the draw() method, where glDrawPixels is called.

 // setup the draw camera
 _camera->setRenderSurface(_renderSurface.get());
 _camera->setSceneHandler(_imagePreviewContext.get());

 // set default size (256 x 256)
 _renderSurface->setWindowRectangle(0, 0, 256, 256);

 Now my question: How can I close the window without using the close button
of the window. I want to destroy my object dynamically by method calls with
all variables and I want it to be closed automatically. My destructor looks
like this:

 _camera.release();
 _renderSurface.release();
 _imagePreviewContext.release();

 But the window is still there. It is not updated anymore, but the window
with the borders is still there.

 The last point leads to my 2nd question.

 2. What is the best way to delete ref_ptr objects?

 _camera.release()
 or
 _camera.unref()
 or another way, which I don't know yet?

 regards,
 Oliver

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to