Hello Thomas,
Thomas Jam Pedersen wrote:
> Dear Carsten and co.
>
> I have been tracking down the problem further.
>
> It turns out that OpenSG samples run OK on the Win2003 server.
> Thus my problem is probably not directly related to OpenGL.
>
> By debugging I found that on my development PC.
> if (!getFboOn() || !extensionCheck())
>
> both returns true, thus the else brance is executed.
> But on my win2003 server extensionCheck() returns false and thus the if
> branch is executed.
just as an FYI, please note that this means that you only get "emulated
FBOs", i.e. rendering actually goes to the regular framebuffer and is
read back with glReadPixels.
> In the if branch the following two lines both return 0
> Int32 winWidth = getParent()->getWidth ();
>
> Int32 winHeight = getParent()->getHeight();
>
> Thus the following two for loops become an infinite loop.
> -------------------------------
>
> for (y1=0; y1 < totalHeight; y1 += winHeight)
>
> {
>
> y2 = osgMin((float)(y1+winHeight-1), (float)(totalHeight-1));
>
> th = y2 - y1 + 1;
>
> for (x1=0; x1 < totalWidth; x1 += winWidth)
>
> {
>
> x2 = osgMin((float)(x1+winWidth-1), (float)(totalWidth-1));
>
> tw = x2 - x1 + 1;
>
> -------------------
>
> My question is:
> Even though I try to render the thumbnail image in the background I have
> setup the window of the SimpleScreenManager to a GLUTWindow, which is set to
> size 640x480.
> But still the getParent()->getWidth (); return 0.
if you are using glut, do you have a reshape callback registered or
equivalent if you use a different windowing toolkit ?
e.g. something like the following should do:
void reshape( int w, int h )
{
std::cerr << "Reshape: " << w << "," << h << std::endl;
win->resize( w, h );
}
> Where should I set this Parent window to avoid that the getWidth() returns 0?
the parent should get set automatically when you add the viewport to the
window.
> -------------------
> Suggestion for code improvement:
> To avoid that someone else has to do a lot of work to track down a similar
> problem.
> I suggest that you add some appropriate error handling, e.g. throw an
> exception.
> .... or at minimum add this code arround the two for loops in
> OSGFBOViewport.cpp, function
>
> FBOViewport::render(RenderActionBase* action)
>
> if(winWidth > 0 && winHeight > 0) {
> // place the two forloops here
> }else{
> FWARNING(("FBOViewport::render() failed bacause window width = 0 or
> height = 0"));
> }
hm, would probably be better, although a window of size of zero is a
rather esoteric case ;)
regards,
Carsten
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users