New docks are now automatically added as tabs
parent
85c0b2cf42
commit
5cacee03c1
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,19 @@
|
|||
#pragma once
|
||||
|
||||
|
||||
|
||||
|
||||
namespace ImGui
|
||||
{
|
||||
|
||||
|
||||
IMGUI_API void ShutdownDock();
|
||||
IMGUI_API void RootDock(const ImVec2& pos, const ImVec2& size);
|
||||
IMGUI_API bool BeginDock(const char* label, bool* opened = nullptr, ImGuiWindowFlags extra_flags = 0, const ImVec2& default_size = ImVec2(-1, -1));
|
||||
IMGUI_API void EndDock();
|
||||
IMGUI_API void SetDockActive();
|
||||
//IMGUI_API void SaveDock(Lumix::FS::OsFile& file);
|
||||
//IMGUI_API void LoadDock(lua_State* L);
|
||||
|
||||
|
||||
} // namespace ImGui
|
|
@ -45,7 +45,7 @@ INCLUDE_DIRECTORIES (
|
|||
3rdparty/glfw/deps
|
||||
3rdparty/glfw/include
|
||||
3rdparty/tinyobjloader
|
||||
3rdparty/imgui_dock
|
||||
3rdparty/imgui_dock_lumix
|
||||
${CMAKE_CURRENT_BINARY_DIR}/src
|
||||
|
||||
3rdparty/imgui
|
||||
|
@ -75,7 +75,7 @@ SET ( protot_SRCS
|
|||
3rdparty/imgui/examples/libs/gl3w/GL/gl3w.c
|
||||
3rdparty/imgui/examples/opengl3_example/imgui_impl_glfw_gl3.cpp
|
||||
|
||||
3rdparty/imgui_dock/imgui_dock.cpp
|
||||
3rdparty/imgui_dock_lumix/imgui_dock.cpp
|
||||
)
|
||||
|
||||
SET (PROTOT_SOURCE_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
|
46
src/main.cc
46
src/main.cc
|
@ -32,11 +32,11 @@ double gTimeAtStart = 0;
|
|||
double mouse_scroll_x = 0.;
|
||||
double mouse_scroll_y = 0.;
|
||||
|
||||
using namespace std;
|
||||
bool show_dock_1 = true;
|
||||
bool show_dock_2 = true;
|
||||
bool show_dock_3 = true;
|
||||
|
||||
// extern "C" {
|
||||
// GLAPI int gladLoadGL(void);
|
||||
// }
|
||||
using namespace std;
|
||||
|
||||
static void error_callback(int error, const char* description)
|
||||
{
|
||||
|
@ -203,7 +203,6 @@ int main(void)
|
|||
int width, height;
|
||||
glfwGetWindowSize(gWindow, &width, &height);
|
||||
|
||||
|
||||
ImGui::BeginMainMenuBar();
|
||||
|
||||
if (ImGui::BeginMenu("Dialogs"))
|
||||
|
@ -212,49 +211,16 @@ int main(void)
|
|||
ImGui::EndMenu();
|
||||
}
|
||||
|
||||
float menu_bar_height = ImGui::GetWindowHeight();
|
||||
ImGui::EndMainMenuBar();
|
||||
|
||||
if (draw_imgui_demo)
|
||||
ImGui::ShowDemoWindow();
|
||||
|
||||
#ifdef USE_DOCKS
|
||||
ImGui::SetNextWindowPos(ImVec2(0.0f, 10.0f));
|
||||
ImGui::SetNextWindowSize(ImVec2(width, height));
|
||||
if (ImGui::Begin("DockArea", NULL,
|
||||
ImGuiWindowFlags_NoTitleBar
|
||||
| ImGuiWindowFlags_NoResize
|
||||
| ImGuiWindowFlags_NoMove
|
||||
| ImGuiWindowFlags_NoBringToFrontOnFocus
|
||||
)) {
|
||||
ImGui::BeginDockspace();
|
||||
|
||||
if (ImGui::BeginDock("dock1")) {
|
||||
ImGui::Text("HEllo 1");
|
||||
}
|
||||
ImGui::EndDock();
|
||||
|
||||
if (ImGui::BeginDock("dock2")) {
|
||||
ImGui::Text("HEllo2");
|
||||
}
|
||||
ImGui::EndDock();
|
||||
|
||||
if (ImGui::BeginDock("dock3")) {
|
||||
ImGui::Text("HEllo3");
|
||||
}
|
||||
ImGui::EndDock();
|
||||
|
||||
|
||||
#endif
|
||||
ImGui::RootDock(ImVec2(0.0f, menu_bar_height), ImVec2(width, height - menu_bar_height));
|
||||
|
||||
module_manager.Update(gTimer->mDeltaTime);
|
||||
|
||||
#ifdef USE_DOCKS
|
||||
ImGui::EndDockspace();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
#endif
|
||||
//
|
||||
ImGui::Render();
|
||||
|
||||
usleep(16000);
|
||||
|
|
Loading…
Reference in New Issue