Hi,
I am using thor::BigSprite class (
http://www.bromeon.ch/libraries/thor/v1.1/doc/classthor_1_1_big_sprite.html)
When i try to use this class as an object, there come multiple error messages:
#ifndef BACKGROUND_H
#define BACKGROUND_H
#include <SFML\Graphics.hpp>
#include <Thor\Multimedia.hpp>
#include <string>
namespace classes
{
namespace gui
{
class Background
{
public:
Background() {state = false;}
// Constructor with arguments
Background(std::string TexturePath, sf::Vector2f WindowSize);
//Changes picture
void SetTextureFromFile (std::string TexturePath);
//Scaling background to window
void ScaleToWindow(sf::Vector2f WindowSize);
//Draw
void Draw(sf::RenderWindow &window);
//Sets the state
void SetState(bool Bool);
//returns the state
bool GetState();
private:
thor::BigTexture texture;
thor::BigSprite sprite; // "sprite" is red underlined
bool state;
};
}
}
#endif // BACKGROUND_H
#include "Background.h"
namespace classes
{
namespace gui
{
Background::Background(std::string TexturePath,sf::Vector2f WindowSize)
{
state = false;
SetTextureFromFile(TexturePath);
ScaleToWindow(WindowSize);
}
void Background::SetTextureFromFile (std::string TexturePath)
{
this->texture.LoadFromFile(TexturePath);
this->sprite.SetTexture(texture);
}
void Background::ScaleToWindow(sf::Vector2f WindowSize)
{
this->sprite.setScale( (WindowSize.x / this->texture.GetWidth()), (WindowSize.y / this->texture.GetHeight()));
}
void Background::Draw(sf::RenderWindow &window)
{
window.draw(this->sprite);
}
void Background::SetState(bool Bool)
{
state = Bool;
}
bool Background::GetState()
{
return state;
}
}
}
1>c:\dropbox\c++ vr\sfml-2.1\include\thor\multimedia\shapes.hpp(111): error C2259: 'thor::ConcaveShape': Instanz von abstrakter Klasse kann nicht erstellt werden
1> aufgrund folgender Member:
1> "void sf::Drawable::draw(sf::RenderTarget &,sf::RenderStates) const": ist abstrakt
1> c:\dropbox\c++ vr\sfml-2.1\include\sfml\graphics\drawable.hpp(69): Siehe Deklaration von 'sf::Drawable::draw'
1>c:\dropbox\c++ vr\click-game\click-game\click-game\background.h(36): error C2259: 'thor::BigSprite': Instanz von abstrakter Klasse kann nicht erstellt werden
1> aufgrund folgender Member:
1> "void sf::Drawable::draw(sf::RenderTarget &,sf::RenderStates) const": ist abstrakt
1> c:\dropbox\c++ vr\sfml-2.1\include\sfml\graphics\drawable.hpp(69): Siehe Deklaration von 'sf::Drawable::draw'
1> ScoreManager.cppMy Visual Studio 2010 is German, sorry about that.
So it say that the thor::BigSprite class is an abstract class because of sf::Drawable::draw().
Doesn't thor::BigSprite have its own definition of draw() ?
So what reason could be this error?