Triangles/src/imgui_helper.hpp

25 lines
745 B
C++
Raw Normal View History

2020-07-21 11:34:39 +00:00
#ifndef TRIANGLES_IMGUI_HELPER_HPP
#define TRIANGLES_IMGUI_HELPER_HPP
#include <imgui.h>
#include "state.hpp"
namespace Tri {
2020-07-22 06:19:37 +00:00
// Seems misleading, but imgui handles setting up the window during update
// so this should be called during update, not draw
2020-07-21 11:34:39 +00:00
inline void draw_help(Tri::State *state) {
2020-07-22 06:19:37 +00:00
if(state->get_flags().test(0)) {
2020-07-21 11:34:39 +00:00
ImGui::SetNextWindowPos(sf::Vector2f(10.0f, 10.0f));
ImGui::SetNextWindowSize(sf::Vector2f(
2020-07-22 06:19:37 +00:00
state->get_width() - 20.0f,
state->get_height() - 20.0f));
2020-07-21 11:34:39 +00:00
ImGui::Begin("Help Window", nullptr, ImGuiWindowFlags_NoDecoration);
ImGui::Text("This is the help window.");
ImGui::End();
}
}
}
#endif