Brenta Engine 1.1
|
Screen subsystem. More...
#include <screen.hpp>
Static Public Member Functions | |
static void | init (int SCR_WIDTH, int SCR_HEIGHT, bool is_mouse_captured=false, const char *title="OpenGL", bool msaa=false, bool vsync=false) |
Initialize the window. | |
static int | get_width () |
Get the width of the window. | |
static int | get_height () |
Get the height of the window. | |
static bool | is_window_closed () |
Check if the window is closed. | |
static bool | is_key_pressed (int key) |
Check if a key is pressed. | |
static float | get_time () |
Get the time. | |
static GLFWwindow * | get_window () |
Get the window. | |
static GLFWglproc | get_proc_address () |
Get the OpenGL function pointer. | |
static void | set_mouse_callback (GLFWcursorposfun callback) |
Set the mouse callback. | |
static void | set_size_callback (GLFWframebuffersizefun callback) |
Set the key callback. | |
static void | set_mouse_pos_callback (GLFWcursorposfun callback) |
Set the mouse position callback. | |
static void | set_key_callback (GLFWkeyfun callback) |
Set the key callback. | |
static void | set_mouse_capture (bool is_captured) |
Set the mouse capture. | |
static void | set_close () |
Set the window close flag. | |
static void | swap_buffers () |
Swap the front and back buffers. | |
static void | poll_events () |
Poll all pending events. | |
static void | terminate () |
Terminate the window. | |
Static Public Attributes | |
static int | WIDTH |
Width of the window. | |
static int | HEIGHT |
Height of the window. | |
static GLFWwindow * | window |
Pointer to the window. | |
Screen subsystem.
This class is used to create a window and handle all the events related to the window. This class provides methods to initialize the window, get the window size, check if a key is pressed, get the time since the start of the program, and more.
Definition at line 47 of file screen.hpp.
|
static |
Get the height of the window.
Definition at line 110 of file screen.cpp.
|
static |
Get the OpenGL function pointer.
Definition at line 100 of file screen.cpp.
|
static |
|
static |
|
static |
|
static |
Initialize the window.
This method initializes the window with the given width and height, and sets the title of the window. The window is created with the given parameters.
SCR_WIDTH | Width of the window |
SCR_HEIGHT | Height of the window |
is_mouse_captured | If the mouse is captured |
title | Title of the window |
msaa | If multisampling is enabled |
vsync | If vertical synchronization is enabled |
Definition at line 42 of file screen.cpp.
|
static |
Check if a key is pressed.
key | Key to check |
Definition at line 85 of file screen.cpp.
|
static |
Check if the window is closed.
Definition at line 80 of file screen.cpp.
|
static |
Poll all pending events.
Definition at line 159 of file screen.cpp.
|
static |
Set the window close flag.
Definition at line 141 of file screen.cpp.
|
static |
|
static |
Set the mouse callback.
callback | Callback to set |
Definition at line 115 of file screen.cpp.
|
static |
Set the mouse capture.
isCaptured | If the mouse is captured |
Definition at line 127 of file screen.cpp.
|
static |
Set the mouse position callback.
callback | Callback to set |
Definition at line 177 of file screen.cpp.
|
static |
|
static |
Swap the front and back buffers.
Having to buffers is done to avoid flickering.
Definition at line 154 of file screen.cpp.
|
static |
Terminate the window.
Definition at line 146 of file screen.cpp.
|
static |
Height of the window.
Definition at line 57 of file screen.hpp.
|
static |
Width of the window.
Definition at line 53 of file screen.hpp.
|
static |
Pointer to the window.
Definition at line 61 of file screen.hpp.