Frederic,
 I think you can't limit the OpenGL drawing to a limited region of a window 
HANDLE. You could embed a window in the region you want to use OGL, and just 
draw to it. Or you could first draw the OGL/OSG code, and then get the window 
handle and draw all your other stuff using GDI or whatever.

Guy. 

---------


hum, the (black) color was not the problem in itself :)

If I do this (update from my whole code):
        gc->setClearColor( osg::Vec4f(1.2f, 0.2f, 0.6f, 1.0f) );
        gc->setClearMask( 0) ;

        camera->setClearColor( osg::Vec4f(0.2f, 0.2f, 1.6f, 1.0f) );
        camera->setClearMask( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
(that's to say: don't clear anything on gc, and fill background with
blue on camera),

I have the camera successfully drawn at the right place, with blue
background. This is what I want for that camera.
BUT, the problem persists, i.e. all around the viewport, the whole
window is painted in black. (maybe mick jagger is singing too loud ?).
it is painted in pink if I enable the gc->setClearMask(GL_COLOR_BUFFER_BIT).

I can't manage to make OSG only impact the camera viewport (my blue
rectangle) and leave the window around unchanged...
Did anyone achieve to display an osgViewer::Viewer at some small place
in a window without overwrite window content around?

Fred



2009/3/25 Robert Osfield <[email protected]>:
> On Wed, Mar 25, 2009 at 3:03 PM, Frederic Marmond <[email protected]>
> wrote:
>>
>> hum, it didn't work :(
>>
>> both
>> //      gc->setClearColor( osg::Vec4f(1.2f, 0.2f, 0.6f, 1.0f) );
>> //      gc->setClearMask( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
>> and
>>        gc->setClearColor( osg::Vec4f(1.2f, 0.2f, 0.6f, 1.0f) );
>>        gc->setClearMask( 0 );
>>
>> do the same: instead of the shiny pink color, the window is filled with
>> black
>>
>> any other suggestion ?
>
> Well you disable the clear colour in the camera's ClearMask so perhaps this
> is why it's just black.
>
> Robert.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to