Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <IMGUI/imgui.h>
- #include <IMGUI/imgui-SFML.h>
- #include "Game.h"
- #include "Window.h"
- sf::RenderWindow window;
- sf::Clock deltaClock;
- void setupWindow(_GAME *pGame)
- {
- pGame->Window.nWidth = 1360;
- pGame->Window.nHeight = 720;
- window.create(sf::VideoMode(pGame->Window.nWidth, pGame->Window.nHeight), "Render Window");
- window.setVerticalSyncEnabled(true);
- ImGui::SFML::Init(window);
- window.setTitle("HL Alpha");
- window.resetGLStates(); // only draw imgui, else remove.
- }
- void updateWindow(_GAME *pGame)
- {
- while (window.isOpen()) {
- sf::Event event;
- while (window.pollEvent(event)) {
- // Process ImGui along with the SFML event
- ImGui::SFML::ProcessEvent(event);
- if (event.type == sf::Event::Closed) {
- window.close();
- }
- ImGui::EndFrame();
- }
- //ImGui::NewFrame();
- window.clear(sf::Color::Black);
- //window.clear(sf::Color::Black);
- ImGui::SFML::Render(window);
- window.display();
- }
- ImGui::SFML::Shutdown();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement