Use OgreMain_d.dll in mogre1.7.1 for framework 4.0

peterjs2011

13-10-2010 17:10:46

hi mstoyke,
In our project, we are using mogre1.7.1 with .net framework 4.0. compiled binaries

meanwhile we want to develop some C++ components using OgreMain_d.dll in mogre1.7.1 for framework 4.0.
when i use below code:
Ogre::HardwareBufferManager::getSingleton();
it returns NULL.

Can you give me some suggestions?

thanks
peter

nataz

19-11-2010 21:36:53

When using Mogre, you really should use the .NET Methods, which in that case would be: Mogre.HardwareBufferManager.Singleton (C#) or HardwareBufferManager::Singleton

peterjs2011

25-11-2010 05:28:38

hi nataz,

Based on our project, we not only use .net method but also use native c++ method.
You know in the mogre for .net framework 4.0 folder that including Mogre.dll, OgreMain_d.dll, OgreMain_d.lib, Plugin_OctreeSceneManager_d.lib and so on.
We want to call OgreMain_d.lib by using native c++,
when we run below code
Ogre::HardwareVertexBufferSharedPtr p = Ogre::HardwareBufferManager::getSingletonPtr()->createVertexBuffer(12,10,Ogre::HardwareBuffer::Usage::HBU_DYNAMIC,false);
the application crashed.

Can you give me some suggestion?

thanks
peter

mstoyke

25-11-2010 15:13:46

Did you compile and link your application with the Mogre version of Ogre headers and libs?

peterjs2011

26-11-2010 01:48:53

yes, I compiled successfully.
I call the Mogre version of Ogre headers and libs function very well but when I call below function

Ogre::HardwareVertexBufferSharedPtr p = Ogre::HardwareBufferManager::getSingletonPtr()->createVertexBuffer(12,10,Ogre::HardwareBuffer::Usage::HBU_DYNAMIC,false);
the application crashed. I can not find any clue.

thanks
peter