Assertion failed: ms_Singleton
Posted: Thu Jul 10, 2008 21:53
Hello,
I have a project that has been worked on for quite some time (started as thesis, now research proj) which uses H3D and CEGUI.
My program uses CEGUI to display windows, buttons, and test fields over a 3D scene, and it has worked very well in the past.
Last week I decided to update the project from H3D1.5 and CEGUI 0.5 to H3D2.0 and CEGUI 0.6.1 (I also updated MSVC++ from 2005 to 2008). I made all the same revisions to the code as were present in the older code base, and I am now running into the above-mentioned problem.
When my program calls Scene::mainLoop() (which initializes a GLUT window and starts a glutMainLoop()), it crashes with the "Assertion failed" error.
Commenting out "CEGUI::System::getSingleton().renderGUI();", which is called from the H3D render function, does not solve the problem.
When I run a debug version, I get a breakpoint in a custom MouseSensor file which injects mouse events into CEGUI as well as H3D.
I consistently get the breakpoint at line 33. I put the variables x and y on watch, and they show the correct (expected) values at the time of execution.
Anyway, I've been banging my head on my keyboard for a few days now because there isn't a single difference between the old code and the new code except for the versions (and in the mouseSensor file, "mouseMotionAction" used to be "GLUTmouseMotionAction", so I changed the method names appropriately).
Any help or suggestions would be greatly appreciated. Thanks.
-sd
I have a project that has been worked on for quite some time (started as thesis, now research proj) which uses H3D and CEGUI.
My program uses CEGUI to display windows, buttons, and test fields over a 3D scene, and it has worked very well in the past.
Last week I decided to update the project from H3D1.5 and CEGUI 0.5 to H3D2.0 and CEGUI 0.6.1 (I also updated MSVC++ from 2005 to 2008). I made all the same revisions to the code as were present in the older code base, and I am now running into the above-mentioned problem.
When my program calls Scene::mainLoop() (which initializes a GLUT window and starts a glutMainLoop()), it crashes with the "Assertion failed" error.
Commenting out "CEGUI::System::getSingleton().renderGUI();", which is called from the H3D render function, does not solve the problem.
When I run a debug version, I get a breakpoint in a custom MouseSensor file which injects mouse events into CEGUI as well as H3D.
Code: Select all
1 void MyzieMouseSensor::mouseButtonAction( int button, int state )
2 {
3 MouseSensor::mouseButtonAction(button, state);
4 switch( button ) {
5 case LEFT_BUTTON:
6 if (state == DOWN)
7 CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::LeftButton);
8 else if (state == UP)
9 CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::LeftButton);
10 break;
11 case RIGHT_BUTTON:
12 if (state == DOWN)
13 CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::RightButton);
14 else if (state == UP)
15 CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::RightButton);
16 break;
17 case MIDDLE_BUTTON:
18 if (state == DOWN)
19 CEGUI::System::getSingleton().injectMouseButtonDown(CEGUI::MiddleButton);
20 else if (state == UP)
21 CEGUI::System::getSingleton().injectMouseButtonUp(CEGUI::MiddleButton);
22 break;
23 }
24 }
25 void MyzieMouseSensor::mouseWheelAction( int wheel, int direction )
26 {
27 MouseSensor::mouseWheelAction(direction);
28 CEGUI::System::getSingleton().injectMouseWheelChange(direction);
29 }
30 void MyzieMouseSensor::mouseMotionAction( int x, int y )
31 {
32 MouseSensor::mouseMotionAction(x, y);
33 CEGUI::System::getSingleton().injectMousePosition(x, y);
34 }
I consistently get the breakpoint at line 33. I put the variables x and y on watch, and they show the correct (expected) values at the time of execution.
Anyway, I've been banging my head on my keyboard for a few days now because there isn't a single difference between the old code and the new code except for the versions (and in the mouseSensor file, "mouseMotionAction" used to be "GLUTmouseMotionAction", so I changed the method names appropriately).
Any help or suggestions would be greatly appreciated. Thanks.
-sd