Performance trouble when rendering (2d)

Started by
10 comments, last by stevenmarky 13 years, 6 months ago
Quote:Original post by Psilobe
The problem with defining my static variable is taht if I do it like this:
*** Source Snippet Removed ***

It says it cant find PlayerFilename and Drops_X... and Drops_Y...
Then you have to find a way for your code to be able to find those variables. In situations like this I find it good to link to this article.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Advertisement
I would not use static in this situation, use MaulingMonkeys second or third solution:

Quote:
- Have something else load the image, and then tell the enemies what to use by passing it a pointer or reference to the image
- Have something else load the image AND draw the enemies, having the enemy not care what images are used.


Its good that you should learn what static does though.

This topic is closed to new replies.

Advertisement