compiling with azathoth

Problems building or running the engine, queries about how to use features etc.
Post Reply
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

compiling with azathoth

Post by paulr1984 »

Hi! I've just downloaded azathoth and tried to compile my project with it. My project works fine under 0.15.1. Compiling it with 1.0.0 gave me these errors:

Code: Select all

c:\ogre-1.0.0RC1\ogrenew\Samples\Toolset\OgreFramework\OgreFramework.cpp(54): error C2039: 'addCommonArchiveEx' : is not a member of 'Ogre::ResourceManager'
c:\ogre-1.0.0RC1\ogrenew\Samples\Toolset\OgreFramework\OgreFramework.cpp(54): error C3861: 'addCommonArchiveEx': identifier not found, even with argument-dependent lookup
c:\ogre-1.0.0RC1\ogrenew\Samples\Toolset\OgreFramework\OgreFramework.cpp(97): error C2039: 'setDefaultNumMipMaps' : is not a member of 'Ogre::TextureManager'
        c:\ogre-1.0.0RC1\ogrenew\OgreMain\include\OgreTextureManager.h(51) : see declaration of 'Ogre::TextureManager'
Here's my code

Code: Select all

void COgreFramework::InitOgre(HWND hwnd)
{
	mHwnd = hwnd;

	// Setup root object
	mRoot = new Root();    

	// Load resource paths from config file
	ConfigFile cf;
	cf.load("resources.cfg");

	// Go through all settings in the file
	ConfigFile::SettingsIterator i = cf.getSettingsIterator();

    std::string typeName, archName;
	while (i.hasMoreElements()) 
    {
		typeName = i.peekNextKey();
		archName = i.getNext();
		ResourceManager::addCommonArchiveEx( archName, typeName );
	}

	// Set render system to D3D9 (loop through available and find one with 3D9 in the name)
	RenderSystem *currentRenderSystem;
	RenderSystemList *rl = Root::getSingleton().getAvailableRenderers();
    std::string str;
	for (RenderSystemList::iterator it = rl->begin(); it != rl->end(); ++it) {
		currentRenderSystem = (*it);
		str = currentRenderSystem->getName().c_str();
        if (str.find("3D9") != std::string::npos) break;
	}
	
	Root::getSingleton().setRenderSystem(currentRenderSystem);
	RenderSystem *renderSystem = (RenderSystem *)mRoot->getRenderSystem();
	D3D9RenderSystem *d3D9RenderSystem = (D3D9RenderSystem *)mRoot->getRenderSystem();

	d3D9RenderSystem->initConfigOptions();
	renderSystem->setConfigOption("Full Screen", "No");
	renderSystem->setConfigOption("VSync", "No");
	renderSystem->setConfigOption("Anti aliasing", (const char *)"None");	
    renderSystem->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");

	// init the window
	d3D9RenderSystem->SetExternalWindowHandle(mHwnd);    
	mWindow = mRoot->initialise(true);

	// choose sm
	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);//ST_EXTERIOR_CLOSE);
	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

	// create camera
	mCamera = mSceneMgr->createCamera("MainCamera");            
    mCamera->setPosition( Vector3(CAMERA_X, CAMERA_Y, CAMERA_Z) );                       
	mCamera->lookAt( Vector3(CAMERA_X, 0, CAMERA_Z-1) );
    mCamera->setNearClipDistance(5);
    mCamera->setFixedYawAxis( false );

	// create viewport
	mViewPort = mWindow->addViewport(mCamera);
	mViewPort->setBackgroundColour(ColourValue(0.3, 0.3, 0.3));

	// set default mipmap level (NB some APIs ignore this)
	TextureManager::getSingleton().setDefaultNumMipMaps(5);

	// Create a light (in reality we'll have an AddLight method somewhere and saved lights)
	Light* l = mSceneMgr->createLight("MainLight");
	l->setPosition(50,50,50);

	// activate the window
	mWindow->setActive(true);

	// all done
	m_bIsOgreInit = true;

    TRACE( "ogre initialized\n" );
}
I guess these functions were removed in ogre-1.0.0. What should I replace them with? I've looked into the changelog of 1.0.0 and can't find anything there about this.
User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

I recently did this myself and the only 2 changes that I see are:

Code: Select all

