Rune Engine  Version 0.2.7-alpha
Documentation for how to make games using the Rune Engine.
rune::RenderWindow Class Reference

A window that the game can be drawn to. More...

#include <renderWindow.h>

Public Member Functions

Camera getCamera (void)
 Get the camera currently being used by the scene.
 
void setCamera (Camera &)
 Set a camera to be used by the scene.
 
 RenderWindow (int newWidth, int newHeight, std::string const &title)
 Default constructor to give an openGL context and window. More...
 
 ~RenderWindow (void)
 Destructor to handle window clean up.
 
void draw (Drawable &)
 Renders a drawable to the screen. More...
 
void setWindowTitle (std::string const &)
 Set the window title. More...
 
void display (void)
 Display on screen what has been rendered to the window so far.
 
void clear (rune::Color)
 Clear the entire screen with a single color. More...
 
bool isOpen (void)
 Tell whether or not the window is open. More...
 
rune::Vec2 getSize (void)
 Gets the current size of the RenderWindow. More...
 
void enableVsync (bool enable)
 Enables or disables Vsync. More...
 
void close (void)
 Close the window.
 
GLFWwindow * GetGLWindow ()
 Return a pointer to the OpenGL window. More...
 
void maximizeWindow (void)
 Maximize the currently open window.
 

Static Public Member Functions

static rune::Vec2 getDesktopSize (void)
 Returns the size of the current monitor in pixels.
 

Detailed Description

A window that the game can be drawn to.

Author
Thomas Montano
Date
April 20 2020

Constructor & Destructor Documentation

◆ RenderWindow()

rune::RenderWindow::RenderWindow ( int  newWidth,
int  newHeight,
std::string const &  title 
)

Default constructor to give an openGL context and window.

Parameters
newWidthThe width of the window in pixels to be created.
newHeightThe height of the window in pixels to be created.
titleThe title of the window to be displayed at the top.

Member Function Documentation

◆ clear()

void rune::RenderWindow::clear ( rune::Color  clearColor)

Clear the entire screen with a single color.

Parameters
clearColorThe color that the screen should be cleared with.

◆ draw()

void rune::RenderWindow::draw ( Drawable drawObject)

Renders a drawable to the screen.

Parameters
drawObjectDrawable that should be displayed on the screen.

◆ enableVsync()

void rune::RenderWindow::enableVsync ( bool  enable)

Enables or disables Vsync.

Parameters
enableWhether or not Vsync should be turned on.

◆ GetGLWindow()

GLFWwindow * rune::RenderWindow::GetGLWindow ( )

Return a pointer to the OpenGL window.

Returns
A pointer for the GLFW window.

◆ getSize()

rune::Vec2 rune::RenderWindow::getSize ( void  )

Gets the current size of the RenderWindow.

Returns
A rune::Vec2 corresponding to the size in pixels of the RenderWindow.

◆ isOpen()

bool rune::RenderWindow::isOpen ( void  )

Tell whether or not the window is open.

Returns
Whether or not the RenderWindow is currently open.

◆ setWindowTitle()

void rune::RenderWindow::setWindowTitle ( std::string const &  newTitle)

Set the window title.

Parameters
newTitleThe title that should be displayed on the window.

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