启用docking
This commit is contained in:
parent
87ad4d5eb9
commit
fa2a33881a
@ -117,6 +117,8 @@ void application::init_imgui() {
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
|
||||
io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad; // Enable Gamepad Controls
|
||||
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
|
||||
io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; // Enable Multi-Viewport / Platform Windows
|
||||
ImGui::StyleColorsDark();
|
||||
//ImGui::StyleColorsLight();
|
||||
}
|
||||
|
@ -88,6 +88,8 @@ void renderer_opengl::new_frame(GLFWwindow* window_handle) {
|
||||
}
|
||||
|
||||
void renderer_opengl::end_frame(GLFWwindow* window_handle) {
|
||||
const ImGuiIO& io = ImGui::GetIO();
|
||||
|
||||
// Rendering
|
||||
ImGui::Render();
|
||||
int display_w, display_h;
|
||||
@ -98,6 +100,17 @@ void renderer_opengl::end_frame(GLFWwindow* window_handle) {
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
// Update and Render additional Platform Windows
|
||||
// (Platform functions may change the current OpenGL context, so we save/restore it to make it easier to paste this code elsewhere.
|
||||
// For this specific demo app we could also call glfwMakeContextCurrent(window) directly)
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
|
||||
{
|
||||
GLFWwindow* backup_current_context = glfwGetCurrentContext();
|
||||
ImGui::UpdatePlatformWindows();
|
||||
ImGui::RenderPlatformWindowsDefault();
|
||||
glfwMakeContextCurrent(backup_current_context);
|
||||
}
|
||||
|
||||
glfwSwapBuffers(window_handle);
|
||||
}
|
||||
|
||||
|
2
third_party/imgui/imgui
vendored
2
third_party/imgui/imgui
vendored
@ -1 +1 @@
|
||||
Subproject commit 96839b445e32e46d87a44fd43a9cdd60c806f7e1
|
||||
Subproject commit 8048b52498a9bf2a9f87b080d43b0bfd7a5d51d8
|
Loading…
x
Reference in New Issue
Block a user