BMC Engine v1.0.0
An open-source game engine powered by C and C++
Loading...
Searching...
No Matches
Window Class Reference

#include <Window.h>

Public Member Functions

 Window (const char *title, int width, int height)
 
 Window (const char *title, Vector2 size)
 
 Window (const char *title)
 
 ~Window ()
 
bool shouldClose ()
 
void setIcon (const char *file)
 
void setSize (int width, int height)
 
void setSize (Vector2 size)
 
void initImGui ()
 
void close ()
 
void maximize ()
 
int getWidth ()
 
int getHeight ()
 
Vector2getSize ()
 
GLFWwindow * getWindow ()
 

Detailed Description

An easier implementation for creating a GLFW window, instead of using GLFW functions.

Constructor & Destructor Documentation

◆ Window() [1/3]

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

Creates the window object.

Parameters
titleconst char* to assign to the window's name to.
widthThe width, in pixels, to create the window with.
heightThe height, in pixels, to create the window with.

◆ Window() [2/3]

Window::Window ( const char * title,
Vector2 size )

Creates the window object.

Parameters
titleconst char* to assign to the window's name to.
sizeThe size, as a Vector2, to set the window size to.

◆ Window() [3/3]

Window::Window ( const char * title)

Creates the window object.

Parameters
titleconst char* to assign to the window's name to.

◆ ~Window()

Window::~Window ( )

Delete the window and clean up GLFW.

Member Function Documentation

◆ close()

void Window::close ( )

Call glfwSetWindowShouldClose to tell GLFW to close the window.

◆ getHeight()

int Window::getHeight ( )
Returns
The height of the window, in pixels.

◆ getSize()

Vector2 * Window::getSize ( )
Returns
A pointer to the window's size, as a Vector2.

◆ getWidth()

int Window::getWidth ( )
Returns
The width of the window, in pixels.

◆ getWindow()

GLFWwindow * Window::getWindow ( )
Returns
A pointer to the GLFWwindow associated with this Window class.

◆ initImGui()

void Window::initImGui ( )

Initialize ImGui

◆ maximize()

void Window::maximize ( )

Maximize the window.

◆ setIcon()

void Window::setIcon ( const char * file)

Sets the icon of the window on the taskbar and title bar.

Parameters
fileThe file path to set the icon to.

◆ setSize() [1/2]

void Window::setSize ( int width,
int height )

Set the size of the window.

Parameters
widthThe width, in pixels, to set.
heightThe height, in pixels, to set.

◆ setSize() [2/2]

void Window::setSize ( Vector2 size)

Set the size of the window.

Parameters
sizeThe size, as a Vector2, to set.

◆ shouldClose()

bool Window::shouldClose ( )
Returns
Is the window still open?

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