ResourceManager::addCommonArchiveEx( archName, typeName );
TO

Code: Select all

Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, "general");
and outside that for loop:

Code: Select all

Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
and finally

Code: Select all

TextureManager::getSingleton().setDefaultNumMipMaps(5); 
TO

Code: Select all

TextureManager::getSingleton().setDefaultNumMipmaps(5); 
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

Thanks bana! It now compiles but I'm getting an assertion error when I run my application. The exception is not registered in the ogre log. But here's the stack trace:

Code: Select all

>	msvcr71d.dll!_assert(const char * expr=0x106eb6ec, const char * filename=0x106f19d0, unsigned int lineno=38)  Line 295	C
 	OgreMain_d.dll!Ogre::GpuProgramManager::getSingleton()  Line 38 + 0x24	C++
 	Plugin_CgProgramManager.dll!Ogre::CgProgram::isSupported()  Line 269 + 0x8	C++
 	OgreMain_d.dll!Ogre::MaterialSerializer::finishProgramDefinition()  Line 2348 + 0x21	C++
 	OgreMain_d.dll!Ogre::MaterialSerializer::parseScriptLine(std::basic_string<char,std::char_traits<char>,std::allocator<char> > & line={...})  Line 2228	C++
 	OgreMain_d.dll!Ogre::MaterialSerializer::parseScript(Ogre::SharedPtr<Ogre::DataStream> & stream={...}, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & groupName={...})  Line 2099 + 0xc	C++
 	OgreMain_d.dll!Ogre::MaterialManager::parseScript(Ogre::SharedPtr<Ogre::DataStream> & stream={...}, const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & groupName={...})  Line 110	C++
 	OgreMain_d.dll!Ogre::ResourceGroupManager::parseResourceGroupScripts(Ogre::ResourceGroupManager::ResourceGroup * grp=0x01067500)  Line 663 + 0x23	C++
 	OgreMain_d.dll!Ogre::ResourceGroupManager::initialiseAllResourceGroups()  Line 131	C++
 	Toolset.exe!COgreFramework::InitOgre(HWND__ * hwnd=0x00130336)  Line 69 + 0x19	C++

The failed assertion comes from line 38 of ogregpuprogrammanager.cpp

What am I doing wrong?
User avatar
johnhpus
Platinum Sponsor
Platinum Sponsor
Posts: 1186
Joined: Sat Apr 17, 2004 2:49 am
x 3

Post by johnhpus »

Shot in the dark, but does your video card support shaders? It could be that the sample your trying to run requires shaders and doesn't handle a lack of support gracefully.

Another weak guess ... Are you using anything from an older version of Ogre? Like the Media folder, config files or that sort of thing might be the problem if you have the wrong version.

But who knows =)
John
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

My video card is a mobility radeon 9000. I'm don't know if it supports shaders.

I removed a couple of resource paths in my resources.cfg. Most of the lines I removed were default in ogre-0.15.1. It now runs.

Another problem is azathoth. I'm developing an mfc application which displays ogre in a CView. It works fine in ogre-0.15.1. But in 1.0.0, it no longer displays itself in the CView. It creates another window. So, I end up having 2 separate windows instead of just one.

Here's the code with the revisions bana suggested:

Code: Select all

