Loading / Progress bar

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
Alexis
Halfling
Posts: 59
Joined: Fri Jul 22, 2005 3:35 pm
Location: Ukraine
x 1

Loading / Progress bar

Post by Alexis »

I want to insert loading bar to my game. I have searched the forum and found very few information on this topic.
One topic is by jacmoe: here. But I can not compile it.
And another is by katoun here. He mentioned
the Loading Bar example from the Demos
but I have never seen it.

So, can anybody suggest me a way to provide my game with Loading bar?
Last edited by Alexis on Tue Nov 08, 2005 3:30 pm, edited 1 time in total.
Gemberkoekje
Gnoblar
Posts: 8
Joined: Tue Nov 08, 2005 11:28 am

Post by Gemberkoekje »

hmm i guess you need to split up the loading of your program (check what it's doing, loading meshes, graphics, sounds etc...) and align your loading bar (a simple rectanglic graphic or something bigger) to show the progress (if the same order: Meshes = 33%, Graphics = 66%, Sounds = 100%)
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 7
Contact:

Post by haffax »

Alexis, the BspDemo shows how to implement a loading bar using Ogre. You basically register a ResourceListener, that gets called back, whenever a resource has been loaded. See the Bsp demos that come with Ogre.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
Alexis
Halfling
Posts: 59
Joined: Fri Jul 22, 2005 3:35 pm
Location: Ukraine
x 1

Post by Alexis »

Thanx,haffax. This one of those demos I could not compile.[EDIT] Sorry, actualy I can compile it, but can not run because of absence of pak0.pk3 file[/EDIT] Maybe therefore I had not noticed loading bar :(
Anyway, can anybody suggest me where can I get
pak0.pk3 file? Maybe I can download it somewhere?
Last edited by Alexis on Thu Nov 10, 2005 10:23 am, edited 1 time in total.
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

You could use any of quake3 maps, I guess.
Anyway this file is located in one of Media folders.

Please, let me know if you'll manage to implement the loading bar in your own application. Just curious, cause I had some problems with this :)
WhiteKnight
Halfling
Posts: 88
Joined: Sat Sep 24, 2005 6:45 pm
Location: South Africa

Post by WhiteKnight »

celic wrote:You could use any of quake3 maps, I guess.
Anyway this file is located in one of Media folders.
No you need Quake 3 to run the BSP Demo, which rules out people like me :(. I guess it would work with the Quake 3 demo though.
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

No you need Quake 3 to run the BSP Demo, which rules out people like me. I guess it would work with the Quake 3 demo though.
Sorry, but I don't really understand what you mean :?
Lodes
Google Summer of Code Student
Google Summer of Code Student
Posts: 228
Joined: Mon Mar 17, 2003 12:02 am
Location: San Jose, CA, USA

Post by Lodes »

download the precompiled demos to get the media for the demo to run.

Or just get a quake 3 map from somewhere on the web :)
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

i thought he said he had trouble compiling it, not running it??
Go Go Gadget OGRE!!
Image
User avatar
Alexis
Halfling
Posts: 59
Joined: Fri Jul 22, 2005 3:35 pm
Location: Ukraine
x 1

Post by Alexis »

celic wrote: Please, let me know if you'll manage to implement the loading bar in your own application. Just curious, cause I had some problems with this :)
It was realy simple. The main feature was to believe that it can work! :wink:
So, what you need to insert progress bar into your application?
1. Copy ExampleLoadingBar class from BSP_demo to your app.
2. add member to your heir from ExampleApplication

Code: Select all

ExampleLoadingBar mLoadingBar;
3. Override function in that app.h

Code: Select all

virtual void loadResources(void);       //!< loading of resources
4. implement that function in app.cpp like this

Code: Select all

void CSeaBedApp::loadResources(void)
{
    m_loading_bar->start(mWindow, 1, 1, 0.75);
    
    // Initialise, parse scripts etc
    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    
    m_loading_bar->finish();
}
And you'll obtain a picture like this:
Image
Enjoy :D
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

Thanks a lot Alexis! :D
I made almost the same excepting to declare the loadResources as virtual
:oops:
I hope it will work now :lol:
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

It doesn't work for me :(
I'm using the State Manager, could it be caused by it?
Tzyr
Gnoblar
Posts: 23
Joined: Fri Nov 11, 2005 4:17 pm

Post by Tzyr »

celic wrote:It doesn't work for me :(
I'm using the State Manager, could it be caused by it?
No, I was able to get it to run with state manager fine.

I put the code in the GameManager class, for that is how you initiate the game.

Just remember, you need to create a SceneManager object, along with a viewport and camera. Just put the ExampleLoadingBar.start(...) and finish() before and after you initiate your resources.
"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

Tzyr, could you share your code, cause I do something wrong, don't know where is the problem. :?
Thanks!
Tzyr
Gnoblar
Posts: 23
Joined: Fri Nov 11, 2005 4:17 pm

Post by Tzyr »

celic wrote:Tzyr, could you share your code, cause I do something wrong, don't know where is the problem. :?
Thanks!
sure...here it is

Code: Select all

// GameManager.cpp

#ifndef GameManager_H
#define GameManager_H

#include <vector>
#include <Ogre.h>
#include <OgreEventListeners.h>
#include <OgreSingleton.h>

#include "InputManager.h"

class GameState;

class GameManager : public Ogre::FrameListener, public Ogre::KeyListener, public Ogre::Singleton<GameManager> {
	
	public:
		GameManager();
		~GameManager();

		void start(GameState* state);
		void changeState(GameState* state);
		void pushState(GameState* state);
		void popState();

		static GameManager& getSingleton(void);
		static GameManager* getSingletonPtr(void);
		Ogre::RenderWindow *getWindow();

	protected:
		Ogre::Root* mRoot;
		Ogre::RenderWindow* mRenderWindow;
		Ogre::SceneManager* mSceneMgr;
		Ogre::Viewport* mViewport;
		Ogre::Camera* mCamera;
		
		InputManager* mInputManager;

		void setupResources(void);
		bool configure(void);

		void keyClicked(Ogre::KeyEvent* e);
		void keyPressed(Ogre::KeyEvent* e);
		void keyReleased(Ogre::KeyEvent* e);

		bool frameStarted(const Ogre::FrameEvent& evt);
		bool frameEnded(const Ogre::FrameEvent& evt);

	private:
		bool mExitGame;

		std::vector<GameState*> mStates;
};

#endif

Code: Select all

// GameManager.cpp

#include <Ogre.h>
#include <OgreConfigFile.h>
#include <OgreKeyEvent.h>

#include "GameManager.h"
#include "InputManager.h"
#include "GameState.h"

using namespace Ogre;

template<> GameManager* Singleton<GameManager>::ms_Singleton = 0;

GameManager::GameManager() {
	mRoot = 0;
	mInputManager = 0;
}

GameManager::~GameManager() {
	// clean up all the states
	while(!mStates.empty()) {
		mStates.back()->exit();
		mStates.pop_back();
	}

	if (mInputManager)
		delete mInputManager;

	if (mRoot)
		delete mRoot;
}

void GameManager::start(GameState* state) {
	mRoot = new Root();

	setupResources();

	if (!configure()) return;

	mRoot->addFrameListener(this);

	mInputManager = new InputManager(mRoot->getAutoCreatedWindow());
	mInputManager->getEventProcessor()->addKeyListener(this);
	
	// set the initial flag before entering IntroState
	changeState(state);

	mRoot->startRendering();
}

void GameManager::changeState(GameState* state) {
	// cleanup the current state
	if (!mStates.empty()) {
		mStates.back()->exit();
		mStates.pop_back();
	}

	// store and init the new state
	mStates.push_back(state);
	mStates.back()->enter();
}

void GameManager::pushState(GameState* state) {
	// pause current state
	if (!mStates.empty()) {
		mStates.back()->pause();
	}

	// store and init the new state
	mStates.push_back(state);
	mStates.back()->enter();
}

void GameManager::popState() {
	// cleanup the current state
	if (!mStates.empty()) {
		mStates.back()->exit();
		mStates.pop_back();
	}

	// resume previous state
	if (!mStates.empty()) {
		mStates.back()->resume();
	}
}

void GameManager::setupResources(void) {
        // Load resource paths from config file
        ConfigFile cf;
        cf.load("resources.cfg");

        // Go through all sections & settings in the file
        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);
            }
        }
}

