Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SFML/Graphics.hpp>
- #include <SFML/OpenGL.hpp>
- #include <windows.h>
- #include <iostream>
- int main()
- {
- // create the window
- sf::RenderWindow window(sf::VideoMode(800, 600), "OpenGL", sf::Style::Default, sf::ContextSettings(32));
- //window.setVerticalSyncEnabled(true);
- // load resources, initialize the OpenGL states, ...
- sf::Text _label;
- _label.setString("Test");
- _label.setCharacterSize(20);
- _label.setColor(sf::Color(255, 0, 0, 255));
- //_label.setVisible(true);
- sf::Font fnt;
- if(!fnt.loadFromFile("MankSans.ttf"))
- printf("Could not load font!\n");
- _label.setFont(fnt);
- // run the main loop
- bool running = true;
- while (running)
- {
- // handle events
- sf::Event event;
- while (window.pollEvent(event))
- {
- if (event.type == sf::Event::Closed)
- {
- // end the program
- running = false;
- }
- }
- // clear the buffers
- window.clear();
- printf("Draw\n");
- window.draw(_label);
- // end the current frame (internally swaps the front and back buffers)
- window.display();
- }
- // release resources...
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement