Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewports #213

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Ignore folders named build
build/**
Build/**

Ignore Visual Studio folder
.vs/**
14 changes: 13 additions & 1 deletion examples/minimal/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>

#include <iostream>

int main() {
sf::RenderWindow window(sf::VideoMode(640, 480), "ImGui + SFML = <3");
sf::RenderWindow window(sf::VideoMode(1280, 720), "ImGui + SFML = <3");
window.setFramerateLimit(60);
ImGui::SFML::Init(window);
// Comment/uncomment this to disable/enable viewports
// Must be using docking branch of ImGui
//ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_ViewportsEnable
// | ImGuiConfigFlags_DockingEnable;

sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
Expand All @@ -37,6 +43,12 @@ int main() {
window.clear();
window.draw(shape);
ImGui::SFML::Render(window);
// Comment/uncomment this to disable/enable viewports
// Must be using docking branch of ImGui
//if (ImGui::GetIO().ConfigFlags & ImGuiConfigFlags_ViewportsEnable) {
// ImGui::UpdatePlatformWindows();
// ImGui::RenderPlatformWindowsDefault();
//}
window.display();
}

Expand Down
Loading