Blackcomb  prealpha
Engine-ish
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
blackcomb::base::Window Class Reference

Object-oriented wrapper for GLFW's window functions. More...

#include <Window.h>

Collaboration diagram for blackcomb::base::Window:
Collaboration graph
[legend]

Public Member Functions

 Window (const char *name)
 
 Window (int width, int height)
 
 Window (int width, int height, const char *name)
 
void setInputMode (int mode, int value)
 Change input settings for this window.
 
void setShouldClose (bool shouldClose)
 Inform GLFW whether or not the window should be closed.
 
bool shouldClose ()
 
int getKey (int key)
 Get whether a key is pressed or released. More...
 
int getMouseButton (int button)
 Get whether a mouse button is pressed or released. More...
 
void makeContextCurrent ()
 Make this window the current OpenGL context.
 
GLFWwindow * getHandle ()
 
misc::Point2i getDims ()
 
void setFramebufferSizeCallback (GLFWframebuffersizefun fbSizeCallback)
 Sets the GLFW framebuffer size callback. More...
 
void setWindowTitle (const std::string &title)
 Sets the window title.
 
void hide ()
 Hide the window from view.
 
void show ()
 Show the window.
 

Static Public Member Functions

static void defaultSizeCallback (GLFWwindow *handle, int width, int height)
 

Public Attributes

input::MouseWatcher mouseWatcher
 

Detailed Description

Object-oriented wrapper for GLFW's window functions.

Member Function Documentation

◆ getDims()

misc::Point2i blackcomb::base::Window::getDims ( )
Returns
The window's width and height.

◆ getHandle()

GLFWwindow * blackcomb::base::Window::getHandle ( )
Returns
The pointer to the GLFWwindow this Window is responsible for.

◆ getKey()

int blackcomb::base::Window::getKey ( int  key)

Get whether a key is pressed or released.

Returns
GLFW_PRESS or GLFW_RELEASE

◆ getMouseButton()

int blackcomb::base::Window::getMouseButton ( int  button)

Get whether a mouse button is pressed or released.

Returns
GLFW_PRESS or GLFW_RELEASE

◆ setFramebufferSizeCallback()

void blackcomb::base::Window::setFramebufferSizeCallback ( GLFWframebuffersizefun  fbSizeCallback)

Sets the GLFW framebuffer size callback.

Parameters
fbSizeCallbackA function with the signature void framebufferSizeCallback(GLFWwindow *window, int width, int height).

◆ shouldClose()

bool blackcomb::base::Window::shouldClose ( )
Returns
Whether or not the window should be closed.

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