Removed the built-in default font
This commit is contained in:
parent
a3357d9c10
commit
a0c1f5f50f
9 changed files with 53 additions and 14752 deletions
|
@ -5,6 +5,7 @@
|
|||
// Headers
|
||||
////////////////////////////////////////////////////////////
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
|
||||
|
||||
|
@ -19,6 +20,11 @@ public :
|
|||
{
|
||||
}
|
||||
|
||||
static void setFont(const sf::Font& font)
|
||||
{
|
||||
s_font = &font;
|
||||
}
|
||||
|
||||
const std::string& getName() const
|
||||
{
|
||||
return m_name;
|
||||
|
@ -43,7 +49,7 @@ public :
|
|||
}
|
||||
else
|
||||
{
|
||||
sf::Text error("Shader not\nsupported");
|
||||
sf::Text error("Shader not\nsupported", getFont());
|
||||
error.setPosition(320.f, 200.f);
|
||||
error.setCharacterSize(36);
|
||||
target.draw(error, states);
|
||||
|
@ -58,6 +64,12 @@ protected :
|
|||
{
|
||||
}
|
||||
|
||||
static const sf::Font& getFont()
|
||||
{
|
||||
assert(s_font != NULL);
|
||||
return *s_font;
|
||||
}
|
||||
|
||||
private :
|
||||
|
||||
// Virtual functions to be implemented in derived effects
|
||||
|
@ -69,6 +81,8 @@ private :
|
|||
|
||||
std::string m_name;
|
||||
bool m_isLoaded;
|
||||
|
||||
static const sf::Font* s_font;
|
||||
};
|
||||
|
||||
#endif // EFFECT_HPP
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue