Jump to content
  • Advertisement
Sign in to follow this  
derek7

runtime error

This topic is 4620 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts


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
Advertisement
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
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
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
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!