bool GameManager::configure(void) {
	// load config settings from ogre.cfg
	if (!mRoot->restoreConfig()) {
		// if there is no config file, show the configuration dialog
		if (!mRoot->showConfigDialog()) {
			return false;
		}
	}

	// initialise and create a default rendering window
	mRenderWindow = mRoot->initialise(true);

	return true;
}

void GameManager::keyClicked(KeyEvent* e) {
	// call keyClicked of current state
	mStates.back()->keyClicked(e);
}

void GameManager::keyPressed(KeyEvent* e) {
	// call keyPressed of current state
	mStates.back()->keyPressed(e);
}

void GameManager::keyReleased(KeyEvent* e) {
	// call keyReleased of current state
	mStates.back()->keyReleased(e);
}

bool GameManager::frameStarted(const FrameEvent& evt) {
	// call frameStarted of current state
	return mStates.back()->frameStarted(evt);
}

bool GameManager::frameEnded(const FrameEvent& evt) {
	if (mExitGame)
		return false;
	// call frameEnded of current state
	return mStates.back()->frameEnded(evt);
}

GameManager* GameManager::getSingletonPtr(void) {
	return ms_Singleton;
}

GameManager& GameManager::getSingleton(void) {
	assert(ms_Singleton);
	return *ms_Singleton;
}

