Skip to content

Viewports#

Flags stored in ImGui::ImGuiViewport::Flags, giving indications to the platform backends.

enum ImGui::ImGuiViewportFlags #

  • None

  • IsPlatformWindow
    Represent a Platform Window

  • IsPlatformMonitor
    Represent a Platform Monitor (unused yet)

  • OwnedByApp
    Platform Window: is created/managed by the application (rather than a dear imgui backend)

  • Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.

  • In 'docking' branch with multi-viewport enabled, we extend this concept to have multiple active viewports.
  • In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
  • About Main Area vs Work Area:
    • Main Area = entire viewport.
    • Work Area = entire viewport minus sections used by main menu bars (for platform windows), or by task bar (for platform monitor).
    • Windows are generally trying to stay within the Work Area of their host viewport.

struct ImGui::ImGuiViewport
inherits Struct #

Included modules

ImGui::ClassType
#flags : ImGuiViewportFlags#
View source

See ImGui::ImGuiViewportFlags

#pos : ImVec2#
View source

Main Area: Position of the viewport (Dear ImGui coordinates are the same as OS desktop/native coordinates)

#size : ImVec2#
View source

Main Area: Size of the viewport.

#work_pos : ImVec2#
View source

Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)

#work_size : ImVec2#
View source

Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)

Platform/Backend Dependent Data#

#platform_handle_raw : ::Pointer(Void)#
View source

void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)

Helpers#