SFML community forums
General => General discussions => Topic started by: Xenavar on June 01, 2010, 05:21:53 am
-
What is the correct syntax to do that? In both the .h and .cpp. because right now I am getting the following error:
C:\Users\Steven\Desktop\SFML-1.5\include\SFML\System\NonCopyable.hpp|57|error: `sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
followed by:
C:\Users\Steven\Desktop\RPG\main.cpp|21|error: initializing argument 2 of `void PC::Handle_event(sf::Event, sf::RenderWindow)'|
-
I believe this is known as passing by reference. Could be that it's not though... ;)
Anyway, it works:
void CLASS::draw(sf::RenderWindow &target)
{
target.Draw(sprite);
}
To call it:
class.draw(App);
Obviously, you might not be doing this for a drawing routine, but you should be able to see how it works.
-
Is there a reason that when I pass a window to a class and then use events that use the window's elapsed time to make a sprite move, it has some lag spikes?
The first time I did it I had no classes at all and it worked perfecly fine on a normal function (in main)
-
bump
-
Is there a reason that when I pass a window to a class and then use events that use the window's elapsed time to make a sprite move, it has some lag spikes?
The first time I did it I had no classes at all and it worked perfecly fine on a normal function (in main)
Not at all. What's the code?