Hello,
I have some minor problems with the passive classes. I would be
interested what other think about it.
First look at the PassiveViewport class. I think this class should
provide the following virtual function implementation:
void PassiveViewport::activateSize(void)
{
GLint pl = getPixelLeft();
GLint pr = getPixelRight();
GLint pb = getPixelBottom();
GLint pt = getPixelTop();
GLint pw = pr - pl + 1;
GLint ph = pt - pb + 1;
glViewport(pl, pb, pw, ph);
}
That is because the Viewport base class does provide the following
generic implementation:
void Viewport::activateSize(void)
{
GLint pl = getPixelLeft();
GLint pr = getPixelRight();
GLint pb = getPixelBottom();
GLint pt = getPixelTop();
GLint pw = pr - pl + 1;
GLint ph = pt - pb + 1;
glViewport(pl, pb, pw, ph);
if(!isFullWindow())
{
glScissor(pl, pb, pw, ph);
glEnable(GL_SCISSOR_TEST);
}
else
{
glDisable(GL_SCISSOR_TEST);
}
}
Now, if you have running OpenGL code outside of the scene graph that
does work with the scissor test, you are lost at this place. On the
other hand, the above code just leaves the fundamental task for the
passive viewport class, i.e. setting of the viewport state.
Secondly, I think that the PassiveWindow class should provide an empty
implementation for the following two functions:
virtual void doActivate()
virtual void doDeactivate()
Why is that? Because on intialization as in the following code
osg::PassiveWindowUnrecPtr window = osg::PassiveWindow::create();
window->init();
the OpenGL context is deactivated by the passive window base class
doDeactivate call. Now, the passive window isn't that passive anymore.
Actually, I have a little problem with this situation in my code, since
I further modify gl state after the init call.
Now, I have two simple solutions for the problems. At first I have my
own EnhPassiveViewport class and secondly I can manually re-establish
the current OpenGL context. But I think that it would be more correct to
modify the core OpenSG code with respect to the passive object
implementations.
Any opinions?
Best,
Johannes
____________
Virus checked by G DATA AntiVirusKit
Version: AVF 19.534 from 15.09.2009
Virus news: www.antiviruslab.com
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users