Page 1 of 1

crash during rendering

Posted: Sat Jul 09, 2005 10:53
by boto
hi,

sometimes the application crashs during the gui rendering phase. i use the opengl renderer which is hooked into my 3d post-rendering phase. on some machines (winxp) the crash causes sometimes a blue screen :-(

i dynamically create and destroy gui windgets during the runtime using the windows manager's destroy and create methods or create widgets using xml layout loading mechanism.

i suspect the crash has to do with that widget creation and destruction dynamics in my app. should i consider special issues in order to avoid the crash?


cheers
boto

Re: crash during rendering

Posted: Sat Jul 09, 2005 10:59
by lindquist
I assume that the functions you are using are:

Code: Select all

WindowManager::createWindow
WindowManager::destroyWindow


in that case it should be fine!

Re: crash during rendering

Posted: Sat Jul 09, 2005 11:17
by boto
hi lindquist,

yes i create and destroy the widgets using that methods. or i load an xml layout and release the retrieved main window using WindowManager::destroyWindow. the crash happens in ogl driver, i backtrace the stack and see that it happend during doRender method in ogl renderer. the memory containing the primitive data to be rendered is invalid when the crash happens!?

cheers
boto

Re: crash during rendering

Posted: Sat Jul 09, 2005 11:28
by lindquist
what version of cegui are you using?
I use the ogl renderer myself, and I have never had any issues.

are you sure that your linking is good?

Re: crash during rendering

Posted: Sat Jul 09, 2005 12:13
by boto
i use version 0.3. the slightly adapted ogl renderer is that one of previous version. during debuggin i discovered a weird thing, i don't know if the crash problem is related to this:


in order to retrieve widget elements from a loaded layout i use dynamic_cast. in debug version of the application it works. in release version built with debug information the dynamic_cast fails, the runtime throws an exception about missing rtti on that widget object, e.g.:


_p_wnd = dynamic_cast< CEGUI::Window* >( GuiManager::get()->loadLayout( layoutFile, NULL, CHATLAYOUT_PREFIX ) );
_p_frame = dynamic_cast< CEGUI::Window* >( _p_wnd->getChild( CHATLAYOUT_PREFIX "fr_chatbox" ) );

....

_p_editbox = dynamic_cast< CEGUI::Editbox* >( _p_frame->getChild( CHATLAYOUT_PREFIX "eb_editbox" ) );
_p_editbox->subscribeEvent( CEGUI::MultiLineEditbox::EventCharacterKey, CEGUI::Event::Subscriber( &CTD::PlayerChatGui::onEditboxTextChanged, this ) );

the exception occurs during dyn cast for _p_editbox !?

btw: the vc7.1 project settings in 0.3 has wrong compiler flags! the rtti generation is disabled which can be fatal.

cheers
boto

Re: crash during rendering

Posted: Sat Jul 09, 2005 12:50
by CrazyEddie
btw: the vc7.1 project settings in 0.3 has wrong compiler flags! the rtti generation is disabled which can be fatal.

This is intentional. We do not use RTTI within the system, so it's disabled by default.

In relation to the crash problem, we're going to have to know what exception or assert failure that you're getting. If there are any errors in CEGUI.log, posting those with some context lines would also be helpful in tracking down your issue. Though getting a BSOD under WinXP sounds more like a driver issue.

I also regularly use the OpenGL renderer and get no problems :?

Re: crash during rendering

Posted: Sat Jul 09, 2005 18:13
by boto
hmmm, no rtti? is there a reason why cegui does not support that? is it due to performance decrease?

well i gonna change my dynamic_casts now, thanks for the hint. i will also rebuild cegui with no support for rtti ;-)

cheers
boto

Re: crash during rendering

Posted: Sat Jul 09, 2005 18:52
by boto
i have discovered something: directly after destroying some widgets using windows manager in next rendering phase the glDrawArrays gets a buffer which is partially destroyed, e.g. i get glDrawArrays called with 17 quats and only the first 11 quad objects in array are valid.

i suspect that dead widgets try to render themselves!? do i have to call a special method such as "update death pool" by myself?

cheers
boto

btw: the exceptions are gone since i use static_cast again ;-)

Re: crash during rendering

Posted: Sat Jul 09, 2005 18:59
by boto
if someone is interested, i am on irc channel #cegui

cheers
boto