Code: Select all
btnExit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&pctaCEGUI::btnExitEvent, this));
My app start but after 1 second crash.
I'm porting my app to windows (the code works on etch).
This are some feactures that could help to understand my problem:
Platform = winXP
IDE = VC++ 6.0 Profesonal Ed...
CEGUI = Stable release with STLport
STLport = version: 4.6.2
Renderer = Opengl on SDL
SDL = stable 1.2.11
Link->Input = devil.lib ilu.lib ilut.lib glu32.lib opengl32.lib sdlmain.lib sdl.lib ceguibase.lib OpenGLGUIRenderer.lib stlport_vc6.lib
I have all the dependences and the first example founded in the CEGUIwiki
works but i dont know why this line crahs my app, if i coment that line then the app works but my button don't have any event.
the code is:
Code: Select all
void someCEGUIClass::initCEGUI()
{
...
mRenderer = new CEGUI::OpenGLRenderer(0);
mSystem = new CEGUI::System(mRenderer);
CEGUI::WindowManager &wmgr = CEGUI::WindowManager::getSingleton();
CEGUI::SchemeManager &shmgr = CEGUI::SchemeManager::getSingleton();
shmgr.loadScheme("../datafiles/schemes/TaharezLookSkin.scheme");
CEGUI::Window* myRoot = wmgr.createWindow("DefaultWindow", "root");
mSystem->setGUISheet(myRoot);
mSystem->setDefaultMouseCursor("TaharezLook", "MouseArrow");
// CEGUI::FrameWindow* fWnd = dynamic_cast<CEGUI::FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "frame1"));
CEGUI::FrameWindow* fWnd = static_cast<CEGUI::FrameWindow*>(wmgr.createWindow("TaharezLook/FrameWindow", "frame1"));
CEGUI::FontManager::getSingleton().createFont("../datafiles/fonts/Iconified-12.font");
fWnd->setPosition( CEGUI::Point( 0.1f, 0.1f ) );
fWnd->setSize(CEGUI::Size(0.5f, 0.5f));
fWnd->setText("Some caption");
fWnd->setAlpha(0.5);
myRoot->addChildWindow(fWnd);
// CEGUI::PushButton *btnExit = dynamic_cast<CEGUI::PushButton*>(wmgr.createWindow("TaharezLook/Button", "exitButton"));
CEGUI::PushButton *btnExit = static_cast<CEGUI::PushButton*>(wmgr.createWindow("TaharezLook/Button", "exitButton"));
fWnd->addChildWindow(btnExit);
btnExit->setPosition(CEGUI::Point(0.5, 0.5));
btnExit->setSize(CEGUI::Size(0.25, 0.1));
btnExit->setText("Exit");
btnExit->setInheritsAlpha(false);
[b]/* this is */[/b]
btnExit->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(&pctaCEGUI::btnExitEvent, this));
btnExit->setAlwaysOnTop(true);
... more widgets ...
}
the btnExitEvent function is :
Code: Select all
bool pctaCEGUI::btnExitEvent(const CEGUI::EventArgs& e)
{
SDL_Quit();
exit(0);
return true;
}
I don't know what happends. Please any help or suggestion will be execelent
pd: the CEGUI log don't tellme nothing , i supouse that this kind of problem don't don't have relation with the XML files.