carb::simplegui::Viewport

Defined in carb/simplegui/SimpleGuiTypes.h

struct carb::simplegui::Viewport

The viewports created and managed by simplegui.

The role of the platform back-end is to create the platform/OS windows corresponding to each viewport.

Public Functions

inline Viewport()

Constructor.

inline ~Viewport()

Destructor.

Public Members

uint32_t id

Unique identifier.

ViewportFlags flags

Flags describing this viewport.

carb::Float2 pos

Position of viewport both in simplegui space and in OS desktop/native space.

carb::Float2 size

Size of viewport in pixel.

float dpiScale

1.0f = 96 DPI = No extra scale

DrawData *drawData

The ImDrawData corresponding to this viewport. Valid after Render() and until the next call to NewFrame().

uint32_t parentViewportId

(Advanced) 0: no parent. Instruct the platform back-end to setup a parent/child relationship between platform windows.

void *rendererUserData

void* to hold custom data structure for the renderer (e.g. swap chain, frame-buffers etc.)

void *platformUserData

void* to hold custom data structure for the platform (e.g. windowing info, render context)

void *platformHandle

void* for FindViewportByPlatformHandle(). (e.g. suggested to use natural platform handle such as HWND, GlfwWindow*, SDL_Window*)

bool platformRequestMove

Platform window requested move (e.g. window was moved by the OS / host window manager, authoritative position will be OS window position)

bool platformRequestResize

Platform window requested resize (e.g. window was resized by the OS / host window manager, authoritative size will be OS window size)

bool platformRequestClose

Platform windosw requested closure (e.g. window was moved by the OS / host window manager, e.g. pressing ALT-F4)