[UNSOLVED]Ogre 1.9 latest Material woes

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Post Reply
drwbns
Orc Shaman
Posts: 786
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

[UNSOLVED]Ogre 1.9 latest Material woes

Post by drwbns »

Hi guys, for some reason, my code isn't valid with latest 1.9 from repo.

Code: Select all

MaterialPtr pPointLightMaterial = MaterialManager::getSingletonPtr()->create("myMaterial", "General");

Code: Select all

 cannot convert from 'Ogre::Resource *' to 'Ogre::Material *'

see reference to function template instantiation 'Ogre::SharedPtr<T>::SharedPtr<Ogre::Resource>(const Ogre::SharedPtr<Ogre::Resource> &)
Did something change in SharedPtr ?

UPDATE: just found in new Ghadomon notes in Wiki, thanks to masterfalcon

Code: Select all

MaterialPtr pPointLightMaterial = MaterialManager::getSingletonPtr()->create("PointLight.Model.Material", "General").staticCast<Material>();
Last edited by drwbns on Mon Jul 08, 2013 1:18 am, edited 2 times in total.
User avatar
spacegaier
OGRE Team Member
OGRE Team Member
Posts: 4300
Joined: Mon Feb 04, 2008 2:02 pm
Location: Germany
x 130
Contact:

Re: [SOLVED]Ogre 1.9 latest Material woes

Post by spacegaier »

All correct as stated above. Just wanted to add the link to the Ghadamon Porting Notes for future reference: http://www.ogre3d.org/tikiwiki/tiki-ind ... ting_Notes
Ogre Admin [Admin, Dev, PR, Finance, Wiki, etc.] | BasicOgreFramework | AdvancedOgreFramework
Don't know what to do in your spare time? Help the Ogre wiki grow! Or squash a bug...
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: [SOLVED]Ogre 1.9 latest Material woes

Post by Transporter »

This change is like hell because it's necessary to patch all libraries. :D
  • btogre
  • ogreassimp
  • MyGUI
  • CEGUI
  • ...
I think I'll publish my next release arround 16.07., there are so many plugins to fix.
drwbns
Orc Shaman
Posts: 786
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: [SOLVED]Ogre 1.9 latest Material woes

Post by drwbns »

Yeap. Looks like all libs using sharedptr need patches to new usage. i already patched my local ogre procedural for an editor im building. ill post back with any other issues found :) on a side note. is there any way to not have to include ogrebuildsettings.h and the new ogrethreaddefines.h ?
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: [SOLVED]Ogre 1.9 latest Material woes

Post by masterfalcon »

Nope. BuildSettings should get pulled in with Ogre.h or OgrePlatform.h or OgreCommon.h, not sure which specifically. The separation is to help reduce unnecessary includes of things like boost headers that slow down compilation.
drwbns
Orc Shaman
Posts: 786
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: [UNSOLVED]Ogre 1.9 latest Material woes

Post by drwbns »

Ah ok, I see Ogre.h->OgrePrerequisites.h->OgrePlatform.h->OgreConfig.h->OgreBuildSettings.h, thanks. Looks like OgreThreadHeaders.h has been changed to include OgreThreadDefines.h, which is also included in Ogre.h through various other includes

I'm still missing a few import functions in my OgreMain debug dll somehow; if anyone can help -
Ogre-1.9-latest.png
Ogre-1.9-latest.png (44.75 KiB) Viewed 2792 times
drwbns
Orc Shaman
Posts: 786
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: [UNSOLVED]Ogre 1.9 latest Material woes

Post by drwbns »

So I did a project clean and rebuild along with re-installing the Ogre SDK and that seemed to fix just about everything, except now I'm getting a DX9 rendersystem error that I haven't got before when trying to create the RenderWindow -

Code: Select all

	IDirect3DDevice9* D3D9RenderSystem::getActiveD3D9Device()
	{	
		D3D9Device* activeDevice = msD3D9RenderSystem->mDeviceManager->getActiveDevice(); // mDeviceManager is NULL somehow ???
		IDirect3DDevice9* d3d9Device;

		d3d9Device = activeDevice->getD3D9Device();

		if (d3d9Device == NULL)
		{
			OGRE_EXCEPT( Exception::ERR_INVALIDPARAMS, 
				"Current d3d9 device is NULL !!!", 
				"D3D9RenderSystem::getActiveD3D9Device" );
		}

		return d3d9Device;
	}	
I've already initialized Ogre like so ( was working before I updated ) -

Code: Select all

bool OgreApp::InitOgreRoot()
{
	mRoot = new Root("plugins" OGRE_BUILD_SUFFIX ".cfg");

#ifdef _DEBUG
	mRoot->loadPlugin("RenderSystem_Direct3D9_d");
	//mRoot->loadPlugin("RenderSystem_GL_d");
	mRoot->loadPlugin("Plugin_CgProgramManager_d");
#else
	mRoot->loadPlugin("RenderSystem_Direct3D9");
	//mRoot->loadPlugin("RenderSystem_GL");
	mRoot->loadPlugin("Plugin_CgProgramManager");
#endif

	//RenderSystem* pSystem = mRoot->getRenderSystemByName("OpenGL Rendering Subsystem");
	RenderSystem* pSystem = mRoot->getRenderSystemByName("Direct3D9 Rendering Subsystem");
	pSystem->setConfigOption("Full Screen", "No");
	pSystem->setConfigOption("VSync", "Yes");
	//pSystem->setConfigOption("Video Mode", "1280 x 800 @ 32-bit colour");
	mRoot->setRenderSystem(pSystem);

	mRenderSystem = pSystem;

	mRoot->initialise(false);

	return true;
}
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: [UNSOLVED]Ogre 1.9 latest Material woes

Post by Transporter »

I've started a new thread with patches for various libraries: http://www.ogre3d.org/forums/viewtopic.php?f=4&t=78438
drwbns
Orc Shaman
Posts: 786
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: [UNSOLVED]Ogre 1.9 latest Material woes

Post by drwbns »

Ok I pushed another changeset to my paged-geometry repo, I've added Ogre version switches to fix all Ogre version compatibility (1.6+) , I'll patch to your thread when I verify everything is working as is should. Are all of your Ogre 1.9 projects working correctly?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: [UNSOLVED]Ogre 1.9 latest Material woes

Post by Transporter »

drwbns wrote:Ok I pushed another changeset to my paged-geometry repo, I've added Ogre version switches to fix all Ogre version compatibility (1.6+) , I'll patch to your thread when I verify everything is working as is should. Are all of your Ogre 1.9 projects working correctly?
I'm not finished with testing everything, because it takes a lot of time to patch cegui. But Ogitor is working fine.
Post Reply