|
|
|
@ -6,7 +6,8 @@ |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
#include "imgui.h" |
|
|
|
#include "imgui.h" |
|
|
|
#include "examples/sdl_opengl3_example/imgui_impl_sdl_gl3.h" |
|
|
|
#include "examples/imgui_impl_sdl.h" |
|
|
|
|
|
|
|
#include "examples/imgui_impl_opengl3.h" |
|
|
|
|
|
|
|
|
|
|
|
#include "util.h" |
|
|
|
#include "util.h" |
|
|
|
#include "gooey.h" |
|
|
|
#include "gooey.h" |
|
|
|
@ -18,7 +19,10 @@ initGooey(SDL_Handles &handles, v2i vp_dims /*TODO: pass in game state*/) |
|
|
|
ImGui::CreateContext(); |
|
|
|
ImGui::CreateContext(); |
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|
ImGuiIO& io = ImGui::GetIO(); |
|
|
|
io.IniFilename = NULL; // don't save window state to imgui.ini
|
|
|
|
io.IniFilename = NULL; // don't save window state to imgui.ini
|
|
|
|
ImGui_ImplSdlGL3_Init(handles.window); |
|
|
|
|
|
|
|
|
|
|
|
ImGui_ImplSDL2_InitForOpenGL(handles.window, handles.glContext); |
|
|
|
|
|
|
|
ImGui_ImplOpenGL3_Init("#version 330 core"); |
|
|
|
|
|
|
|
|
|
|
|
io.DisplaySize.x = vp_dims.x; |
|
|
|
io.DisplaySize.x = vp_dims.x; |
|
|
|
io.DisplaySize.y = vp_dims.y; |
|
|
|
io.DisplaySize.y = vp_dims.y; |
|
|
|
ImGui::StyleColorsDark(); |
|
|
|
ImGui::StyleColorsDark(); |
|
|
|
@ -29,14 +33,15 @@ initGooey(SDL_Handles &handles, v2i vp_dims /*TODO: pass in game state*/) |
|
|
|
void |
|
|
|
void |
|
|
|
shutdownGooey() |
|
|
|
shutdownGooey() |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImGui_ImplSdlGL3_Shutdown(); |
|
|
|
ImGui_ImplOpenGL3_Shutdown(); |
|
|
|
|
|
|
|
ImGui_ImplSDL2_Shutdown(); |
|
|
|
ImGui::DestroyContext(); |
|
|
|
ImGui::DestroyContext(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool |
|
|
|
bool |
|
|
|
gooeyProcessEvent(SDL_Event &event) |
|
|
|
gooeyProcessEvent(SDL_Event &event) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImGui_ImplSdlGL3_ProcessEvent(&event); |
|
|
|
ImGui_ImplSDL2_ProcessEvent(&event); |
|
|
|
return ImGui::GetIO().WantCaptureMouse; |
|
|
|
return ImGui::GetIO().WantCaptureMouse; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -44,7 +49,9 @@ 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, v3f camera_pos) |
|
|
|
hex_info* start_hex, hex_info* current_hex, bool &is_selecting, v3f camera_pos) |
|
|
|
{ |
|
|
|
{ |
|
|
|
ImGui_ImplSdlGL3_NewFrame(handles.window); |
|
|
|
ImGui_ImplOpenGL3_NewFrame(); |
|
|
|
|
|
|
|
ImGui_ImplSDL2_NewFrame(handles.window); |
|
|
|
|
|
|
|
ImGui::NewFrame(); |
|
|
|
|
|
|
|
|
|
|
|
ImGuiWindowFlags window_flags = 0; |
|
|
|
ImGuiWindowFlags window_flags = 0; |
|
|
|
window_flags |= ImGuiWindowFlags_NoTitleBar; |
|
|
|
window_flags |= ImGuiWindowFlags_NoTitleBar; |
|
|
|
@ -103,7 +110,7 @@ renderGooey(SDL_Handles &handles, HexDrawMode &mode, bool &is_debug, |
|
|
|
|
|
|
|
|
|
|
|
ImGui::End(); |
|
|
|
ImGui::End(); |
|
|
|
ImGui::Render(); |
|
|
|
ImGui::Render(); |
|
|
|
ImGui_ImplSdlGL3_RenderDrawData(ImGui::GetDrawData()); |
|
|
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|