Ember::Window

A class that handles a majority of the window's functionality

Methods

Method Descriptions

void setScreenSize(unsigned int width, unsigned int height);

Window setter to define the default screen size. This must be called in the application constructor.

this->window->setScreenSize(800, 600);

void setTitle(const std::string& title);

Window setter to define the default title of the window. This must be called in the application constructor.

this->window->setTitle("Example Application");

void setFullscreen(bool fullscreen);

Window setter to define if the window should be fullscreen or not. This must be called in the application constructor.

this->window->setFullscreen(false);

void setResizable(bool resizable);

Window setter to define if the window should be resizable or not. This must be called in the application constructor.

this->window->setResizable(false);

void setVsync(bool vsync);

Window setter to define if the window should use vsync or not. This must be called in the application constructor.

this->window->setVsync(true);

void setTargetFPS(unsigned int targetFPS);

Window setter to define how many times the game loop is allowed to update per second.

this->window->setTargetFPS(60);

unsigned int getWidth() const;

Window getter to get the width of the window.

unsigned int width = this->window->getWidth();

unsigned int getHeight() const;

Window getter to get the height of the window.

unsigned int height = this->window->getHeight();

const std::string& getTitle() const;

Window getter to get the title of the window.

const std::string& title = this->window->getTitle();

bool isFullscreen() const;

Window getter to get if the window is fullscreen or not.

bool fullscreen = this->window->getFullscreen();

bool isResizable() const;

Window getter to get if the window can be resized or not.

bool resizable = this->window->getResizable();

bool isVsync() const;

Window getter to get if the window is using vsync or not.

bool vsync = this->window->getVsync();

unsigned int getTargetFPS() const;

Window getter to get the target FPS.

unsigned int targetFPS = this->window->getTargetFPS();

unsigned int getFPS() const;

Window getter to get the current FPS.

unsigned int currentFPS = this->window->getFPS();

Last updated