Newb Problem: Plugins not loading...

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
jyurkiw
Gnoblar
Posts: 2
Joined: Sat Feb 25, 2012 9:04 am

Newb Problem: Plugins not loading...

Post by jyurkiw »

I'm going through the Madmarx tutorials and I'm having issues loading plugins. Basically, Ogre isn't loading them. Any of them (so far as I can tell).

If someone could point out what I'm doing wrong, it would be appreciated.

Code to follow...

Ogre version is 1.7.4 compiled from source. System is Ubuntu Linux, AMD quad core ~3gig, 8 gigs ram, ATI 5770 video card. IDE is eclipse, but I've been executing from both eclipse and a terminal.
While I'm following MadMarx, it's not his code. I can't stand his coding style (the bracketing makes me want to punt a kitten. Purely personal preference) so I'm just using it as a guide. All the Ogre samples run at 60fps barring the Terrain sample when I change shadow types. The program compiles fine, but when I execute nothing happens (ready gets set to false in setupRenderSystems() so no initialization happens).

Ogre isn't loading any plugins, so I'm not getting a RenderSystem which means I can't initialize Root.

main.cpp

Code: Select all

#include <iostream>
#include "OgreTutorial.h"

using namespace std;

int main (int argv, char **argc)
{
	cout << "Starting program" << endl;
	OgreWrapper ogre(false);
	//ogre.createWindow();
	//ogre.runWindow();
	//cout << "Ending program" << endl;

	return 0;
}
OgreTutorial.h

Code: Select all

#ifndef OGRETUTORIAL_H_
#define OGRETUTORIAL_H_

#include "OgreRoot.h"
#include "OgreRenderSystem.h"
#include "OgreRenderWindow.h"
#include "OgreWindowEventUtilities.h"
#include "OgrePlugin.h"

#include <vector>

using namespace Ogre;

class OgreWrapper
{
public:
	Root *root;
	RenderSystem *renderSystem;

	String windowName;
	bool createWindowAutomatically;
	String customCapacities;
	int sizeX;
	int sizeY;
	bool fullscreen;
	NameValuePairList windowParams;

	RenderWindow *window;

	bool debug;
	bool ready;

	OgreWrapper(bool para_debug = true) : windowName("Tutorial Window"), createWindowAutomatically(false), customCapacities(""),
			sizeX(800), sizeY(600), fullscreen(false), debug(para_debug),
			configFilename(""), pluginsFilename("plugins.cfg"), logFilename("Ogre_Tutorial.log")
	{
		root = new Root(configFilename, pluginsFilename, logFilename);
		addPluginNames();
		setupRenderSystems();
		if (ready) root->initialise(createWindowAutomatically, windowName, customCapacities);
	}

	~OgreWrapper()
	{
		delete root;
	}

	void createWindow()
	{
		if (ready) window = root->createRenderWindow(windowName, sizeX, sizeY, fullscreen, &windowParams);
		else LogManager::getSingleton().logMessage("Not ready...not creating a window.");
	}

	void runWindow()
	{
		if (ready)
		{
			while(!window->isClosed())
				WindowEventUtilities::messagePump();
		} else LogManager::getSingleton().logMessage("Not ready...not running the window.");

		LogManager::getSingleton().logMessage("End of line");
	}

private:
	String configFilename;
	String pluginsFilename;
	String logFilename;

	void addPluginNames()
	{
		if (pluginsFilename.length() == 0)
		{
			String debugStr = debug ? "_d":"";
			root->loadPlugin("RenderSystem_GL" + debugStr);
			root->loadPlugin("Plugin_ParticleFX" + debugStr);
			root->loadPlugin("Plugin_CgProgramManager" + debugStr);
			root->loadPlugin("Plugin_OctreeSceneManager" + debugStr);
			LogManager::getSingleton().logMessage("RenderSystem_GL" + debugStr);
			LogManager::getSingleton().logMessage("Plugin_ParticleFX" + debugStr);
			LogManager::getSingleton().logMessage("Plugin_CgProgramManager" + debugStr);
			LogManager::getSingleton().logMessage("Plugin_OctreeSceneManager" + debugStr);
		} else {
			Root::PluginInstanceList pList = root->getInstalledPlugins();
			Plugin *p = 0;

			LogManager::getSingleton().logMessage("Listing loaded plugins.");

			for (uint i = 0; i < pList.size(); i++) {
				p = pList[i];
				LogManager::getSingleton().logMessage(p->getName());
			}
			p = 0;
		}
	}

	void setupRenderSystems()
	{
		const RenderSystemList& renderSystemList = root->getAvailableRenderers();
		if (renderSystemList.size() == 0)
		{
			LogManager::getSingleton().logMessage("No render system found!");
			ready = false;
		}
		else renderSystem = renderSystemList[0];

		root->setRenderSystem(renderSystem);
	}

