Skip to content

Instantly share code, notes, and snippets.

@saccadic
Created May 22, 2017 05:00
Show Gist options
  • Save saccadic/3c00b69d540c2ea7a2a0c7d33d719bfe to your computer and use it in GitHub Desktop.
Save saccadic/3c00b69d540c2ea7a2a0c7d33d719bfe to your computer and use it in GitHub Desktop.
ofxImGUIのでいつも使うテンプレート
void drawGUI() {
//ウィンドウのオプション
static bool no_titlebar = false;
static bool no_border = false;
static bool no_resize = false;
static bool no_move = false;
static bool no_scrollbar = false;
static bool no_collapse = false;
static bool no_menu = false;
static bool show_another_window = false;
static ImGuiWindowFlags window_flags = 0;
if (no_titlebar) window_flags |= ImGuiWindowFlags_NoTitleBar;
if (!no_border) window_flags |= ImGuiWindowFlags_ShowBorders;
if (no_resize) window_flags |= ImGuiWindowFlags_NoResize;
if (no_move) window_flags |= ImGuiWindowFlags_NoMove;
if (no_scrollbar) window_flags |= ImGuiWindowFlags_NoScrollbar;
if (no_collapse) window_flags |= ImGuiWindowFlags_NoCollapse;
if (!no_menu) window_flags |= ImGuiWindowFlags_MenuBar;
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
ImGui::Begin("Option", &show_another_window, window_flags);
{
//個々にスライダーとかボタンとかのGUIを追加する
}
ImGui::End();
ImGui::PopStyleVar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment