1
General / Noob question about classes
« on: December 10, 2010, 05:16:16 am »
i managed to get the sf::IntRect to work but not the sf::Image
I keep getting this error:
Invalid initialization of non-const reference of type 'sf::Image&' from a temporary of type 'const sf::Image*'|
dont know how to fix that
Code: [Select]
class Frame{
public:
Frame(const sf::Image& image, const sf::IntRect& rect);
sf::Image& frame_image;
sf::IntRect frame_rect;
};
Frame::Frame(const sf::Image& image, const sf::IntRect& rect)
: frame_image(&image)
, frame_rect(rect)
{
}
I keep getting this error:
Invalid initialization of non-const reference of type 'sf::Image&' from a temporary of type 'const sf::Image*'|
dont know how to fix that