Handles library initialization and provides system information.
More...
#include <app.h>
|
static bool | init () |
| Initializes SGLTK.
|
static void | quit () |
| Deinitializes SGLTK.
|
static bool | init_glew () |
| Initializes GLEW.
|
static bool | init_img () |
| Initializes SDL2_img.
|
static void | quit_img () |
| Deinitializes SDL2_img.
|
static bool | init_sdl () |
| Initializes SDL2.
|
static void | quit_sdl () |
| Deinitializes SDL2.
|
static void | set_gl_version (int major, int minor) |
| Sets the OpenGL version.
|
static void | set_depth_stencil_size (int depth_size, int stencil_size) |
| Sets the size of the depth and stencil buffers.
|
static void | set_msaa_sample_number (int number_samples) |
| Sets the number of samples used for multisample anti-aliasing.
|
static void | enable_screensaver (bool enable) |
| Enables the screensaver.
|
static bool | enable_vsync (bool on) |
| Turns VSync on or off.
|
static bool | chdir_to_bin (char **argv) |
| Changes the current working directory to the directory containing the executable.
|
static void | get_sys_info () |
| Gathers system information and populates the sys_info attribute.
|
static void | _check_error (std::string message, std::string file, unsigned int line) |
| Outputs OpenGL error messages.
|
Handles library initialization and provides system information.
Definition at line 133 of file app.h.
◆ _check_error()
void App::_check_error |
( |
std::string | message, |
|
|
std::string | file, |
|
|
unsigned int | line ) |
|
static |
◆ chdir_to_bin()
bool App::chdir_to_bin |
( |
char ** | argv | ) |
|
|
static |
Changes the current working directory to the directory containing the executable.
- Parameters
-
argv | The array of command line arguments passed to the main function |
- Returns
- Returns true on success, false otherwise
Definition at line 158 of file app.cpp.
◆ enable_screensaver()
void App::enable_screensaver |
( |
bool | enable | ) |
|
|
static |
Enables the screensaver.
- Parameters
-
enable | True to enable or false to disable the screensaver |
Definition at line 137 of file app.cpp.
◆ enable_vsync()
bool App::enable_vsync |
( |
bool | on | ) |
|
|
static |
Turns VSync on or off.
- Parameters
-
on | True turns VSync on, false turns it off |
- Returns
- Returns false if VSync is not supported, true otherwise
Definition at line 144 of file app.cpp.
◆ get_sys_info()
void App::get_sys_info |
( |
| ) |
|
|
static |
Gathers system information and populates the sys_info attribute.
Definition at line 217 of file app.cpp.
◆ init()
Initializes SGLTK.
- Returns
- Returns true on success, false otherwise
Definition at line 64 of file app.cpp.
◆ init_glew()
Initializes GLEW.
- Returns
- Returns true on success, false otherwise
Definition at line 10 of file app.cpp.
◆ init_img()
Initializes SDL2_img.
- Returns
- Returns true on success, false otherwise
Definition at line 19 of file app.cpp.
◆ init_sdl()
Initializes SDL2.
- Returns
- Returns true on success, false otherwise
Definition at line 33 of file app.cpp.
◆ quit()
Deinitializes SGLTK.
Definition at line 127 of file app.cpp.
◆ quit_img()
Deinitializes SDL2_img.
Definition at line 29 of file app.cpp.
◆ quit_sdl()
Deinitializes SDL2.
Definition at line 45 of file app.cpp.
◆ set_depth_stencil_size()
void App::set_depth_stencil_size |
( |
int | depth_size, |
|
|
int | stencil_size ) |
|
static |
Sets the size of the depth and stencil buffers.
- Parameters
-
depth_size | The minimum size of the depth buffer in bits |
stencil_size | The minimum size of the stencil buffer in bits |
- Note
- This function needs to be called before a window is created.
Definition at line 117 of file app.cpp.
◆ set_gl_version()
void App::set_gl_version |
( |
int | major, |
|
|
int | minor ) |
|
static |
Sets the OpenGL version.
- Parameters
-
major | The major version number |
minor | The minor version number |
- Note
- This function needs to be called before a window is created. If the parameter combination is not valid, version defaults to 3.0
Definition at line 89 of file app.cpp.
◆ set_msaa_sample_number()
void App::set_msaa_sample_number |
( |
int | number_samples | ) |
|
|
static |
Sets the number of samples used for multisample anti-aliasing.
- Parameters
-
number_samples | The number of samples to be used |
Definition at line 122 of file app.cpp.
◆ error_string
std::vector< std::string > App::error_string = {} |
|
static |
A list of all error strings.
Definition at line 151 of file app.h.
◆ gl_version_manual
bool App::gl_version_manual = false |
|
static |
True if set_gl_version was called, false otherwise.
Definition at line 143 of file app.h.
◆ sys_info
System information.
Definition at line 147 of file app.h.
The documentation for this class was generated from the following files:
- /home/fstdb/proj/sgltk_example/sgltk/src/app.h
- /home/fstdb/proj/sgltk_example/sgltk/src/app.cpp