1
SFML projects / Sconrstruct
« on: March 10, 2011, 06:41:25 pm »
I just tried simply lettings scons build it, but it autoselected Visual C++ as the compiler, when I want to use MinGW. Is there a way to correct that?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
-------------- Build: Debug in SFGUI ---------------
Compiling: ..\..\src\Bin.cpp
CreateProcess(): The system cannot find the file specified.
Process terminated with status 123 (0 minutes, 0 seconds)
0 errors, 0 warnings
class TextManager{
public:
TextManager(void);
void AddFont(std::string name, std::string font_path);
unsigned int DrawTextToTexture(std::string text, unsigned int font_size = 30, std::string font_name = "default");
private:
std::map<std::string, sf::Font *> fonts;
sf::RenderImage *render_image;
};
TextManager::TextManager(void){
AddFont("default", "Common/Fonts/Vera.ttf");
render_image = new sf::RenderImage();
// Do I Need This Next Line?!?
render_image->GetImage().CreateTexture(120, 38);
}
void TextManager::AddFont(std::string name, std::string font_path){
if (fonts.count(name) < 1){
sf::Font *font = new sf::Font();
font->LoadFromFile(font_path);
fonts[name] = font;
}
}
unsigned int TextManager::DrawTextToTexture(std::string text, unsigned int font_size, std::string font_name){
if (fonts.count(font_name) > 0){
sf::Text sf_text(text.c_str(), *fonts[font_name], text.size());
sf_text.SetCharacterSize(font_size);
sf_text.SetPosition(0.0f, 0.0f);
render_image->Draw(sf_text);
// WHAT DO I DO AFTER I DRAW IT?
// Would I have to create a GL Texture every frame and release it? That seems crazy.
}
}
sfml_application = new sf::RenderWindow(sf::VideoMode(resolution_width, resolution_height), "ElementGamesTest", ((fullscreen) ? sf::Style::Fullscreen : sf::Style::Close));