Develop just 1 application NxOgre

zolver

15-12-2010 02:48:55

Hi, dear Betajaen...

I've seen NxOgre Demo from NxOgre Tutorial, https://github.com/betajaen/nxogretutorials. It is great. We have to run SampleBrowser application from OGRE bin folder application to watch this Demo, then we choose one by one from many application there, included there is NxOgre Detritus demo. My question, how I can running just one application which we want, for example NxOgre Tutorials - 101 - Box on a Plane, NxOgre Tutorials - 111 - Dynamic CCD or others example demo ?

Thanks

bunny2015

15-12-2010 02:57:49

Do it yourself. use example framework like ogre1.6.x.

zolver

15-12-2010 03:18:14

I use Spacegaier Tutorials framework, http://www.ogre3d.org/tikiwiki/BloodyMess+Tutorial+2. But I don't know where I must place each function of NxOgre like setupPhysics(), etc. into that framework. I copy all file to creatScene function, but the result is not like NxOgre detritus demo.

betajaen

15-12-2010 08:37:52

Integrating NxOgre and getting it running is particularly easy, far easier than Ogre say in IMHO. You should be concentrating on the content of the function than just copying and pasting the createPhysics function. You'll never learn it otherwise.

You'll find out that it only takes 3-4 lines of actual NxOgre code to get it running (Create the World, Create the Scene, Create the RenderSystem and advance NxOgre on the framelistener). Just put the first three parts after you've created the SceneManager, and the last bit in your FrameListener frameStarted function.

zolver

15-12-2010 13:25:38

I included source from NxOgre Tutorials - 101 - Box on a Plane in createScene function of my application. And I use Spacegaier tutorial framework, it's work normally. But when I included source from NxOgre Tutorials - 111 - Dynamic CCD with the same framework, I got error. It is my snippet of source code

void makeCCDBox()
{
.........................
}
void makeStack(int size)
{
.........................
}
void createScene()
{
......................... // here is same with [b]NxOgre Tutorials - 111 - Dynamic CCD[/b]
}

// Create a new frame listener
void createFrameListener()
{
mFrameListener = new BloodyMessTutorial2Listener(mWindow, mCamera);
mRoot->addFrameListener(mFrameListener);
}

................................................

#ifdef __cplusplus
extern "C" {
#endif

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
#else
int main(int argc, char **argv)
#endif
{
// Create application object
BloodyMessTutorial2 app;

try {
app.go();
} catch(Exception& e) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
MessageBoxA(NULL, e.getFullDescription().c_str(),
"An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
std::cerr << "An exception has occurred: " << e.getFullDescription();
#endif
}

return 0;
}

#ifdef __cplusplus
}
#endif


I got this error
1>c:\dev\projects\nxogre\rc1\rc1.cpp(177) : error C2872: 'Exception' : ambiguous symbol
1> could be 'c:\dev\nxogre-d\sdk\nxogreexception.h(52) : NxOgre::Exception'
1> or 'c:\dev\ogresdk\include\ogre\ogreexception.h(92) : Ogre::Exception'
1>c:\dev\projects\nxogre\rc1\rc1.cpp(179) : error C2039: 'getFullDescription' : is not a member of 'NxOgre::Exception'
1> c:\dev\nxogre-d\sdk\nxogreexception.h(52) : see declaration of 'NxOgre::Exception'
1>c:\dev\projects\nxogre\rc1\rc1.cpp(179) : error C2228: left of '.c_str' must have class/struct/union


How I can fix it?
thanks

betajaen

15-12-2010 13:34:47

You've got:

using namespace Ogre;
using namespace NxOgre;


In your source code somewhere. This a bit naughty, because you can have clashes with names, like you have there.

Anyway, to fix your problem. Tell the compiler you mean Ogre's exception, not NxOgre's.

catch(Ogre::Exception& e) {

zolver

15-12-2010 13:47:09

OK.
I've succeded to compile it. But, when I run the *.exe application I got message "Visual Just in Time Debugger" and I close the application. How I can fix it?
Thanks

zolver

15-12-2010 13:59:43

It is snippet of Ogre.log
20:56:10: Parsing script Examples.material
20:56:11: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource hdr.cg in resource group General or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 753)
20:56:11: High-level program Examples/MorningSkyBoxHDRfp encountered an error during loading and is thus not supported.
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource hdr.cg in resource group General or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 753)
20:56:11: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource hdr.cg in resource group General or any other group. in ResourceGroupManager::openResource at ..\..\..\..\OgreMain\src\OgreResourceGroupManager.cpp (line 753)
20:56:11: High-level program Examples/MorningCubeMapHDRfp encountered an error during loading and is thus not supported.

betajaen

15-12-2010 14:12:06

Those are all Ogre errors which I cannot help with. I've also never heard of "Visual Just in Time Debugger" message either, I suspect it's to do with your IDE.