void COgreFramework::InitOgre(HWND hwnd)
{
	mHwnd = hwnd;

	// Setup root object
	mRoot = new Root();    

	// Load resource paths from config file
	ConfigFile cf;
	cf.load("resources.cfg");

	// Go through all settings in the file
	ConfigFile::SettingsIterator i = cf.getSettingsIterator();

    std::string typeName, archName;
	while (i.hasMoreElements()) 
    {
		typeName = i.peekNextKey();
		archName = i.getNext();
		//ResourceManager::addCommonArchiveEx( archName, typeName );
        Ogre::ResourceGroupManager::getSingleton().addResourceLocation(archName, typeName, "general"); //added
	}
    

	// Set render system to D3D9 (loop through available and find one with 3D9 in the name)
	RenderSystem *currentRenderSystem;
	RenderSystemList *rl = Root::getSingleton().getAvailableRenderers();
    std::string str;
	for (RenderSystemList::iterator it = rl->begin(); it != rl->end(); ++it) {
		currentRenderSystem = (*it);
		str = currentRenderSystem->getName().c_str();
        if (str.find("3D9") != std::string::npos) break;
	}

    Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); //added
	
	Root::getSingleton().setRenderSystem(currentRenderSystem);
	RenderSystem *renderSystem = (RenderSystem *)mRoot->getRenderSystem();
	D3D9RenderSystem *d3D9RenderSystem = (D3D9RenderSystem *)mRoot->getRenderSystem();

	d3D9RenderSystem->initConfigOptions();
	renderSystem->setConfigOption("Full Screen", "No");
	renderSystem->setConfigOption("VSync", "No");
	renderSystem->setConfigOption("Anti aliasing", (const char *)"None");	
    renderSystem->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");

	// init the window
	d3D9RenderSystem->SetExternalWindowHandle(mHwnd);    
	mWindow = mRoot->initialise(true);

	// choose sm
	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);//ST_EXTERIOR_CLOSE);
	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

	// create camera
	mCamera = mSceneMgr->createCamera("MainCamera");            
    mCamera->setPosition( Vector3(CAMERA_X, CAMERA_Y, CAMERA_Z) );                       
	mCamera->lookAt( Vector3(CAMERA_X, 0, CAMERA_Z-1) );
    mCamera->setNearClipDistance(5);
    mCamera->setFixedYawAxis( false );

	// create viewport
	mViewPort = mWindow->addViewport(mCamera);
	mViewPort->setBackgroundColour(ColourValue(0.3, 0.3, 0.3));

	// set default mipmap level (NB some APIs ignore this)
	//TextureManager::getSingleton().setDefaultNumMipMaps(5);
    TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Create a light (in reality we'll have an AddLight method somewhere and saved lights)
	Light* l = mSceneMgr->createLight("MainLight");
	l->setPosition(50,50,50);

	// activate the window
	mWindow->setActive(true);

	// all done
	m_bIsOgreInit = true;

    TRACE( "ogre initialized\n" );
}
Did you change something in setExternalWindowHandle() in azathoth?

Another question, can azathoth handle multiple windows? I mean, if I want to render ogre in multiple separate windows, can it do that? I've read something about swapchains before. Do I need to use those? I know its direct3d stuff and seems very complicated. Sinbad was talking about making a platform neutral code for this functionality.
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Please read the porting notes, this describes what happened to external window handle:

http://ogrewiki.digitalsentience.com/in ... em_Changes
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

i updated my InitOgre method and changed the part where I set the external window:

NameValuePairList misc;
misc["externalWindowHandle"] = StringConverter::toString( (size_t)mHwnd);
d3D9RenderSystem->createRenderWindow( "My sub render window", 300, 300, false, &misc );


Now I'm getting a new error on runtime. Here's the stack trace:

Code: Select all

>	RenderSystem_Direct3D9.dll!Ogre::D3D9Driver::getD3D()  Line 65 + 0x26	C++
 	RenderSystem_Direct3D9.dll!Ogre::D3D9RenderWindow::createD3DResources()  Line 348 + 0xe	C++
 	RenderSystem_Direct3D9.dll!Ogre::D3D9RenderWindow::create(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name={...}, unsigned int width=300, unsigned int height=300, bool fullScreen=false, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > * miscParams=0x0012f2f8)  Line 334	C++
 	RenderSystem_Direct3D9.dll!Ogre::D3D9RenderSystem::createRenderWindow(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & name={...}, unsigned int width=300, unsigned int height=300, bool fullScreen=false, const std::map<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,std::basic_string<char,std::char_traits<char>,std::allocator<char> > > > > * miscParams=0x0012f2f8)  Line 615 + 0x2a	C++
 	Toolset.exe!COgreFramework::InitOgre(HWND__ * hwnd=0x000403f8)  Line 86 + 0x4b	C++
 	Toolset.exe!COgreView::OnDraw(CDC * pDC=0x0012f510)  Line 71 + 0x20	C++
The error apparently occurs in ogred3d9driver.h. It points to the first line of this block:

LPDIRECT3D9 getD3D() { return mpD3D; }
unsigned int getAdapterNumber() const { return mAdapterNumber; }
D3DADAPTER_IDENTIFIER9 getAdapterIdentifier() const { return mAdapterIdentifier; }
D3DDISPLAYMODE getDesktopMode() const { return mDesktopDisplayMode; }

