Page 13 of 18
Re: New wiki article: Advanced Ogre Framework
Posted: Wed Feb 09, 2011 5:45 pm
by spacegaier
Okay, I will try to change that tonight in the wiki and in the my precompiled release.
Re: New wiki article: Advanced Ogre Framework
Posted: Thu Feb 10, 2011 1:13 am
by spacegaier
Update 2011/02/10:
- added some Linux specific code bits
- fixed null pointer exception with m_pCurrentObject
- when being in a question dialog you cannot press escape anymore to prevent the application from funny behavior
- corrected pauseAppState()
So, if I did not miss anything all known issues except for one should be solved and wiki pages should be up to date with all the errata posted here.
Bug: gioramies, you are correct. I just updated the DLLs I use for my framework and now I have the same issue with the label font, you reported. No clue where it comes from. Will investigate once I find the time. It might also make sense to contact omniter since he was the one developing the SDKTrays library (AFAIK). Perhaps he has an idea or even spotted the same problem.
Re: New wiki article: Advanced Ogre Framework
Posted: Thu Feb 10, 2011 1:14 am
by spacegaier
ghiboz wrote:hi all, how can I use the loading bar with this advanced ogre framework=
thanks in advance
You could have a look at the Ogre SDK samples code. There is a loading bar used. Never tried it myself though...
Re: New wiki article: Advanced Ogre Framework
Posted: Thu Feb 10, 2011 9:41 am
by ghiboz
spacegaier wrote:You could have a look at the Ogre SDK samples code. There is a loading bar used. Never tried it myself though...
hi! thanks for your reply... I tried to use the code I used before that worked without the framework: the code is this:
in initOgre function i removed this:
Code: Select all
Ogre::String secName, typeName, archName;
Ogre::ConfigFile cf;
cf.load("resources.cfg");
Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
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;
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, secName);
}
}
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
and I added this:
Code: Select all
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( "data/Ogre/SdkTrays.zip", "Zip", "Essential" );
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( "data/Ambient", "FileSystem", "General" );
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( "data/Ogre/Sinbad.zip", "Zip", "General" );
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( "data", "FileSystem", "General" );
Ogre::ResourceGroupManager::getSingleton().addResourceLocation( "data/SkyX", "FileSystem", "SkyX" );
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Essential");
m_pTrayMgr = new OgreBites::SdkTrayManager("AOFTrayMgr", m_pRenderWnd, m_pMouse, 0);
m_pTrayMgr->showLoadingBar();
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("General");
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("SkyX");
m_pTrayMgr->hideLoadingBar();
the system loads correctly the general and skyx group, but the screen remains black and after a while, appears the menu state without show the loading bar...
thanks
Re: New wiki article: Advanced Ogre Framework
Posted: Thu Feb 10, 2011 3:35 pm
by ghiboz
I solved, I show the loadingbar in menustate & gamestate in the enter method after the camera creation & the assignment of the camera to the scene:
Code: Select all
void MenuState::enter()
{
OgreFramework::getSingletonPtr()->m_pLog->logMessage("Entering MenuState...");
m_pSceneMgr = OgreFramework::getSingletonPtr()->m_pRoot->createSceneManager(ST_GENERIC, "MenuSceneMgr");
m_pSceneMgr->setAmbientLight(Ogre::ColourValue(0.7f, 0.7f, 0.7f));
m_pCamera = m_pSceneMgr->createCamera("MenuCam");
m_pCamera->setPosition(Vector3(0, 25, -50));
m_pCamera->lookAt(Vector3(0, 0, 0));
m_pCamera->setNearClipDistance(1);
m_pCamera->setAspectRatio(Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualWidth()) /
Real(OgreFramework::getSingletonPtr()->m_pViewport->getActualHeight()));
OgreFramework::getSingletonPtr()->m_pViewport->setCamera(m_pCamera);
//OgreFramework::getSingletonPtr( )->m_pTrayMgr = new OgreBites::SdkTrayManager("AOFTrayMgr", m_pRenderWnd, m_pMouse, 0);
OgreFramework::getSingletonPtr( )->m_pTrayMgr->showLoadingBar();
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("General");
Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("SkyX");
OgreFramework::getSingletonPtr( )->m_pTrayMgr->hideLoadingBar();
OgreFramework::getSingletonPtr()->m_pTrayMgr->destroyAllWidgets();
OgreFramework::getSingletonPtr()->m_pTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT);
OgreFramework::getSingletonPtr()->m_pTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT);
OgreFramework::getSingletonPtr()->m_pTrayMgr->showCursor();
OgreFramework::getSingletonPtr()->m_pTrayMgr->createButton(OgreBites::TL_CENTER, "EnterBtn", "Enter GameState", 250);
OgreFramework::getSingletonPtr()->m_pTrayMgr->createButton(OgreBites::TL_CENTER, "ExitBtn", "Exit AdvancedOgreFramework", 250);
OgreFramework::getSingletonPtr()->m_pTrayMgr->createLabel(OgreBites::TL_TOP, "MenuLbl", "Menu mode", 250);
createScene();
}
using this way is also cool that I load for each state some separated things...
I hope this little snippet needs to someone
regards
Re: New wiki article: Advanced Ogre Framework
Posted: Sat Feb 12, 2011 9:37 pm
by m4xhua
Hello,
first i have to thank you for your great Framework, it saved me a lot of time. I noticed that it is unable to load Terrain from the DotScene format, because the DotSceneLoader is deleted right after parsing the .scene file. To fix this,
in GameState.cpp i changed
Code: Select all
DotSceneLoader* pDotSceneLoader = new DotSceneLoader();
pDotSceneLoader->parseDotScene("CubeScene.xml", "General", m_pSceneMgr, m_pSceneMgr->getRootSceneNode());
delete pDotSceneLoader;
to
Code: Select all
m_pLoader->parseDotScene("CubeScene.xml", "General", m_pSceneMgr, m_pSceneMgr->getRootSceneNode());
and moved the instantiation of it to GameState Constructor:
and added
to GameState private Attributes. Of course you have to delete m_pLoader in destructor of GameState.
If you delete m_pLoader before destruction of GameState, application will crash when moving from gamestate to menustate and back.
Re: New wiki article: Advanced Ogre Framework
Posted: Sat Feb 12, 2011 10:28 pm
by spacegaier
That's correct if you need the DotScene Loader more than once and in multiple places in the GameState class, you cannot directly delete it. I will however not change that in my framework to keep things clean.
But I do not understand the Terrain thing. In none of your code lines is the terrain ever popping up. Am I missing something?
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 12:17 pm
by m4xhua
Terrain is handled by DotScene Loader, so you dont need to take care of it directly. If you load a DotScene file, for example the SampleProject included in Ogitor, all objects will be loaded correctly, but the Terrain will not be displayed if you delete the DotSceneLoader.
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 12:51 pm
by spacegaier
m4xhua wrote:[...] the Terrain will not be displayed if you delete the DotSceneLoader.
Wow, are you sure about that? I cannot confirm or deny that (never really toyed around with Terrain yet), but that would most certainly be strange IMHO.
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 1:24 pm
by m4xhua
Yes, take a look here
http://www.ogre3d.org/forums/viewtopic.php?f=5&t=58474, seems they have that problem.
Ogre::TerrainGroup* mTerrainGroup, in which the terrain is loaded by the dotSceneLoader is deleted upon destruction of the dotSceneLoader, so the Terrain is deleted while the other objects remain attached to the SceneManager you pass to the DotSceneLoader.
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 1:35 pm
by spacegaier
Okay, perhaps because this is a member of the loader:
Code: Select all
Ogre::TerrainGroup* mTerrainGroup;
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 1:46 pm
by m4xhua
Yes, there may be a way to get this work with holding mTerrainGroup somewhere else and delete dotsceneloader immediately, but deleting dotsceneloader on Gamestate destruction seems easier and memory consistant to me. And you dont have to alter the dotsceneloader.
Re: New wiki article: Advanced Ogre Framework
Posted: Sun Feb 13, 2011 1:54 pm
by spacegaier
Yes, I will think about changing it once I have time for that...
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 6:55 pm
by dave2041
Just want to start by saying i love the Advanced Ogre Framework ^^
a small change i've just made... as i like to work with the console in debug mode and without in release. This causes a linking error:
Code: Select all
2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
This can be resolved by simply adding " && !defined( _DEBUG )" to the first #if statement, making it:
Code: Select all
#if OGRE_PLATFORM == PLATFORM_WIN32 || OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined( _DEBUG )
Just in case it helps anyone.
Also out of the box canceling at the renderer selection screen causes an exception, just curious what cause this?
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 7:05 pm
by spacegaier
dave2041 wrote:Also out of the box canceling at the renderer selection screen causes an exception, just curious what cause this?
No, crash here. What does the log say? Does that happen with my compiled solution or when you compile my solution?
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 8:30 pm
by dave2041
Wow, it doesn't! I now feel like an idiot... when i cancel from the renderer selection screen in release or debug i get an unhandled exception:
Code: Select all
Unhandled exception at 0x010812c8 in AdvancedOgreFramework.exe: 0xC0000005: Access violation reading location 0xcdcdcdcd.
at the line:
Despite the mTrayMgr being null (0xcdcdcdcd) which the if should recognise and move on surly?
Also, is your project in 2008? because i only have 05' and 2010 so i get the project conversion wizard and need to add in the includes/libs etc again~
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 8:51 pm
by spacegaier
Strage. If you do not press cancel the whole application runs fine, right?
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 8:57 pm
by dave2041
Absolutely, no complaints with the framework otherwise.
main function returns 0;
DemoApp trys to delete the ogre framework pointer: delete OgreFramework::getSingletonPtr();
AdvancedOgreFramework trys to delete mTrayMgr even though it's null: if(mTrayMgr) delete mTrayMgr;
Strange right?
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 9:03 pm
by spacegaier
Found the issue. Will update in a second...
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 9:05 pm
by dave2041
Guessing it was the order in which destructor's were being called?
Just niggled at me slightly ha-ha, even though no one except me is likely to press cancel (when i think of something else I'd like to change before seeing the latest build.)
Thanks again for your awesome project

Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 9:08 pm
by spacegaier
Updated the first post and the RAR archive. Wiki article is next...
EDIT: In the BasicOgreFramework is all fine already, since I nulled the pointer there at startup, but obviously forgot it in this framework here
Edit 2: Wiki article fixed as well now. Issue marked as solved on my ToDo list

.
Re: New wiki article: Advanced Ogre Framework
Posted: Tue Mar 29, 2011 9:10 pm
by dave2041
The small errors are the best, just confirmed that was the error. For some reason my eyes saw mInputMgr as mTrayMgr in the constructor rofl.
Re: New wiki article: Advanced Ogre Framework
Posted: Mon Jul 18, 2011 11:23 am
by spacegaier
New update, see first post.
Re: New wiki article: Advanced Ogre Framework
Posted: Mon Aug 01, 2011 1:59 pm
by singmelody
Wonderful simple Framework.
But I want to ask a question.
I have known that the the message system in MFC is based on pass of the message ,but the message system in QT is based on signal slot.
So I have a question here , the framework here is based on what ?
I think it is like the pass of the message , not like QT.
I am right ?
Hope for the answer , thank you .

Re: New wiki article: Advanced Ogre Framework
Posted: Mon Aug 01, 2011 2:26 pm
by spacegaier
Not really sure. To me the KeyListener thing of Ogre sounds like message-passing but I have never digged into the subject. Sorry.