Ogre::RenderWindow* GameManager::getWindow(void) {
	return mRenderWindow;
}

Code: Select all

// GameState.h
#ifndef GameState_H
#define GameState_H

#include <Ogre.h>

#include "GameManager.h"

class GameState {
	public:
		virtual void enter() = 0;
		virtual void exit() = 0;

		virtual void pause() = 0;
		virtual void resume() = 0;

		virtual void keyClicked(Ogre::KeyEvent* e) = 0;
		virtual void keyPressed(Ogre::KeyEvent* e) = 0;
		virtual void keyReleased(Ogre::KeyEvent* e) = 0;

		virtual bool frameStarted(const Ogre::FrameEvent& evt) = 0;
		virtual bool frameEnded(const Ogre::FrameEvent& evt) = 0;

		void changeState(GameState* state) { GameManager::getSingletonPtr()->changeState(state); }
		void pushState(GameState* state) { GameManager::getSingletonPtr()->pushState(state); }
		void popState() { GameManager::getSingletonPtr()->popState(); }

	Ogre::RenderWindow *getWindow() { return GameManager::getSingletonPtr()->getWindow(); }

	protected:
		GameState() { }

};

#endif

Code: Select all

// IntroState.h

#ifndef IntroState_H
#define IntroState_H

#include <Ogre.h>

#include "GameState.h"
#include "ExampleLoadingBar.h"


class IntroState : public GameState {
	public:
		void enter();
		void exit();

		void pause();
		void resume();

		void keyClicked(Ogre::KeyEvent* e);
		void keyPressed(Ogre::KeyEvent* e);
		void keyReleased(Ogre::KeyEvent* e);

		bool frameStarted(const Ogre::FrameEvent& evt);
		bool frameEnded(const Ogre::FrameEvent& evt);

		static IntroState* getInstance() { return &mIntroState; }
	protected:
		IntroState() { }

		Ogre::RenderWindow *mWindow;
		Ogre::Root *mRoot;
		Ogre::SceneManager* mSceneMgr;
		Ogre::Viewport* mViewport;
		Ogre::InputReader* mInputDevice;
		Ogre::Camera* mCamera;

		ExampleLoadingBar mLoadingBar;

		bool mExitGame;
	private:
		static IntroState mIntroState;
};

#endif

Code: Select all

// IntroState.cpp

#include <Ogre.h>
#include <OgreKeyEvent.h>

#include "IntroState.h"
// #include "PlayState.h"  <-- just continue with your playstates

using namespace Ogre;

IntroState IntroState::mIntroState;

void IntroState::enter() {
	mInputDevice = InputManager::getSingletonPtr()->getInputDevice();
	mRoot = Root::getSingletonPtr();

	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
	mCamera = mSceneMgr->createCamera("IntroCamera");
	mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera);
	mViewport->setBackgroundColour(ColourValue(0.0, 0.0, 0.0));

	// parse resources, displaying progress to screen
	mLoadingBar.start(getWindow(), 1, 1, 1.0);

		// Turn off rendering of everything except overlays
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);

		ResourceGroupManager::getSingleton().initialiseResourceGroup("General");

		// Back to full rendering
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);

	mLoadingBar.finish();


	mExitGame = false;                                              
}

void IntroState::exit() {
	mSceneMgr->clearScene();
	mSceneMgr->removeAllCameras();
	mRoot->getAutoCreatedWindow()->removeAllViewports();
}

void IntroState::pause() {}

void IntroState::resume() {}

void IntroState::keyClicked(KeyEvent* e) {}

void IntroState::keyPressed(KeyEvent* e) {
	if (e->getKey() == KC_RETURN) {
//		changeState(PlayState::getInstance());
	}

	if (e->getKey() == KC_ESCAPE) {
		mExitGame = true;
	}
	e->consume();
}

void IntroState::keyReleased(KeyEvent* e) {}

