|
|
|
|
@ -13,14 +13,16 @@
|
|
|
|
|
bool initGooey(SDL_Handles &handles, v2i vp_dims); |
|
|
|
|
void shutdownGooey(); |
|
|
|
|
bool gooeyProcessEvent(SDL_Event &event); |
|
|
|
|
void renderGooey(SDL_Handles &handles, HexDrawMode &mode); |
|
|
|
|
void renderGooey(SDL_Handles &handles, HexDrawMode &mode, bool &is_debug, |
|
|
|
|
hex_info* start_hex, hex_info* current_hex, bool &is_selecting); |
|
|
|
|
|
|
|
|
|
bool |
|
|
|
|
initGooey(SDL_Handles &handles, v2i vp_dims /*TODO: pass in game state*/) |
|
|
|
|
{ |
|
|
|
|
IMGUI_CHECKVERSION(); |
|
|
|
|
ImGui::CreateContext(); |
|
|
|
|
ImGuiIO& io = ImGui::GetIO(); (void)io; |
|
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|
|
io.IniFilename = NULL; // don't save window state to imgui.ini
|
|
|
|
|
ImGui_ImplSdlGL3_Init(handles.window); |
|
|
|
|
io.DisplaySize.x = vp_dims.x; |
|
|
|
|
io.DisplaySize.y = vp_dims.y; |
|
|
|
|
@ -44,11 +46,12 @@ gooeyProcessEvent(SDL_Event &event)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void |
|
|
|
|
renderGooey(SDL_Handles &handles, HexDrawMode &mode, bool &is_debug) |
|
|
|
|
renderGooey(SDL_Handles &handles, HexDrawMode &mode, bool &is_debug, |
|
|
|
|
hex_info* start_hex, hex_info* current_hex, bool &is_selecting) |
|
|
|
|
{ |
|
|
|
|
ImGui_ImplSdlGL3_NewFrame(handles.window); |
|
|
|
|
|
|
|
|
|
#if 0 |
|
|
|
|
#if 1 |
|
|
|
|
ImGuiWindowFlags window_flags = 0; |
|
|
|
|
window_flags |= ImGuiWindowFlags_NoTitleBar; |
|
|
|
|
window_flags |= ImGuiWindowFlags_NoScrollbar; |
|
|
|
|
@ -56,28 +59,47 @@ renderGooey(SDL_Handles &handles, HexDrawMode &mode, bool &is_debug)
|
|
|
|
|
window_flags |= ImGuiWindowFlags_NoResize; |
|
|
|
|
window_flags |= ImGuiWindowFlags_NoCollapse; |
|
|
|
|
|
|
|
|
|
ImGui::SetNextWindowPos(ImVec2(0,0)); |
|
|
|
|
ImGui::SetNextWindowSize(ImVec2(300, 250)); |
|
|
|
|
ImGui::SetNextWindowBgAlpha(0.3f); |
|
|
|
|
bool show_window; |
|
|
|
|
ImGui::Begin("", &show_window, window_flags); |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", |
|
|
|
|
1000.0f / ImGui::GetIO().Framerate, |
|
|
|
|
ImGui::GetIO().Framerate); |
|
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|
|
ImGui::Text("%.3f ms/frame, (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); |
|
|
|
|
|
|
|
|
|
if (ImGui::Button("None")) |
|
|
|
|
ImGui::Text("Draw Mode:"); |
|
|
|
|
if (ImGui::RadioButton("None", (mode == NONE))) |
|
|
|
|
mode = NONE; |
|
|
|
|
if (ImGui::Button("Fill")) |
|
|
|
|
if (ImGui::RadioButton("Fill", (mode == FILL))) |
|
|
|
|
mode = FILL; |
|
|
|
|
if (ImGui::Button("Line")) |
|
|
|
|
if (ImGui::RadioButton("Line", (mode == LINE))) |
|
|
|
|
mode = LINE; |
|
|
|
|
if (ImGui::Button("Cone Fill")) |
|
|
|
|
if (ImGui::RadioButton("Cone Fill", (mode == CONE_FILL))) |
|
|
|
|
mode = CONE_FILL; |
|
|
|
|
|
|
|
|
|
ImGui::Checkbox("Debug Render", &is_debug); |
|
|
|
|
ImGui::SameLine(); ImGui::TextUnformatted(is_debug ? "true" : "false"); |
|
|
|
|
ImGui::Text("is_selecting"); |
|
|
|
|
ImGui::SameLine(); ImGui::TextUnformatted(is_selecting ? "true" : "false"); |
|
|
|
|
|
|
|
|
|
if (current_hex) |
|
|
|
|
{ |
|
|
|
|
Hex ch = current_hex->hex; |
|
|
|
|
ImGui::Text("current_hex: %i, %i, %i", ch.q, ch.r, ch.s); |
|
|
|
|
} |
|
|
|
|
if (start_hex) |
|
|
|
|
{ |
|
|
|
|
Hex sh = start_hex->hex; |
|
|
|
|
ImGui::Text("start_hex: %i, %i, %i", sh.q, sh.r, sh.s); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
ImGui::End(); |
|
|
|
|
|
|
|
|
|
ImGui::Render(); |
|
|
|
|
ImGui_ImplSdlGL3_RenderDrawData(ImGui::GetDrawData()); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#endif // GOOEY_H
|
|
|
|
|
|