CoriEngine
Loading...
Searching...
No Matches
Cori::Core::Window Class Reference

This class manages everything that is connected with physical Window management, i might add multiwindow support later, but for now, only one Window per application. More...

#include <Window.hpp>

Inheritance diagram for Cori::Core::Window:
Collaboration diagram for Cori::Core::Window:

Classes

struct  Data

Public Member Functions

 ~Window ()
int32_t GetWidth () const
 Give the current window width.
int32_t GetHeight () const
 Give the current window height.
void SetVSync (const bool status)
 Changes the VSync state.
bool IsVSync () const
 Checks is VSynch is currently enabled.
const std::vector< ScreenMode > & GetScreenModes () const
 Retrieves a list of all available ScreenMode.
std::expected< void, CoriError<> > SetScreenMode (const uint32_t modeIndex)
 Changes the current ScreenMode.
WindowMode GetWindowMode () const
 Gets the current WindowMode;.
uint32_t GetCurrentScreenMode () const
 Retrieves the current screen mode index.
std::expected< void, CoriError<> > SetWindowMode (WindowMode mode)
 Changes the current WindowMode.

Static Public Member Functions

static Graphics::GraphicsAPIs GetCurrentAPI ()
 Returns the graphical API used by this window.

Friends

class Application

Detailed Description

This class manages everything that is connected with physical Window management, i might add multiwindow support later, but for now, only one Window per application.

Definition at line 43 of file Window.hpp.

Constructor & Destructor Documentation

◆ ~Window()

Cori::Core::Window::~Window ( )

Definition at line 148 of file Window.cpp.

Member Function Documentation

◆ GetCurrentAPI()

Graphics::GraphicsAPIs Cori::Core::Window::GetCurrentAPI ( )
inlinestaticnodiscard

Returns the graphical API used by this window.

Returns
API enumerator.

Definition at line 63 of file Window.hpp.

◆ GetCurrentScreenMode()

uint32_t Cori::Core::Window::GetCurrentScreenMode ( ) const
nodiscard

Retrieves the current screen mode index.

Returns
Index of the current screen mode in the screen modes vector (obtainable via GetScreenModes).

Definition at line 283 of file Window.cpp.

◆ GetHeight()

int32_t Cori::Core::Window::GetHeight ( ) const
nodiscard

Give the current window height.

Returns
Window height in pixels.

Definition at line 232 of file Window.cpp.

◆ GetScreenModes()

const std::vector< ScreenMode > & Cori::Core::Window::GetScreenModes ( ) const
nodiscard

Retrieves a list of all available ScreenMode.

Returns
A const reference to the vector containing all available ScreenMode.

Definition at line 270 of file Window.cpp.

◆ GetWidth()

int32_t Cori::Core::Window::GetWidth ( ) const
nodiscard

Give the current window width.

Returns
Window width in pixels.

Definition at line 225 of file Window.cpp.

◆ GetWindowMode()

WindowMode Cori::Core::Window::GetWindowMode ( ) const
nodiscard

Gets the current WindowMode;.

Returns
Enumerator of the current WindowMode.

Definition at line 279 of file Window.cpp.

◆ IsVSync()

bool Cori::Core::Window::IsVSync ( ) const
nodiscard

Checks is VSynch is currently enabled.

Returns
True enabled, false disabled.

Definition at line 257 of file Window.cpp.

◆ SetScreenMode()

std::expected< void, CoriError<> > Cori::Core::Window::SetScreenMode ( const uint32_t modeIndex)

Changes the current ScreenMode.

Parameters
modeIndexIndex of the screen mode in the screen modes vector (obtainable via GetScreenModes).
Returns
Expected object with void on success or CoriError<> on failure.

Definition at line 274 of file Window.cpp.

Here is the call graph for this function:

◆ SetVSync()

void Cori::Core::Window::SetVSync ( const bool status)

Changes the VSync state.

Parameters
statusTrue enable, false disable.

Definition at line 245 of file Window.cpp.

◆ SetWindowMode()

std::expected< void, CoriError<> > Cori::Core::Window::SetWindowMode ( WindowMode mode)

Changes the current WindowMode.

Parameters
modeWindowMode enumerator to change to.
Returns
Expected object with void on success or CoriError<> on failure.

Definition at line 288 of file Window.cpp.

Here is the call graph for this function:

◆ Application

friend class Application
friend

Definition at line 124 of file Window.hpp.


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