MyGUI and SDL

DudeCooper

18-01-2009 13:41:15

Hi, i have been using ogre for quite a while now and decided to use SDL for input rather than OIS, this seems 2 have come back and bitten me in the ass :) . The problem is MyGUI seems 2 only use OIS so i created a work around and made it so that OIS can work for the gui and SDL for everything else. Great..... except now that i have loaded up OIS the mouse cursor has vanished so i cant tell where the cursor is. Does any one have a way for MyGui to use SDL or for a way to show the cursor.


Thank you.

Five_stars

18-01-2009 13:46:38

MyGUI seems to use not only OIS :) . But OIS is default, yes.

You can look through MyGUI_WidgetOIS.h and define macro MYGUI_NO_OIS.

DudeCooper

18-01-2009 15:54:56

i am following this tutorial http://www.ogre3d.org/wiki/index.php/MyGUI_quickstart but i am getting a problem when i use this line

MyGUI::ButtonPtr button = mGUI->createWidget(<MyGUI::Button>("Button",10,10,300,26,MyGUI::ALIGN_STRETCH , "Main"); it tells me it cant find the layer "main", i would think that would be correct as one has not been created( i think) but the tutorial mentions nothing about this. Any one got any ideas to how to do this. i have looked in the test app and it just uses "Statistic" and i cant find any refrence to that anywhere.


Thank you.

Altren

18-01-2009 16:16:02

MyGUI::ButtonPtr button = mGUI->createWidget(<MyGUI::Button>("Button",10,10,300,26,MyGUI::ALIGN_STRETCH , "Main"); it tells me it cant find the layer "main""Main" or "main"? Layer names is case sensitive. Also look at this http://www.ogre3d.org/wiki/index.php/MyGUI_FAQ . If it won't help show me your exact code, because line that you pasted here is not copypaste (it have '(' before <MyGUI::Button> )

DudeCooper

18-01-2009 16:36:50

yeah the ( was to get intelisence to tell me what it wanted, i did remove it before i ran it i just forgot to take it out there :)


i have added the resources in manually... i think this is right and i have made sure that they are there and used break points to make sure the folders are being added.

FileSystem=../../media
FileSystem=../../media/fonts
FileSystem=../../media/materials/programs
FileSystem=../../media/materials/scripts
FileSystem=../../media/materials/textures
FileSystem=../../media/models
FileSystem=../../media/overlays
FileSystem=../../media/particle
FileSystem=../../media/gui
FileSystem=../../media/DeferredShadingMedia
FileSystem=../../FooBar
FileSystem=../../LayoutEditor
FileSystem=../../Demo_itemBox
FileSystem=../../MyGUI_Media
FileSystem=../../vector
FileSystem=../../Media/TestApp
FileSystem=../../media/packs/cubemap.zip
Zip=../../media/packs/cubemapsJS.zip
Zip=../../media/packs/dragon.zip
Zip=../../media/packs/fresneldemo.zip
Zip=../../media/packs/ogretestmap.zip
Zip=../../media/packs/skybox.zip


the code i am using is

mGUI = new MyGUI::Gui();
mGUI->initialise(Game::getGame()->getRClass()->GetRWindow());

MyGUI::ButtonPtr button = mGUI->createWidget<MyGUI::Button>("Button", 10, 10, 300, 26, MyGUI::ALIGN_DEFAULT, "Main"); ////Crashes here
button->eventMouseButtonClick = MyGUI::newDelegate(this, &GUIClass::ButtonCallBack);


Thank you for your help, if i was not on the ground floor my pc would be out the window :)

Five_stars

18-01-2009 17:05:51

Hm... intresting. Check that you have a valid Ogre::Window.

And post MyGUI log, please.

If Ogre::Window is valid, try to detect where it crashes in Gui->createWidget. (Copy MyGUI_d.pdb to directory, in which your application is running). I hope you build MyGUI from SVN source :) .

DudeCooper

18-01-2009 17:16:28

from the log everthing is good but here


PluginManager successfully initialized | c:\users\cooper\desktop\ogresdk\mygui_2.2.0_rc1_source\myguiengine\src\mygui_pluginmanager.cpp | 25
17:10:32 | General | Error | Gui : 'core.xml' not found | c:\users\cooper\desktop\ogresdk\mygui_2.2.0_rc1_source\myguiengine\src\mygui_gui.cpp | 272
17:10:32 | General | Info | Gui successfully initialized | c:\users\cooper\desktop\ogresdk\mygui_2.2.0_rc1_source\myguiengine\src\mygui_gui.cpp | 91
17:10:38 | General | Warning | Skin 'Button' not found, set Default | c:\users\cooper\desktop\ogresdk\mygui_2.2.0_rc1_source\myguiengine\src\mygui_skinmanager.cpp | 87
17:10:38 | General | Critical | Layer 'Main' is not found | c:\users\cooper\desktop\ogresdk\mygui_2.2.0_rc1_source\myguiengine\src\mygui_layermanager.cpp | 149


i dont know why it cant find it though

FileSystem=../../MyGUI_Media is added......

C:\Users\Cooper\Desktop\OgreSDK\media\MyGUI_Media\ //core.xml is there

i hope i have missed out something... hopefully nothing too obvious or ill feel stupid :)

thank you

Five_stars

18-01-2009 17:47:34

May be you create Gui before loading resource paths in Ogre?

loading resource paths - like this
// Load resource paths from config file
Ogre::ConfigFile cf;
cf.load(mResourcePath + mResourceCfgName);

// Go through all sections & settings in the file
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();

Ogre::String secName, typeName, archName;
while (seci.hasMoreElements())
{
secName = seci.peekNextKey();
Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
Ogre::ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
addResourceLocation(archName, typeName, secName);
}
}


Can you paste your initialization code of Ogre here?

DudeCooper

18-01-2009 18:02:43


mRoot = new Root()
String secName, typeName, archName;
ConfigFile cf;
cf.load("resources.cfg"); ConfigFile::SectionIterator seci = cf.getSectionIterator();
while (seci.hasMoreElements())
{

secName = seci.peekNextKey();
ConfigFile::SettingsMultiMap *settings = seci.getNext();
ConfigFile::SettingsMultiMap::iterator i;
for (i = settings->begin(); i != settings->end(); ++i)
{
typeName = i->first;
archName = i->second;
ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}

mgr = mRoot->createSceneManager(ST_GENERIC, "SceneMgr");
Camera* cam = mgr->getCamera("Camera");
Viewport *vp = mRoot->getAutoCreatedWindow()->addViewport(cam);
cam->setAspectRatio(Real(vp->getActualWidth())/Real(vp->getActualHeight()));


i hope that is right. i tried to put the files in the working directory and that didnt work either

DudeCooper

18-01-2009 18:09:08

SUCCESS!!!! i am a fool. i feel stupid. in the resource location i added the extra ones in and got it abit wrong. it seems the resource loader doesnt complain if it cant find a folder. :roll:

but the mouse only moves in a tiny rectangle rather than the full size of the screen, i checked the size it thinks it has and it is 1024 *786 ....

Thank you for your help

Altren

19-01-2009 00:53:46

but the mouse only moves in a tiny rectangle rather than the full size of the screen, i checked the size it thinks it has and it is 1024 *786 .... viewtopic.php?f=17&t=7990