This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML application"); | |
window.setVerticalSyncEnabled(true); | |
sf::Texture texture; | |
texture.loadFromFile("media/background.png"); | |
sf::Sprite sprite(texture); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML line and letter spacing"); | |
window.setVerticalSyncEnabled(true); | |
sf::Font font; | |
font.loadFromFile("media/sansation.ttf"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (C) Jan Haller, September 2015 | |
#include <SFML/Window.hpp> | |
#include <iostream> | |
std::ostream& operator<< (std::ostream& stream, const sf::IntRect& rect) | |
{ | |
return stream << "(x: " << rect.left << ", y: " << rect.top | |
<< ", w: " << rect.width << ", h: " << rect.height << ")"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Jan Haller, 20.09.2015 | |
#include <SFML/Graphics.hpp> | |
#include <locale> | |
#include <cmath> | |
int main() | |
{ | |
sf::RenderWindow window({1000, 600}, "Outline test"); | |
window.setVerticalSyncEnabled(true); |