[Doc] Readme about multi-viewports
This commit is contained in:
1 parent
13c3a28f09
commit
c14d2a33a3
2 files changed
+12
-8
No files matched your search
@@ -146,7 +146,9 @@ public final class ImGuiGlfwExample {
|
||||
final ImGuiIO io = ImGui.getIO();
|
||||
|
||||
io.setIniFilename(null); // We don't want to save .ini file
|
||||
io.addConfigFlags(ImGuiConfigFlags.NavEnableKeyboard | ImGuiConfigFlags.DockingEnable | ImGuiConfigFlags.ViewportsEnable);
|
||||
io.addConfigFlags(ImGuiConfigFlags.NavEnableKeyboard); // Enable Keyboard Controls
|
||||
io.addConfigFlags(ImGuiConfigFlags.DockingEnable); // Enable Docking
|
||||
io.addConfigFlags(ImGuiConfigFlags.ViewportsEnable); // Enable Multi-Viewport / Platform Windows
|
||||
io.setConfigViewportsNoTaskBarIcon(true);
|
||||
|
||||
// ------------------------------------------------------------
|
||||
@@ -189,7 +191,7 @@ public final class ImGuiGlfwExample {
|
||||
ImGuiFreeType.buildFontAtlas(fontAtlas, ImGuiFreeType.RasterizerFlags.LightHinting);
|
||||
|
||||
// When viewports are enabled we tweak WindowRounding/WindowBg so platform windows can look identical to regular ones.
|
||||
if ((io.getConfigFlags() & ImGuiConfigFlags.ViewportsEnable) != 0) {
|
||||
if (io.hasConfigFlags(ImGuiConfigFlags.ViewportsEnable)) {
|
||||
final ImGuiStyle style = ImGui.getStyle();
|
||||
style.setWindowRounding(0.0f);
|
||||
style.setColor(ImGuiCol.WindowBg, ImGui.getColorU32(ImGuiCol.WindowBg, 1));
|
||||
@@ -224,7 +226,7 @@ public final class ImGuiGlfwExample {
|
||||
// At that moment ImGui will be rendered to the current OpenGL context.
|
||||
imGuiGl3.renderDrawData(ImGui.getDrawData());
|
||||
|
||||
if ((ImGui.getIO().getConfigFlags() & ImGuiConfigFlags.ViewportsEnable) != 0) {
|
||||
if (ImGui.getIO().hasConfigFlags(ImGuiConfigFlags.ViewportsEnable)) {
|
||||
final long backupWindowPtr = glfwGetCurrentContext();
|
||||
ImGui.updatePlatformWindows();
|
||||
ImGui.renderPlatformWindowsDefault();
|
||||
|
||||
Reference in new issue
Block a user