Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "core.h"
- class Window_Render {
- private:
- sf::RenderWindow window;
- int fps, c_bit_deph;
- int w_wight, w_height;
- bool v_sync;
- std::string w_title;
- public:
- Window_Render(int w, int h, bool v, std::string title);
- ~Window_Render();
- void window_add()
- {
- window.create(sf::VideoMode(w_wight, w_height, c_bit_deph), w_title);
- window.setFramerateLimit(fps);
- window.setVerticalSyncEnabled(v_sync);
- }
- void loop()
- {
- fm_load();
- while (window.isOpen())
- {
- sf::Event zdarzenie;
- while (window.pollEvent(zdarzenie))
- {
- if (zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Escape)
- {
- window.close();
- }
- }
- window.display();
- }
- }
- };
- Window_Render::Window_Render(int w, int h, bool v, std::string title)
- :fps(60), c_bit_deph(32), w_wight(w), w_height(h), v_sync(v), w_title(title)
- {
- std::cout << "Tworzenie RENDER WINDOW" << std::endl;
- }
- //Wczytywanie ustawień
- void inplementacja()
- {
- typedef boost::property_tree::ptree boost_ptree;
- boost_ptree tree;
- boost :: property_tree::read_json("conf.json", tree);
- Window_Render r_window(tree.get<int>("w"), tree.get<int>("h"), tree.get<bool>("v_sync"), "SFML Render TEST");
- }
- Window_Render::~Window_Render()
- {
- std::cout << "Destrukcja RENDER WINDOW" << std::endl;
- fps = NULL;
- c_bit_deph = NULL;
- w_wight = NULL;
- w_height = NULL;
- v_sync = NULL;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement