Hi Stefano,
can you try to replace this:
beginEditCP(colorIMG);
colorIMG->setWidth(width);
colorIMG->setHeight(height);
endEditCP(colorIMG);
with:
colorIMG->set(Image::OSG_RGBA_PF, width, height);
Andreas
> is there anyone that can help me solving this problem? :)
> thanks again,
> stefano
>
> 2007/6/26, Stefano <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>>:
>
> Hi there!
> as title says.. i'm trying to change the size of a fboviewport after
> it's been created.. i couldn't find a solution to this.. here's the
> code:
>
> // create FBO
> colorIMG = Image::create();
> beginEditCP(colorIMG);
> colorIMG->set(Image::OSG_RGBA_PF, width, height);
> endEditCP(colorIMG);
> colorTX = TextureChunk::create();
> beginEditCP(colorTX);
> colorTX->setEnvMode(GL_MODULATE);
> colorTX->setMinFilter(GL_LINEAR);
> colorTX->setMagFilter(GL_LINEAR);
> colorTX->setTarget(GL_TEXTURE_2D);
> colorTX->setInternalFormat(GL_RGBA8);
> colorTX->setImage(colorIMG);
> endEditCP(colorTX);
>
> fboViewport = FBOViewport::create();
> beginEditCP(fboViewport);
> fboViewport->setSize(0, 0, width-1, height-1);
> fboViewport->setStorageWidth(width);
> fboViewport->setStorageHeight(height);
> fboViewport->setBackground(PassiveBackground::create());
> fboViewport->setCamera(PerspectiveCamera::create());
> fboViewport->setParent(parent);
> fboViewport->setRoot(makePlane(1,1,1,1));
> fboViewport->getTextures().push_back(colorTX);
> endEditCP(fboViewport);
>
> and now i want to change size:
>
> beginEditCP(colorIMG);
> colorIMG->setWidth(width);
> colorIMG->setHeight(height);
> endEditCP(colorIMG);
> // let the texture know about it..
> beginEditCP(colorTX);
> endEditCP(colorTX);
>
> beginEditCP(fboViewport);
> fboViewport->setSize(0, 0, width-1, height-1);
> fboViewport->setStorageWidth(width);
> fboViewport->setStorageHeight(height);
> endEditCP(fboViewport);
>
> this fails and program exits.. if i just try to do this
>
> beginEditCP(fboViewport);
> fboViewport->setSize(0, 0, width-1, height-1);
> fboViewport->setStorageWidth(width);
> fboViewport->setStorageHeight(height);
> endEditCP(fboViewport);
>
> without changing image size and texture, the program doesn't exit
> but all i get is a black screen.. any clues?
> thanks!
>
> Stefano
>
>
>
>
> --
> Stefano Verna
> mail/gtalk: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> skype: steffoz
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Opensg-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users