lpa
15-07-2010 13:21:19
Hi,
I have build QuickGUI 10.1 in debug version for Ogre 1.7.1 with vs c++ 2008 express.
When i lunch my exe all works fine but when i press a key or i mouve mouse that crash.
my code:
edit: i try to bluid the release version and that not crash but the mouse cursor don't move (i don't know if it's normaly).
re edit: tank you i have solved my probleme by juste change this line:
to
all work and the cusor move
Thanks and sorry for my bad english.
I have build QuickGUI 10.1 in debug version for Ogre 1.7.1 with vs c++ 2008 express.
When i lunch my exe all works fine but when i press a key or i mouve mouse that crash.
Exception non gérée à 0x00612cc6 (QuickGUI_d.dll) dans tower.exe : 0xC0000005: Violation d'accès lors de la lecture de l'emplacement 0xcccccd80.
(Unhandled exception at 0x00612cc6 (QuickGUI_d.dll) in tower.exe: 0xC0000005:
Access violation when reading the site 0xcccccd80.)
my code:
bool World::setup(void)
{
mRoot = new Ogre::Root(mPluginsCfg);
QuickGUI::registerScriptReader();
setupResources();
bool carryOn = configure();
if (!carryOn) return false;
chooseSceneManager();
camera = new Camera(mSceneMgr,mWindow);
// Set default mipmap level (NB some APIs ignore this)
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
// Create any resource listeners (for loading screens)
createResourceListener();
// Load resources
loadResources();
//initializ quick gui
new QuickGUI::Root();
QuickGUI::SkinTypeManager::getSingleton().loadTypes();
QuickGUI::GUIManagerDesc d;
d.sceneManager = mSceneMgr;
d.viewport = camera->getViewport();
d.queueID = Ogre::RENDER_QUEUE_OVERLAY;
d.name="tower_GUI";
QuickGUI::GUIManager* GUIManager = QuickGUI::Root::getSingletonPtr()->createGUIManager(d);
/*QuickGUI::Sheet* GUISheet = QuickGUI::SheetManager::getSingleton().createSheet("media/default.sheet",true);
GUIManager->setActiveSheet(GUISheet);*/
QuickGUI::SheetDesc* sd = QuickGUI::DescManager::getSingleton().getDefaultSheetDesc();
sd->resetToDefault();
sd->widget_dimensions.size = QuickGUI::Size(800,600);
QuickGUI::Sheet* mySheet = QuickGUI::SheetManager::getSingleton().createSheet(sd);
GUIManager->setActiveSheet(mySheet);
// Create the scene
createScene();
createFrameListener();
return true;
};
bool World::mouseMoved( const OIS::MouseEvent &arg )
{
float z = arg.state.Z.rel;
if(z != 0)
GUIManager->injectMouseWheelChange(z);
GUIManager->injectMousePosition(arg.state.X.abs, arg.state.Y.abs);
if (mTrayMgr->injectMouseMove(arg)) return true;
rotX = Ogre::Degree(-arg.state.X.rel * 0.13);
rotY = Ogre::Degree(-arg.state.Y.rel * 0.13);
camera->rotate(rotX,rotY);
return true;
}
edit: i try to bluid the release version and that not crash but the mouse cursor don't move (i don't know if it's normaly).
re edit: tank you i have solved my probleme by juste change this line:
QuickGUI::GUIManager* GUIManager = QuickGUI::Root::getSingletonPtr()->createGUIManager(d);
to
GUIManager = QuickGUI::Root::getSingletonPtr()->createGUIManager(d);
all work and the cusor move
Thanks and sorry for my bad english.