Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "display.h"
- namespace Display
- {
- sf::RenderWindow window;
- void init()
- {
- window.create(sf::VideoMode(WIDTH,HEIGHT), "SFML window");
- }
- void clear()
- {
- window.clear();
- }
- void drawObject(sf::Drawable* obj)
- {
- window.draw(*obj);
- }
- void display()
- {
- window.display();
- }
- void checkWindowEvents()
- {
- sf::Event e;
- while(window.pollEvent(e))
- {
- if(e.type == sf::Event::Closed)
- {
- window.close();
- }
- }
- }
- void setFPSCap(int fps)
- {
- window.setFramerateLimit(fps);
- }
- bool isOpen()
- {
- return window.isOpen();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement