-
Notifications
You must be signed in to change notification settings - Fork 1
Initialization
Before you start using sgltk you need to initialize it. This is done by calling the init function of the App class in the sgltk namespace.
bool init = sgltk::App::init();
if(!init) {
std::cerr << "Error on initializing sgltk" << std::endl;
}
This will initialize some libraries sgltk uses, read out the platform information (see sgltk::App::sys_info) and set some parameters that will be needed later on to create a window with OpenGL context.
While no additional steps are necessary, you may want to set some parameters manually. This must be done before opening a window. sgltk determines the most recent supported OpenGL version automatically when you open a window unless you have set the OpenGL version you want to use manually.
sgltk::App::set_gl_version(3, 0);
Note that sgltk only supports OpenGL versions 3.0 to 4.6 and will default to version 3.0 if you try to manually set an invalid OpenGL version!
By default sgltk sets the precision of the depth buffer to 24 bit and that of the stencil buffer to 8 bit. This can be manually changed however.
sgltk::App::set_depth_stencil_size(16, 0);
Once you're done using sgltk you should deinitialize it.
sgltk::App::quit();