Nameless Engine
Loading...
Searching...
No Matches
ne::WindowBuilder Class Reference

#include <Window.h>

Public Member Functions

WindowBuilderwithSize (int iWidth, int iHeight)
 
WindowBuilderwithTitle (std::string_view sWindowTitle)
 
WindowBuilderwithIcon (const std::filesystem::path &pathToIcon)
 
WindowBuilderwithVisibility (bool bShow)
 
WindowBuilderwithMaximizedState (bool bMaximized)
 
WindowBuilderwithSplashScreenMode (bool bIsSplashScreen)
 
WindowBuilderwithFullscreenMode (bool bEnableFullscreen)
 
std::variant< std::unique_ptr< Window >, Errorbuild ()
 

Private Attributes

WindowBuilderParameters params
 

Detailed Description

Builder pattern class for Window.

Member Function Documentation

◆ build()

std::variant< std::unique_ptr< Window >, Error > ne::WindowBuilder::build ( )

Builds/creates a new window with the configured parameters.

Returns
Returns error if something went wrong or created window otherwise.
Warning
This function should only be called from the main thread.

◆ withFullscreenMode()

WindowBuilder & ne::WindowBuilder::withFullscreenMode ( bool  bEnableFullscreen)

Whether a window should be shown in the fullscreen mode or not.

Remarks
Note that your application might have better performance and more stable frame pacing if you run it in fullscreen mode.
Parameters
bEnableFullscreenFullscreen mode.
Returns
Builder.

◆ withIcon()

WindowBuilder & ne::WindowBuilder::withIcon ( const std::filesystem::path &  pathToIcon)

Defines the icon of a window that we will create.

Parameters
pathToIconPath to the image (.png).
Returns
Builder.

◆ withMaximizedState()

WindowBuilder & ne::WindowBuilder::withMaximizedState ( bool  bMaximized)

Whether the window should be maximized after creation or not. Does nothing for fullscreen windows.

Parameters
bMaximizedShould window be maximized or not.
Returns
Builder.

◆ withSize()

WindowBuilder & ne::WindowBuilder::withSize ( int  iWidth,
int  iHeight 
)

Defines the size of a window that we will create.

Parameters
iWidthWidth of the window.
iHeightHeight of the window.
Returns
Builder.

◆ withSplashScreenMode()

WindowBuilder & ne::WindowBuilder::withSplashScreenMode ( bool  bIsSplashScreen)

Whether the window should look like a splash screen or not (no border, title, buttons, etc). Does nothing for fullscreen windows.

Parameters
bIsSplashScreenShould window look like a splash screen or not.
Returns
Builder.

◆ withTitle()

WindowBuilder & ne::WindowBuilder::withTitle ( std::string_view  sWindowTitle)

Defines the name of a window that we will create.

Parameters
sWindowTitleTitle of the window.
Returns
Builder.

◆ withVisibility()

WindowBuilder & ne::WindowBuilder::withVisibility ( bool  bShow)

Defines the visibility of a window that we will create. Does nothing for fullscreen windows.

Parameters
bShowVisibility of the window.
Returns
Builder.

Member Data Documentation

◆ params

WindowBuilderParameters ne::WindowBuilder::params
private

Configured window parameters.


The documentation for this class was generated from the following files: