|
|
@ -1,5 +1,6 @@ |
|
|
|
#include "imgui.h" |
|
|
|
#include "imgui.h" |
|
|
|
#include "imgui-SFML.h" |
|
|
|
#include "imgui-SFML.h" |
|
|
|
|
|
|
|
#include <fmt/core.h> |
|
|
|
|
|
|
|
|
|
|
|
#include <SFML/Graphics/CircleShape.hpp> |
|
|
|
#include <SFML/Graphics/CircleShape.hpp> |
|
|
|
#include <SFML/Graphics/RenderWindow.hpp> |
|
|
|
#include <SFML/Graphics/RenderWindow.hpp> |
|
|
@ -7,10 +8,19 @@ |
|
|
|
#include <SFML/Window/Event.hpp> |
|
|
|
#include <SFML/Window/Event.hpp> |
|
|
|
|
|
|
|
|
|
|
|
int main() { |
|
|
|
int main() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fmt::print("Setting up a window for you...\n"); |
|
|
|
|
|
|
|
|
|
|
|
sf::RenderWindow window(sf::VideoMode(1920, 1080), "ImGui + SFML = <3"); |
|
|
|
sf::RenderWindow window(sf::VideoMode(1920, 1080), "ImGui + SFML = <3"); |
|
|
|
// window.setFramerateLimit(60);
|
|
|
|
// window.setFramerateLimit(60);
|
|
|
|
window.setVerticalSyncEnabled(true); |
|
|
|
window.setVerticalSyncEnabled(true); |
|
|
|
ImGui::SFML::Init(window); |
|
|
|
int res = ImGui::SFML::Init(window); |
|
|
|
|
|
|
|
if(res == 1) { |
|
|
|
|
|
|
|
fmt::print("ImGui returned result {}\n", res); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
fmt::print("ImGui returned an error code={}\n", res); |
|
|
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
sf::CircleShape shape(100.f); |
|
|
|
sf::CircleShape shape(100.f); |
|
|
|
shape.setFillColor(sf::Color::Green); |
|
|
|
shape.setFillColor(sf::Color::Green); |
|
|
@ -22,6 +32,7 @@ int main() { |
|
|
|
ImGui::SFML::ProcessEvent(window, event); |
|
|
|
ImGui::SFML::ProcessEvent(window, event); |
|
|
|
|
|
|
|
|
|
|
|
if (event.type == sf::Event::Closed) { |
|
|
|
if (event.type == sf::Event::Closed) { |
|
|
|
|
|
|
|
fmt::print("Exiting...\n"); |
|
|
|
window.close(); |
|
|
|
window.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|