启用docking
This commit is contained in:
@@ -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
Submodule third_party/imgui/imgui updated: 96839b445e...8048b52498
Reference in New Issue
Block a user