Sign in to follow this  
derek7

runtime error

Recommended Posts

derek7    100

class RenderQueue
{
public:
	/* type define */
        typedef std::vector<Material*> MaterialSet;
	typedef std::multimap<MaterialSet, Movable*> RenderMap;
	typedef std::pair<MaterialSet, Movable*> RenderMapPair;
	typedef std::multimap<MaterialSet, Movable*> ::iterator RenderMapIterator;
	
	void addMovable(MaterialSet, Movable *);
	void render();
private:
	RenderMap m_renderList; 
	std::vector<MaterialSet> m_materialSetList;
	GraphicDevice * m_device;

};

void RenderQueue::addMovable(MaterialSet material, Movable *Movable)
{
	m_renderList.insert(RenderMapPair(material, Movable));
}




abnormity error at addMovable() .I track it,when run to addMovable().

Share this post


Link to post
Share on other sites
SirLuthor    364
Another stunningly informative derek7 post [grin]

Seriously, man, you have to learn to start formulating proper questions and background information if you plan to have people help you in any way at all. Your post needs a little bit of something, such as perhaps more information on what is going wrong, code where it's going wrong, etc.

Share this post


Link to post
Share on other sites
JohnBolton    1372
Quote:
Original post by SirLuthor
Seriously, man, you have to learn to start formulating proper questions

Try to have some patience. He's Chinese and (obviously) not fluent in English.

Share this post


Link to post
Share on other sites
Conner McCloud    1135
void RenderQueue::addMovable(MaterialSet material, Movable *Movable)

That shouldn't even compile, because you are using a class name as a variable. So if you're getting a runtime error something is quite wrong.

CM

Share this post


Link to post
Share on other sites
dmatter    4821
Quote:
Original post by Conner McCloud
void RenderQueue::addMovable(MaterialSet material, Movable *Movable)

That shouldn't even compile, because you are using a class name as a variable. So if you're getting a runtime error something is quite wrong.

CM

Perhaps he actually meant compile-time error?.

Use this code instead:

void RenderQueue::addMovable(MaterialSet material, Movable *movable)
{
m_renderList.insert(RenderMapPair(material, movable));
}



Off topic: derek7, perhaps occasionaly use an online translator to compose longer posts, sometimes your posts are a bit hard to understand. Keep practicing english though, using a translator is fine but don't get lazy [wink]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this