bool IntroState::frameStarted(const FrameEvent& evt) {
	return true;
}

bool IntroState::frameEnded(const FrameEvent& evt) {
	if (mExitGame)
		return false;

	return true;
}

InputManager.h and InputManager.cpp have not changed, and neither has ExampleLoadingBar.h


If you note, the only real change that I made was, remove :

ResourceGroupManager::getSingleton().initialiseResourceGroup("General");

from GameManager::Configure

and in the IntroState::start() that is where you start the loading bar (After you create the camera, and mSceneMgr), and that is where you add the resources.

Note, I took out most of my code, cause well, you would not be able to compile/run it unless I included all the material files. If you have any questions, or if this does not work, post the error and I will see if I copied/wrote something wrong.

You will however have to get the RendeerWindow from GameManager, which is what I have also added. It's cheating...but I would prefer loading the resources in Intro, then GameManager (note, you can do this all within gameManager if you want...which might have been easier to show..heh oh well)
"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
Tzyr
Gnoblar
Posts: 23
Joined: Fri Nov 11, 2005 4:17 pm

Post by Tzyr »

First off, that was suppose to be RenderWindow...heh
Tzyr wrote:Just remember, you need to create a SceneManager object, along with a viewport and camera. Just put the ExampleLoadingBar.start(...) and finish() before and after you initiate your resources.
About what I wrote before...I had originally put the loading screen within GameManager::start()...it worked ok, but there is more benifit for me having the loading of resources within IntroState.

This is what I had before:

Code: Select all

// GameManager.cpp

void GameManager::start(GameState* state) {
	mRoot = new Root();


	setupResources();

	if (!configure()) return;

	mRoot->addFrameListener(this);

	mInputManager = new InputManager(mRoot->getAutoCreatedWindow());
	mInputManager->getEventProcessor()->addKeyListener(this);

	mSceneMgr = mRoot->getSceneManager(ST_GENERIC);
	mCamera = mSceneMgr->createCamera("IntroCamera");
	mViewport = mRoot->getAutoCreatedWindow()->addViewport(mCamera);
	mViewport->setBackgroundColour(ColourValue(0.0, 0.0, 0.0));

	// parse resources, displaying progress to screen
	mLoadingBar.start(mRenderWindow, 1, 1, 1.0);

		// Turn off rendering of everything except overlays
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY);
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE);

		ResourceGroupManager::getSingleton().initialiseResourceGroup("General");

		// Back to full rendering
		mSceneMgr->clearSpecialCaseRenderQueues();
		mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE);

	mLoadingBar.finish();

	// unload before entering IntroState
	mSceneMgr->clearScene();
	mSceneMgr->removeAllCameras();
	mRoot->getAutoCreatedWindow()->removeAllViewports();

	changeState(state);

	mRoot->startRendering();
}

bool GameManager::configure(void) {
	// load config settings from ogre.cfg
	if (!mRoot->restoreConfig()) {
		// if there is no config file, show the configuration dialog
		if (!mRoot->showConfigDialog()) {
			return false;
		}
	}

	// initialise and create a default rendering window
	mRenderWindow = mRoot->initialise(true);

	return true;
}

"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

Thanks a lot, Tzyr!!! :D

I'll try this today and hope finally it will work :)
anyway I guess I found my mistake, because the rest of the code seems be almost the same as your.
If you note, the only real change that I made was, remove :
ResourceGroupManager::getSingleton().initialiseResourceGroup("General");
Here I think was the weak point of the code.. don't know..
I'll report tomorrow if I succeeded, Thanks! :D
M&M
Kobold
Posts: 25
Joined: Thu Feb 24, 2005 9:12 pm
Location: Egypt
Contact:

Post by M&M »

I am using the ExampleLoadingBar approach, but i made my own class out of it and modified it abit. It now works pretty well, but there is another loading bar in CEGUI's code. I haven't tried it yet though but you might want to check it out if you've already implemented CEGUI or planning to.

tyzr, you could add this

Code: Select all

      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE); 
to the start() function in loading bar

and this

Code: Select all

      // Back to full rendering 
      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
to the finish(), you just need to get a pointer to mSceneMgr on the other class :)
Image
Tzyr
Gnoblar
Posts: 23
Joined: Fri Nov 11, 2005 4:17 pm

Post by Tzyr »

M&M wrote:I am using the ExampleLoadingBar approach, but i made my own class out of it and modified it abit. It now works pretty well, but there is another loading bar in CEGUI's code. I haven't tried it yet though but you might want to check it out if you've already implemented CEGUI or planning to.
Really eh? I am just starting to use CEGUI. I did not like it at first, but once you figure some things out, it's pretty nice. I still think the mouse moves a little slow though. But since it's just for menues in the game I'm working on, no problems yet.

