Renderer plug-in question (static build)

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Renderer plug-in question (static build)

Post by lonewolff »

Hi Guys,

I have successfully built Ogre 1.9 from source, choosing to create a static build.

So, I have now included my newly built SDK into my project and all is working well when I create 'root'. Everything initialises happily and program terminates normally. :)

But, it seems that now that I am working with a static build, you now need to setup the plug-ins (i.e. the DX9 renderer) differently.

Could anyone please share some wisdom on how you include a renderer on a static built Ogre?

Thanks in advance 8)
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Renderer plug-in question (static build)

Post by lonewolff »

Oh, I got it :)

Seems that static building becomes a lot more 'dependant' - LOL

At the top I have included the following;

Code: Select all

#include"RenderSystems\Direct3D9\include\OgreD3D9Plugin.h"
#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
#pragma comment(lib,"dxerr.lib")
#pragma comment(lib,"dxguid.lib")
And in the body of the code to load the actual plug-in.

Code: Select all

D3D9Plugin* mD3D9Plugin;
mD3D9Plugin = OGRE_NEW D3D9Plugin();
mRoot->installPlugin(mD3D9Plugin);
User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm
x 6

Re: Renderer plug-in question (static build)

Post by LJS »

Don't forget to free the memory, otherwise your application would leak.

Code: Select all

OGRE_DELETE mD3D9Plugin;
// if you are tidy enough, the next is required too :P
// i.e. reusable code && valid pointer usage
mD3D9Plugin = 0;
R,
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
User avatar
LJS
Greenskin
Posts: 138
Joined: Wed Jan 09, 2013 8:58 pm
x 6

Re: Renderer plug-in question (static build)

Post by LJS »

P.S. clean up after the root has been freed, destroy-ing will be done by the Ogre::Root
(am very clumbsy, especially with words on a static screen.)
Ogre 3D 1.9.0 static
Bullet 2.8 static
User avatar
lonewolff
Ogre Magi
Posts: 1207
Joined: Wed Dec 28, 2005 12:58 am
x 6

Re: Renderer plug-in question (static build)

Post by lonewolff »

Yep, always do :wink:
Post Reply