Clear a window with a render box

itsalamanca

04-12-2008 09:36:26

hi,
I have made a window with a render box, some buttons and 3 panels.
In the render box i am going to add some entitys in some scenenodes.
the problems cames when i'm try to clear the window. I push the button cancel.
I have implemented this method:


void accionCancelar(MyGUI::WidgetPtr _sender)
{
MyGUI::WindowPtr ventana=rGUI->findWidget<MyGUI::Window>("ventananuevapieza");
ventana->destroySmooth();
}


I obtend a execute mistake, type "no send".
I use the debugger and it shows some problem with the renderbox. It shows me a code of mygui_renderbox.cpp.

void RenderBox::clear()
{
setRotationAngle(Ogre::Degree(0));

//if (mEntity) {
//Ogre::SkeletonManager::getSingleton().remove();
//mNode->detachObject(mEntity);
mScene->destroyAllEntities();
mNode->removeAndDestroyAllChildren();
mVectorEntity.clear();

mEntity = 0;
mEntityState = null;
//}
}


So, i try to clear the renderbox, but the mistake is still here.
the .logs don't give me any help or information about that.
somebody some ideas??

itsalamanca

05-12-2008 09:56:48

Definetly, the problem is the camera that is attach to the render.
Is it possible to remove the camera to the renderbox??


I read in another post something about the new version of mygui.

any ideas???

itsalamanca

06-12-2008 10:54:06

any ideas??
I have my project very stopped. i need to know how to do it.
thanks.

my.name

06-12-2008 13:31:42

MyGUI::WindowPtr window = mGUI->createWidget<MyGUI::Window>("WindowCSX", MyGUI::IntCoord(400, 400, 200, 200), MyGUI::Align::Default, "Back");
MyGUI::RenderBoxPtr render = window->createWidget<MyGUI::RenderBox>("RenderBox", MyGUI::IntCoord(0, 0, 200, 200), MyGUI::Align::Default);
render->setRenderTarget(this->mCamera);
window->destroySmooth();


Works normally.

show your code

itsalamanca

06-12-2008 18:21:19

my code is


void panelnuevapieza(MyGUI::WidgetPtr _sender)
{
MyGUI::LayoutManager::getInstance().load("NuevaPieza.layout");
MyGUI::WindowPtr ventanaNuevaPieza = rGUI->findWidget<MyGUI::Window>("ventananuevapieza");
MyGUI::RenderBoxPtr renderNuevaPieza=rGUI->findWidget<MyGUI::RenderBox>("rendernuevapieza");
renderNuevaPieza->setRenderTarget(rCameraAux);
MyGUI::ButtonPtr botonCancelar=rGUI->findWidget<MyGUI::Button>("cancelarnuevapieza");
botonCancelar->setEnabled(true);
botonCancelar->eventMouseButtonClick=MyGUI::newDelegate(this, &RobotNuevo::accionCancelar);

}


and the funtcion accionCancelar


void accionCancelar(MyGUI::WidgetPtr _sender)
{
MyGUI::WindowPtr ventana=rGUI->findWidget<MyGUI::Window>("ventananuevapieza");
ventana->destroySmooth();
}


and this is...

Altren

06-12-2008 19:52:11

Try code that my.name wrote. If it doesn't work than there was bug in GUI and you need to get fresh MyGUI code. If it works then problem in your code.

Your code work without any crashes.

itsalamanca

07-12-2008 09:36:37

my mygui version is MyGUI_2.2.0_RC1_source
Can be possible a fresh version??

i also probe "window->destroysmooth" in the function where I implement the render. this doesn't work fine.

so, i download
03/09/2008 : Added Revision 1076 ~ 2.2 RC1
MyGUI SDK for Visual C++ 2005 (8.0) SP1
Link : http://lawliet.net84.net/Packs/1076_2005.rar
MD5: EEB7167489DAD6CEB48ECA5BCECF746D

but, i don't know how to update it to my folder MYGUI,
so, i am very desesperate.
thanks any way.

Altren

07-12-2008 20:31:26

Actually current revision is 1461 and you got 1076 (fell the difference ;) ).

Here's link that always give you latest revision. (but better to use svn client)
http://my-gui.svn.sourceforge.net/viewv ... z?view=tar