Will have to look at it though. The one thing that I am trying to figure out, is if you have the resources already parsed, how to make the bar progress (or say it's finished). Cause it just does not seem to show the progress of loading, only parsing.

What I mean by that, I initiate everything needed, and load the objects when I enter IntroState (like the menu). When I exit, I unload. If I re-enter the IntroState (so leave PlayState), I reload everything. Because everything is parsed already, the progress bar does not move (cause it is done pretty much). I know I could destroy/clear that group..but I dun see a reason to, other then unloading.

Is there a reason why you would want to destroy/clear a group after you leave if you know you will/might load it again?

M&M wrote:tyzr, you could add this

Code: Select all

      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->addSpecialCaseRenderQueue(RENDER_QUEUE_OVERLAY); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_INCLUDE); 
to the start() function in loading bar

and this

Code: Select all

      // Back to full rendering 
      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
to the finish(), you just need to get a pointer to mSceneMgr on the other class :)
hmm..interesting. Will have to look in on it. Cause yeah, would be nicer.
"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
Rackle
Gnome
Posts: 375
Joined: Sat Jul 16, 2005 1:42 am
Location: Montreal

Post by Rackle »

>> I still think the mouse moves a little slow though.

You can fudge the values sent to CEGUI to make the mouse move a little faster or slower. Here's my code using the OIS input system:

bool mouseMoved( const OIS::MouseEvent &arg )
{
CEGUI::System::getSingleton().injectMouseMove( arg.state.relX * 1.75, arg.state.relY * 1.75);
return true;
}

Multiplying the relative motion values by 1.75 makes the CEGUI mouse move closer to what I'm used to in Windows. This value should be user-configurable rather than hard-coded; a sort of mini-control panel where users can specify the mouse "sensitivity" as it is commonly called within games.
Tzyr
Gnoblar
Posts: 23
Joined: Fri Nov 11, 2005 4:17 pm

Post by Tzyr »

thanks Rackle, works well :)
"And then one day you find ten years have got behind you
No one told you when to run, you missed the starting gun"
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

Finally it works now! :D

the problems was indeed with this line:

Code: Select all

ResourceGroupManager::getSingleton().initialiseResourceGroup("General");
After I removed it, all works fine.

Thanks Tzyr!! 8)
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

I have another problem related to the loading bar, so I'll continue in this thread..

After I added the loading bar code, there are no more shadows in the scene and the billboards became jagged. Sorry, but I have no possibility to attach a screenshot now.. :(

Does somebody know why this happens?
M&M
Kobold
Posts: 25
Joined: Thu Feb 24, 2005 9:12 pm
Location: Egypt
Contact:

Post by M&M »

Will have to look at it though. The one thing that I am trying to figure out, is if you have the resources already parsed, how to make the bar progress (or say it's finished). Cause it just does not seem to show the progress of loading, only parsing.
yeah, i had that problem too. The ExampleLoading bar class isn't complete, there are several missing functions and code to handle updating the bar.
In the example loading bar class you've got several functions with empty initialisations like

Code: Select all

void resourceLoadEnded(void)
	{
	}
just fill it with

Code: Select all

		mLoadingBarElement->setWidth(
			mLoadingBarElement->getWidth() + mProgressBarInc);
		mWindow->update();
or whatever you want your bar to do.
After I added the loading bar code, there are no more shadows in the scene and the billboards became jagged
you probably forgot to "return scene to full rendering"

Code: Select all

      // Back to full rendering 
      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
Will have to look at it though. The one thing that I am trying to figure out, is if you have the resources already parsed, how to make the bar progress (or say it's finished). Cause it just does not seem to show the progress of loading, only parsing.
look for the ResourceGroupLoadEnded function, and then setwidth the bar to full width.
Image
User avatar
celic
Gnome
Posts: 363
Joined: Wed Mar 23, 2005 11:05 am
Location: Chisinau/Moldova
Contact:

Post by celic »

M&M wrote:
After I added the loading bar code, there are no more shadows in the scene and the billboards became jagged
you probably forgot to "return scene to full rendering"

Code: Select all

      // Back to full rendering 
      mSceneMgr->clearSpecialCaseRenderQueues(); 
      mSceneMgr->setSpecialCaseRenderQueueMode(SceneManager::SCRQM_EXCLUDE); 
no problems with this, I did it... there is something else :?
Post Reply