D3D9VideoModeList* getVideoModeList();


The exception is not registered in ogre.log. But here's what it prints so far:

13:38:52: Finished parsing scripts for resource group general
13:38:52: D3D9 : RenderSystem Option: Full Screen = No
13:38:52: D3D9 : RenderSystem Option: VSync = No
13:38:52: D3D9 : RenderSystem Option: Anti aliasing = None
13:38:52: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
13:38:52: D3D9RenderSystem::createRenderWindow "My sub render window", 300x300 windowed miscParams: externalWindowHandle=263160
13:38:52: D3D9 : Created D3D9 Rendering Window 'My sub render window' : 642x501, 32bpp


Any word on the swapchain issue?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

You did call mRoot->initialise(false); right? (to initialise ogre without creating a window) before the call to createWindow?
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

oh. I was calling mRoot->initialise( false ) after I called createWindow. Now, I'm calling it before createWindow. Here's part of my code:

Code: Select all

...
	d3D9RenderSystem->initConfigOptions();
	renderSystem->setConfigOption("Full Screen", "No");
	renderSystem->setConfigOption("VSync", "No");
	renderSystem->setConfigOption("Anti aliasing", (const char *)"None");	
    renderSystem->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");

	// init the window
    mRoot->initialise(false);

    NameValuePairList misc;
    misc["externalWindowHandle"] = StringConverter::toString( (size_t)mHwnd);
    mWindow = d3D9RenderSystem->createRenderWindow( "My sub render window", 300, 300, false, &misc );

	// choose sm
	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));
...

Now, I'm getting a failed assertion everytime I call the RenderWindow->update(). Here's the error message:

index < mTechniques.size() && "Index out of bounds"

Here's the stack trace

Code: Select all

>	msvcr71d.dll!_assert(const char * expr=0x106f382c, const char * filename=0x106f37c0, unsigned int lineno=218)  Line 295	C
 	OgreMain_d.dll!Ogre::Material::getTechnique(unsigned short index=0)  Line 218 + 0x3b	C++
 	OgreMain_d.dll!Ogre::SceneManager::initShadowVolumeMaterials()  Line 2850 + 0x13	C++
 	OgreMain_d.dll!Ogre::SceneManager::_renderScene(Ogre::Camera * camera=0x010b9a98, Ogre::Viewport * vp=0x010b8b08, bool includeOverlays=true)  Line 778 + 0xd	C++
 	OgreMain_d.dll!Ogre::Camera::_renderScene(Ogre::Viewport * vp=0x010b8b08, bool includeOverlays=true)  Line 390 + 0x2a	C++
 	OgreMain_d.dll!Ogre::Viewport::update()  Line 187	C++
 	OgreMain_d.dll!Ogre::RenderTarget::update()  Line 108	C++
 	OgreMain_d.dll!Ogre::RenderWindow::update()  Line 62	C++
 	RenderSystem_Direct3D9.dll!Ogre::D3D9RenderWindow::update()  Line 776 + 0xb	C++
 	Toolset.exe!COgreFramework::UpdateOgreView()  Line 129 + 0x15	C++
 	Toolset.exe!COgreView::OnDraw(CDC * pDC=0x00110ff4)  Line 67	C++
THanks for replying! I really appreciate your help. Ogre is still quite a mystery for me.
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

ok, I've tried to debug it myself. I realized that the line:
ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

was giving me a failed assertion error. The error is not logged in ogre.log. The visual studio debugger points to line 218 of ogrematerial.cpp. The error message was:

Expression: index < mTechniques.size() && "Index out of bounds." what can be the cause to this failed assertion?

Here's the stack trace:

Code: Select all

 	msvcr71d.dll!_assert(const char * expr=0x106f382c, const char * filename=0x106f37c0, unsigned int lineno=218)  Line 295	C
