LLGL 0.05 Beta
Loading...
Searching...
No Matches
LLGL::WindowFlags Struct Reference

Window creation flags. More...

#include <WindowFlags.h>

Public Types

enum  {
  Visible = (1 << 0) , Borderless = (1 << 1) , Resizable = (1 << 2) , Centered = (1 << 3) ,
  AcceptDropFiles = (1 << 4) , DisableClearOnResize = (1 << 5) , DisableSizeScaling = (1 << 6)
}

Detailed Description

Window creation flags.

See also
WindowDescriptor::flags

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Visible 

Specifies whether the window is visible at creation time.

Borderless 

Specifies whether the window is borderless. This is required for a fullscreen swap-chain.

Resizable 

Specifies whether the window can be resized.

Remarks
For every window representing the surface for a SwapChain which has been resized, the video mode of that SwapChain must be updated with the resolution of the surface's content size. This can be done by resizing the swap-chain buffers to the new resolution before the respective swap-chain is bound to a render pass, or it can be handled by a window event listener inside a custom OnResize callback:
// Alternative 1
class MyEventListener : public LLGL::Window::EventListener {
void OnResize(LLGL::Window& sender, const LLGL::Extent2D& clientAreaSize) override {
mySwapChain->ResizeBuffers(clientAreaSize);
}
};
myWindow->AddEventListener(std::make_shared<MyEventListener>());
// Alternative 2
mySwapChain->ResizeBuffers(myWindow->GetSize());
myCmdBuffer->BeginRenderPass(*mySwapChain);
Interface for all window event listeners.
Definition Window.h:45
virtual void OnResize(Window &sender, const Extent2D &clientAreaSize)
Sent when the window has been resized.
Window interface for desktop platforms.
Definition Window.h:32
2-Dimensional extent structure.
Definition Types.h:27
Note
Not updating the swap-chain on a resized window is undefined behavior.
See also
Surface::GetSize
Window::EventListener::OnResize
Centered 

Specifies whether the window is centered within the desktop screen at creation time.

Remarks
If this is specifies, the position field of the WindowDescriptor will be ignored.
AcceptDropFiles 

Specifies whether the window allows that files can be dragged-and-dropped onto the window.

Note
Only supported on: MS/Windows.
DisableClearOnResize 

Specifies not to clear the content of the window when it is resized.

Remarks
This is used by Win32 to erase (WM_ERASEBKGND message) or keep the background on a window resize. It is recommended to enable this flag alongside Resizable when such a Window is re-drawn during the OnResize event to avoid flickering.
Note
Only supported on: MS/Windows.
See also
Window::EventListener::OnResize
DisableSizeScaling 

Specifies not to multiply the window size by the backing scale factor.

Remarks
This is to control whether to transform the size from window coordinates into screen resolution coordinates.
Note
Only supported on: macOS and iOS.
See also
Display::GetScale

The documentation for this struct was generated from the following file: