Vivid
Loading...
Searching...
No Matches
Window Class Reference

A class that represents a window and is wrapper of GLFWwindow. More...

#include <Window.h>

Public Member Functions

void Clear () const
 
void Update ()
 
int GetWidth () const
 
int GetHeight () const
 
GLFWwindow * GetGLFWWindow () const
 
float GetAspectRatio () const
 
void SetRenderingInterface (RenderingInterface *renderingInterface)
 Sets the rendering interface.
 
Vivid::Maths::Vec2 GetViewportPosition ()
 
float GetViewportWidth ()
 
float GetViewportHeight ()
 

Static Public Member Functions

static WindowInit (int width, int height, const char *title)
 Initializes the window.
 

Detailed Description

A class that represents a window and is wrapper of GLFWwindow.

This class contains functions to clear the window, update the window, get the width of the window, get the height of the window, get the GLFW window, get the aspect ratio of the window, set the rendering interface, get the viewport position, get the viewport width, and get the viewport height.

Definition at line 14 of file Window.h.

Member Function Documentation

◆ Clear()

void Window::Clear ( ) const

Definition at line 72 of file Window.cpp.

◆ GetAspectRatio()

float Window::GetAspectRatio ( ) const
inline

Definition at line 46 of file Window.h.

◆ GetGLFWWindow()

GLFWwindow * Window::GetGLFWWindow ( ) const
inline

Definition at line 45 of file Window.h.

◆ GetHeight()

int Window::GetHeight ( ) const
inline

Definition at line 44 of file Window.h.

◆ GetViewportHeight()

float Window::GetViewportHeight ( )
inline

Definition at line 57 of file Window.h.

◆ GetViewportPosition()

Vivid::Maths::Vec2 Window::GetViewportPosition ( )
inline

Definition at line 55 of file Window.h.

◆ GetViewportWidth()

float Window::GetViewportWidth ( )
inline

Definition at line 56 of file Window.h.

◆ GetWidth()

int Window::GetWidth ( ) const
inline

Definition at line 43 of file Window.h.

◆ Init()

Window * Window::Init ( int  width,
int  height,
const char *  title 
)
static

Initializes the window.

Initializes the window with the width, height, and title. Only one window exists at a time.

Returns
Window* The window. If the window already exists, it returns the window.

Definition at line 64 of file Window.cpp.

◆ SetRenderingInterface()

void Window::SetRenderingInterface ( RenderingInterface renderingInterface)

Sets the rendering interface.

Sets the rendering interface to the rendering interface passed in.

Parameters
renderingInterfaceThe rendering interface to set.

Definition at line 77 of file Window.cpp.

◆ Update()

void Window::Update ( )

Definition at line 86 of file Window.cpp.


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