>	OgreMain_d.dll!Ogre::Material::getTechnique(unsigned short index=0)  Line 218 + 0x3b	C++
 	OgreMain_d.dll!Ogre::SceneManager::initShadowVolumeMaterials()  Line 2821 + 0x13	C++
 	OgreMain_d.dll!Ogre::SceneManager::_renderScene(Ogre::Camera * camera=0x010e9970, Ogre::Viewport * vp=0x010ea390, bool includeOverlays=true)  Line 778 + 0xd	C++
 	OgreMain_d.dll!Ogre::Camera::_renderScene(Ogre::Viewport * vp=0x010ea390, bool includeOverlays=true)  Line 390 + 0x2a	C++
 	OgreMain_d.dll!Ogre::Viewport::update()  Line 187	C++
 	OgreMain_d.dll!Ogre::RenderTarget::update()  Line 108	C++
 	OgreMain_d.dll!Ogre::RenderWindow::update()  Line 62	C++
 	RenderSystem_Direct3D9.dll!Ogre::D3D9RenderWindow::update()  Line 776 + 0xb	C++
 	Toolset.exe!COgreFramework::UpdateOgreView()  Line 136 + 0x15	C++
 	Toolset.exe!COgreView::OnDraw(CDC * pDC=0x0012c1bc)  Line 67	C++



Here's the code for my function:

Code: Select all

void COgreFramework::InitOgre(HWND hwnd)
{
	mHwnd = hwnd;

	// Setup root object
	mRoot = new Root();    

	// Load resource paths from config file
	ConfigFile cf;
	cf.load("resources.cfg");
    
    ConfigFile::SectionIterator seci = cf.getSectionIterator();

    String secName, typeName, archName;
    while (seci.hasMoreElements())
    {
        secName = seci.peekNextKey();
        ConfigFile::SettingsMultiMap *settings = seci.getNext();
        ConfigFile::SettingsMultiMap::iterator i;
        for (i = settings->begin(); i != settings->end(); ++i)
        {
            typeName = i->first;
            archName = i->second;
            ResourceGroupManager::getSingleton().addResourceLocation(
                archName, typeName, secName);
        }
    }

    

	// Set render system to D3D9 (loop through available and find one with 3D9 in the name)
	RenderSystem *currentRenderSystem;
	RenderSystemList *rl = Root::getSingleton().getAvailableRenderers();
    std::string str;
	for (RenderSystemList::iterator it = rl->begin(); it != rl->end(); ++it) {
		currentRenderSystem = (*it);
		str = currentRenderSystem->getName().c_str();
        if (str.find("3D9") != std::string::npos) break;
	}

    //Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups(); //added
	
	Root::getSingleton().setRenderSystem(currentRenderSystem);
	RenderSystem *renderSystem = (RenderSystem *)mRoot->getRenderSystem();
	D3D9RenderSystem *d3D9RenderSystem = (D3D9RenderSystem *)mRoot->getRenderSystem();

	d3D9RenderSystem->initConfigOptions();
	renderSystem->setConfigOption("Full Screen", "No");
	renderSystem->setConfigOption("VSync", "No");
	renderSystem->setConfigOption("Anti aliasing", (const char *)"None");	
    renderSystem->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");

	// init the window
    mRoot->initialise(false);

    NameValuePairList misc;
    misc["externalWindowHandle"] = StringConverter::toString( (size_t)mHwnd);
    mWindow = d3D9RenderSystem->createRenderWindow( "My sub render window", 300, 300, false, &misc );

	// choose sm
	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
	mSceneMgr->setAmbientLight(ColourValue(0.5, 0.5, 0.5));

	// create camera
	mCamera = mSceneMgr->createCamera("MainCamera");            
    mCamera->setPosition( Vector3(CAMERA_X, CAMERA_Y, CAMERA_Z) );                       
	mCamera->lookAt( Vector3(CAMERA_X, 0, CAMERA_Z-1) );
    mCamera->setNearClipDistance(5);
    mCamera->setFixedYawAxis( false );

	// create viewport
	mViewPort = mWindow->addViewport(mCamera);
	mViewPort->setBackgroundColour(ColourValue(0.3, 0.3, 0.3));

	// set default mipmap level (NB some APIs ignore this)
    TextureManager::getSingleton().setDefaultNumMipmaps(5);

	// Create a light (in reality we'll have an AddLight method somewhere and saved lights)
	Light* l = mSceneMgr->createLight("MainLight");
	l->setPosition(50,50,50);

	// activate the window
	mWindow->setActive(true);

	// all done
	m_bIsOgreInit = true;

    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    TRACE( "ogre initialized\n" );
}
I placed breakpoints in the last two lines. The failed assertion arises after executing the 2nd to the last line.

