I'm having a problem with integrating my Ogre application into an existing SDL application. The main game framework is based on SDL, but for certain game elements my Ogre based class should be started, but when I try to start it I get the following assert triggered:
freebooters: OgreHardwareBufferManager.cpp:40: static Ogre::HardwareBufferManager& Ogre::HardwareBufferManager::getSingleton(): Assertion `ms_Singleton' failed.
Program received signal SIGABRT, Aborted.
[Switching to Thread -1220060416 (LWP 5367)]
0xb7a72ed9 in raise () from /lib/tls/libc.so.6
(gdb) bt
#0 0xb7a72ed9 in raise () from /lib/tls/libc.so.6
#1 0xb7a74771 in abort () from /lib/tls/libc.so.6
#2 0xb7a6c443 in __assert_fail () from /lib/tls/libc.so.6
#3 0xb7d44c52 in Ogre::HardwareBufferManager::getSingleton () from /usr/lib/libOgreMain.so.4
#4 0xb7e4342f in Ogre::VertexData::VertexData () from /usr/lib/libOgreMain.so.4
#5 0xb7d2fda4 in Ogre::Frustum::Frustum () from /usr/lib/libOgreMain.so.4
#6 0xb7cfeee2 in Ogre::Camera::Camera () from /usr/lib/libOgreMain.so.4
#7 0xb4e65ab2 in Ogre::OctreeCamera::OctreeCamera () from /usr/lib/OGRE/Plugin_OctreeSceneManager.so
#8 0xb4e5f881 in Ogre::OctreeSceneManager::createCamera () from /usr/lib/OGRE/Plugin_OctreeSceneManager.so
#9 0xb4e7314e in Ogre::TerrainSceneManager::createCamera () from /usr/lib/OGRE/Plugin_OctreeSceneManager.so
#10 0x080cba50 in Seapassage::setup (this=0xbffff5c0, initial_tile=
{static npos = 4294967295, _M_dataplus = {<std::allocator<char>> = {<No data fields>}, _M_p = 0x829f1ac "center"}, static _S_empty_rep_storage = {0, 0, 20, 0}}) at seapassage.cc:89
#11 0x080c66a0 in Gameplay::turn (this=0xbffffa90, world=0xbffffab0, m=0xbffffb20) at gameplay.cc:530
#12 0x08061cf7 in main (argc=1, argv=0xbffffc24) at freebooters.cc:145
(gdb)
So, I assume this HardwareBufferManager ms_Singleton is some resource that is already blocked by SDL when Ogre tries to re-use it. Can someone please enlighten me which specific resource is referenced here?
Cheers,
Moritz
Launching my Ogre application from inside an SDL app fails
-
jmm
- Gnoblar
- Posts: 9
- Joined: Fri Oct 15, 2004 12:43 pm
- Location: Bremen, Germany
- Psilo
- Gnoblar
- Posts: 3
- Joined: Thu Sep 30, 2004 2:29 pm
- Location: Denmark
- Contact:
SDL and Ogre
It's too bad nobody has posted any replies to your problem, and unfortunatly I don't have an answer. In counter to an answer I have another problem, which to me is somehow weird.
OgreMain includes SDL.lib and SDLmain.lib in ogrenew\Dependencies\lib, and here are the header files: ogrenew\Dependencies\include. The weird thing is that when I build an application using OgreMain (which are including SDL), I don't have access to the SDL lib unless I include it again from another path.
Help is appreciated.
OgreMain includes SDL.lib and SDLmain.lib in ogrenew\Dependencies\lib, and here are the header files: ogrenew\Dependencies\include. The weird thing is that when I build an application using OgreMain (which are including SDL), I don't have access to the SDL lib unless I include it again from another path.
Help is appreciated.
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
@jmm: Must have missed this post the first time around. The lack of a HardwareBufferManager singleton just means it hasn't been created, which suggests you didn't initialise Ogre properly. It's nothing to do with SDL.
@Psilo: SDLmain.lib etc happens to be in the old dependency package, but we don't use it on Windows. SDL has significant limitations, not least of which is the inability to handle more than one window. Some time ago we dropped SDL in Windows in favour of a native window implementation to allow us to get around this. Only Linux and OSX use SDL, although Linux has the additional option of native GLX which is again more flexible. I think temas is planning on a native Apple window manager again to get around SDL's limitations. SDL is great as a quick solution, but a native one is much better.
@Psilo: SDLmain.lib etc happens to be in the old dependency package, but we don't use it on Windows. SDL has significant limitations, not least of which is the inability to handle more than one window. Some time ago we dropped SDL in Windows in favour of a native window implementation to allow us to get around this. Only Linux and OSX use SDL, although Linux has the additional option of native GLX which is again more flexible. I think temas is planning on a native Apple window manager again to get around SDL's limitations. SDL is great as a quick solution, but a native one is much better.
-
johi
- Gnoblar
- Posts: 2
- Joined: Thu Feb 03, 2005 9:25 pm
- Location: Denmark
- Contact:
Lack of SDL support on Windows
Hi,
Im not really an expert at this... but I have hassled with a problem of getting SDL to run from within an Ogre application under Windows (VC++ 6.0). Not for Graphics rendering but some of the other functionality like timers and threads that comes with the lib. I have been wondering why the compiler wont allow me to do this, is there some switch that prevents SDL from running at all?
Can I activate a given switch for enabling SDL or is there some other method? Even another library that is recommended for this kind of functionality that will run with Ogre?
Does the upcoming version of Ogre solve this problem?
Cheers Johi
Im not really an expert at this... but I have hassled with a problem of getting SDL to run from within an Ogre application under Windows (VC++ 6.0). Not for Graphics rendering but some of the other functionality like timers and threads that comes with the lib. I have been wondering why the compiler wont allow me to do this, is there some switch that prevents SDL from running at all?
Can I activate a given switch for enabling SDL or is there some other method? Even another library that is recommended for this kind of functionality that will run with Ogre?
Does the upcoming version of Ogre solve this problem?
Cheers Johi
- sinbad
- OGRE Retired Team Member

- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 67
- Contact:
I think you need to ask the SDL guys this. As I said, we do nothing at all with SDL in Windows either in 0.15.x or the imminent 1.0.0 so if SDL won't work, it's nothing to do with us.
There is no 'activate SDL' option because we have no use for it. You can use SDL if you want but it's behaviour is unrelated to Ogre.
There is no 'activate SDL' option because we have no use for it. You can use SDL if you want but it's behaviour is unrelated to Ogre.
-
johi
- Gnoblar
- Posts: 2
- Joined: Thu Feb 03, 2005 9:25 pm
- Location: Denmark
- Contact:
Lack of SDL support on Windows
Thx Sinbad,
i found the source to not being able to link SDL into my application. Though it is probably not the right Forum to post this, I will write the answer anyway so no dummys like me come asking these questions again.
The following must be stated because of a conflict with MSCVR.lib
cheers Johi
i found the source to not being able to link SDL into my application. Though it is probably not the right Forum to post this, I will write the answer anyway so no dummys like me come asking these questions again.
The following must be stated because of a conflict with MSCVR.lib
Code: Select all
#pragma comment(lib, "SDL.lib")
#pragma comment(lib, "SDLmain.lib")