Updated Cocoa example

Now load correctly a font instead of displaying nothing at all.
This commit is contained in:
Marco Antognini 2012-08-20 19:26:30 +02:00
parent abd842510e
commit 757a785ed7
3 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,7 @@ set(XIBS MainMenu)
# all resource files
set(RESOURCES ${SRCROOT}/resources/logo.png
${SRCROOT}/resources/icon.icns
${SRCROOT}/resources/sansation.ttf
${SRCROOT}/resources/blue.png
${SRCROOT}/resources/green.png
${SRCROOT}/resources/red.png

View File

@ -54,11 +54,17 @@ struct SFMLmainWindow
unsigned int ww = renderWindow.getSize().x;
unsigned int wh = renderWindow.getSize().y;
sprite.setPosition(sf::Vector2f(ww, wh) / 2.f);
if (!font.loadFromFile(resPath + "/sansation.ttf")) {
NSLog(@"Couldn't load the font");
}
text.setColor(sf::Color::White);
text.setFont(font);
}
sf::RenderWindow renderWindow;
sf::Font font;
sf::Text text;
sf::Texture logo;
sf::Sprite sprite;

Binary file not shown.