Again, I'm using ogre-1.0.0 with visual studio .net 2003.
_lkoikm
Halfling
Posts: 57
Joined: Fri Feb 11, 2005 7:52 am
Location: Here.

Post by _lkoikm »

I got exacly the same problem
but

Code: Select all

MaterialManager::getSingleton().initialise();
did the thing..
still got another problemo....
everything is helly gray....
see the img , and question what is happening(in 0.15.2 everything was fine...)Image
_lkoikm
Halfling
Posts: 57
Joined: Fri Feb 11, 2005 7:52 am
Location: Here.

Post by _lkoikm »

ok i solved it , just put

Code: Select all

ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
or mates just after initializing the window...
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

_lkoikm, what do you mean by 'just after initializing the window'? Is it after I do a:

mWindow = d3D9RenderSystem->createRenderWindow( "My sub render window", 300, 300, false, &misc );

or

mRoot->initialise(false);


putting initialiseAllResourceGroups() right after I create mWindows still gives me the same error.

Although, putting it right after I initialise mRoot gives me a different error:
stack trace:

Code: Select all

>	OgreMain_d.dll!Ogre::TextureUnitState::getColourBlendFallbackDest()  Line 491 + 0x3	C++
 	OgreMain_d.dll!Ogre::Pass::_split(unsigned short numUnits=0)  Line 588 + 0xf	C++
 	OgreMain_d.dll!Ogre::Technique::_compile(bool autoManageTextureUnits=true)  Line 122 + 0xd	C++
 	OgreMain_d.dll!Ogre::Material::compile(bool autoManageTextureUnits=true)  Line 318	C++
 	OgreMain_d.dll!Ogre::Material::loadImpl()  Line 118	C++
 	OgreMain_d.dll!Ogre::Resource::load()  Line 70 + 0xd	C++
 	OgreMain_d.dll!Ogre::OverlayElement::setMaterialName(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & matName={...})  Line 317 + 0x24	C++

But I'm guessing that putting it right after initialising root is wrong. It is straying farther from the problem. Any more ideas? _lkoikm, can you post that part of your code which does the initialisation?
Brun°oO
Halfling
Posts: 50
Joined: Thu Nov 13, 2003 12:50 pm
Location: Bordeaux, France
Contact:

Post by Brun°oO »

@paulr1984
As you, i've got the same problem when i converted my 0.15 code into 1.0.
try this :

Code: Select all

...
d3D9RenderSystem->initConfigOptions();
renderSystem->setConfigOption("Full Screen", "No");
renderSystem->setConfigOption("VSync", "No");
renderSystem->setConfigOption("Anti aliasing", (const char *)"None");   
renderSystem->setConfigOption("Video Mode", "800 x 600 @ 32-bit colour");

// init the window
mRoot->initialise(false); 
NameValuePairList misc;
misc["externalWindowHandle"] = StringConverter::toString( (size_t)mHwnd );
mWindow  = Root::getSingleton().createRenderWindow("My sub render window", 800, 600, false, &misc );
mWindow->setActive(true)
...
I think it's very important to call "createRenderWindow" from "Root" than from "RenderSystem" because the root calling performs other initialization s like MaterialManager, ParticleManager and MeshManager calling (through the "oneTimePostWindowInit" calling).
So you don't have to call MaterialManager::getSingleton().initialise(); before since Root::createRenderWindow method do it for you (in a better way).

I hope this can help you...
I still have a problem in my code : textures are not loaded in 1.0 (all is black or white...) i'm going to track this regression, perhaps an other manager is not initialized :?
El °oO Masqué
Brun°oO
Halfling
Posts: 50
Joined: Thu Nov 13, 2003 12:50 pm
Location: Bordeaux, France
Contact:

Post by Brun°oO »

Ok... I found my last problem (texture, color...see my previous post) and now it works fine !
In fact, I forgot to copy a material script from 0.15 to 1.00 media folder :oops:
El °oO Masqué
paulr1984
Halfling
Posts: 58
Joined: Thu Aug 19, 2004 10:09 am

Post by paulr1984 »

thanks so much brunoO. It worked!
Post Reply