	void initializeWindowParams()
	{
		windowParams["FSAA"] = "0";
		windowParams["vsync"] = "true";
	}
};



#endif /* OGRETUTORIAL_H_ */
plugins.cfg

Code: Select all

# Defines plugins to load

# Define plugin folder
PluginFolder=/usr/local/lib
PluginFolder=/usr/local/lib/OGRE

# Define plugins
# Plugin=RenderSystem_Direct3D9
# Plugin=RenderSystem_Direct3D10
# Plugin=RenderSystem_Direct3D11
 Plugin=RenderSystem_GL
 Plugin=RenderSystem_GLES
 Plugin=Plugin_ParticleFX
 Plugin=Plugin_BSPSceneManager
 Plugin=Plugin_CgProgramManager
 Plugin=Plugin_PCZSceneManager
 Plugin=Plugin_OctreeZone
 Plugin=Plugin_OctreeSceneManager
results of some not-so-random ls commands...

Code: Select all

******@******:/usr/local/lib$ ls
libOgreMain.so        libOgrePaging.so        libOgreProperty.so        libOgreRTShaderSystem.so        libOgreTerrain.so        OGRE       python2.7  site_ruby
libOgreMain.so.1.7.4  libOgrePaging.so.1.7.4  libOgreProperty.so.1.7.4  libOgreRTShaderSystem.so.1.7.4  libOgreTerrain.so.1.7.4  pkgconfig  python3.2
******@******:/usr/local/lib$ ls OGRE/
cmake  Plugin_BSPSceneManager.so  Plugin_CgProgramManager.so  Plugin_OctreeSceneManager.so  Plugin_OctreeZone.so  Plugin_ParticleFX.so  Plugin_PCZSceneManager.so  RenderSystem_GL.so
Log output
00:10:58: Creating resource group General
00:10:58: Creating resource group Internal
00:10:58: Creating resource group Autodetect
00:10:58: SceneManagerFactory for type 'DefaultSceneManager' registered.
00:10:58: Registering ResourceManager for type Material
00:10:58: Registering ResourceManager for type Mesh
00:10:58: Registering ResourceManager for type Skeleton
00:10:58: MovableObjectFactory for type 'ParticleSystem' registered.
00:10:58: OverlayElementFactory for type Panel registered.
00:10:58: OverlayElementFactory for type BorderPanel registered.
00:10:58: OverlayElementFactory for type TextArea registered.
00:10:58: Registering ResourceManager for type Font
00:10:58: ArchiveFactory for archive type FileSystem registered.
00:10:58: ArchiveFactory for archive type Zip registered.
00:10:58: DDS codec registering
00:10:58: FreeImage version: 3.13.1
00:10:58: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
00:10:58: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
00:10:58: Registering ResourceManager for type HighLevelGpuProgram
00:10:58: Registering ResourceManager for type Compositor
00:10:58: MovableObjectFactory for type 'Entity' registered.
00:10:58: MovableObjectFactory for type 'Light' registered.
00:10:58: MovableObjectFactory for type 'BillboardSet' registered.
00:10:58: MovableObjectFactory for type 'ManualObject' registered.
00:10:58: MovableObjectFactory for type 'BillboardChain' registered.
00:10:58: MovableObjectFactory for type 'RibbonTrail' registered.
00:10:58: *-*-* OGRE Initialising
00:10:58: *-*-* Version 1.7.4 (Cthugha)
00:10:58: Listing loaded plugins.
00:10:58: No render system found!

00:10:58: *-*-* OGRE Shutdown
00:10:58: Unregistering ResourceManager for type Compositor
00:10:58: Unregistering ResourceManager for type Font
00:10:58: Unregistering ResourceManager for type Skeleton
00:10:58: Unregistering ResourceManager for type Mesh
00:10:58: Unregistering ResourceManager for type HighLevelGpuProgram
00:10:58: Unregistering ResourceManager for type Material
jyurkiw
Gnoblar
Posts: 2
Joined: Sat Feb 25, 2012 9:04 am

Re: Newb Problem: Plugins not loading...

Post by jyurkiw »

OMG...I figured out what it was.

I thought that my plugins directory was /usr/local/lib because it has a number of ogre .so's in it. However this is not the case. Yes, those are shared libraries, and are quite important for linking when you build, however the actual Plugins are in /usr/locl/lib/OGRE one directory down. Soon as I changed the PluginFolder= line in my plugins configuration file from PluginFolder=/usr/locl/lib to PluginFolder=/usr/local/lib/OGRE it worked!

...I knew it was something simple.
Post Reply