CPP-TOOLBOX
Loading...
Searching...
No Matches
Window Class Reference

#include <window.hpp>

Public Member Functions

 Window (unsigned int width_px=700, unsigned int height_px=700, const std::string &window_name="my program", bool start_in_fullscreen=false, bool start_with_mouse_captured=false, bool vsync=false, bool print_out_opengl_data=false)
 
 ~Window ()
 
void print_opengl_info ()
 make a glfw window
 
void toggle_mouse_mode ()
 
void disable_cursor ()
 
void enable_cursor ()
 
bool window_should_close ()
 
void enable_wireframe_mode ()
 
void disable_wireframe_mode ()
 
void set_resolution (const std::string &resolution)
 
void toggle_fullscreen ()
 
void enable_fullscreen ()
 
void disable_fullscreen ()
 
void set_fullscreen_by_on_off (const std::string &on_off_string)
 
std::tuple< unsigned int, unsigned int > reduce_ratio (std::tuple< unsigned int, unsigned int > ratio)
 
std::tuple< unsigned int, unsigned int > get_aspect_ratio_in_simplest_terms ()
 
std::function< void(double)> wrap_tick_with_required_glfw_calls (std::function< void(double)> tick)
 

Public Attributes

unsigned int width_px
 
unsigned int height_px
 
int top_left_corner_of_window_x
 
int top_left_corner_of_window_y
 
GLFWwindow * glfw_window
 
bool cursor_is_disabled = false
 
bool window_in_fullscreen = false
 

Constructor & Destructor Documentation

◆ Window()

Window::Window ( unsigned int width_px = 700,
unsigned int height_px = 700,
const std::string & window_name = "my program",
bool start_in_fullscreen = false,
bool start_with_mouse_captured = false,
bool vsync = false,
bool print_out_opengl_data = false )

◆ ~Window()

Window::~Window ( )

Member Function Documentation

◆ disable_cursor()

void Window::disable_cursor ( )

◆ disable_fullscreen()

void Window::disable_fullscreen ( )

◆ disable_wireframe_mode()

void Window::disable_wireframe_mode ( )

◆ enable_cursor()

void Window::enable_cursor ( )

◆ enable_fullscreen()

void Window::enable_fullscreen ( )

◆ enable_wireframe_mode()

void Window::enable_wireframe_mode ( )

◆ get_aspect_ratio_in_simplest_terms()

std::tuple< unsigned int, unsigned int > Window::get_aspect_ratio_in_simplest_terms ( )
inline

◆ print_opengl_info()

void Window::print_opengl_info ( )

make a glfw window

create a glfw window for opengl3.3 core and load in opengl function pointers (implementation)

Parameters
screen_widththe requested screen height
screen_heightthe requested screen width
Returns
an optional window, based on whether or not initialization was successful

◆ reduce_ratio()

std::tuple< unsigned int, unsigned int > Window::reduce_ratio ( std::tuple< unsigned int, unsigned int > ratio)
inline

◆ set_fullscreen_by_on_off()

void Window::set_fullscreen_by_on_off ( const std::string & on_off_string)

◆ set_resolution()

void Window::set_resolution ( const std::string & resolution)

◆ toggle_fullscreen()

void Window::toggle_fullscreen ( )

◆ toggle_mouse_mode()

void Window::toggle_mouse_mode ( )

◆ window_should_close()

bool Window::window_should_close ( )
inline

◆ wrap_tick_with_required_glfw_calls()

std::function< void(double)> Window::wrap_tick_with_required_glfw_calls ( std::function< void(double)> tick)
inline

Member Data Documentation

◆ cursor_is_disabled

bool Window::cursor_is_disabled = false

◆ glfw_window

GLFWwindow* Window::glfw_window

◆ height_px

unsigned int Window::height_px

◆ top_left_corner_of_window_x

int Window::top_left_corner_of_window_x

◆ top_left_corner_of_window_y

int Window::top_left_corner_of_window_y

◆ width_px

unsigned int Window::width_px

◆ window_in_fullscreen

bool Window::window_in_fullscreen = false

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