Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Window Class Reference

Represent an OS window and its associated rendering context. More...

#include <Window.hpp>

Public Types

enum class  Action : uint { None , Quit , Fullscreen , Vsync }
 

Public Member Functions

 Window (const std::string &name, RenderingConfig &config, bool escapeQuit=true, bool hidden=false)
 
void perform (Action action)
 
bool nextFrame ()
 
void setViewport ()
 
Texturecolor ()
 
 Window (const Window &)=delete
 
Windowoperator= (const Window &)=delete
 
 Window (Window &&)=delete
 
Windowoperator= (Window &&)=delete
 
 ~Window ()
 

Private Member Functions

void setupImGui ()
 

Private Attributes

RenderingConfig_config
 The window configuration.
 
GLFWwindow * _window = nullptr
 Internal window handle.
 
std::unique_ptr< Swapchain_swapchain
 The swapchain displaying backbuffers.
 
ImGui_ImplVulkan_InitInfo * _imgui = nullptr
 ImGui setup information.
 
bool _frameStarted = false
 Has a frame been started.
 
bool _allowEscape = false
 Can the window be closed by pressing escape.
 

Friends

class GPU
 

Detailed Description

Represent an OS window and its associated rendering context.

Member Enumeration Documentation

◆ Action

enum class Window::Action : uint
strong

System actions that can be executed by the window.

Enumerator
None 

Do nothing.

Quit 

Quit the application.

Fullscreen 

Switch the window from/to fullscreen mode.

Vsync 

Switch the v-sync on/off.

Constructor & Destructor Documentation

◆ Window() [1/3]

Window::Window ( const std::string &  name,
RenderingConfig config,
bool  escapeQuit = true,
bool  hidden = false 
)

Create a new window backed by a GPU context.

Parameters
namethe name of the window
configthe configuration to use (additional info will be added to it)
escapeQuitallows the user to close the window by pressing escape
hiddenshould the window be hidden (for preprocess for instance)
Note
We might want to impose the configured size here. This means the monitor could be set in a non-native mode.

◆ Window() [2/3]

Window::Window ( const Window )
delete

Copy constructor.

◆ Window() [3/3]

Window::Window ( Window &&  )
delete

Move constructor.

◆ ~Window()

Window::~Window ( )

Destructor. Clean resources, delete the window and its context.

Member Function Documentation

◆ color()

Texture & Window::color ( )
Returns
the backbuffer color texture

◆ nextFrame()

bool Window::nextFrame ( )

Start registering GUI items.

Returns
true if the next frame is valid.
Note
If the frame is invalid, the window should be cleaned and closed.

◆ operator=() [1/2]

Window & Window::operator= ( const Window )
delete

Copy assignment.

Returns
a reference to the object assigned to

◆ operator=() [2/2]

Window & Window::operator= ( Window &&  )
delete

Move assignment.

Returns
a reference to the object assigned to

◆ perform()

void Window::perform ( Action  action)

Execute an action related to the windowing system.

Parameters
actionthe system action to perform

◆ setupImGui()

void Window::setupImGui ( )
private

Setup ImGui with the proper callbacks and style.

◆ setViewport()

void Window::setViewport ( )

Set the viewport to the window dimensions


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