[][src]Crate gl_loader

gl_loader : A simple OpenGL function pointer loader.

This (small) package aim to do only one thing: Provide a get_proc_address function to load OpenGL function pointer. It will not provide any form of window or OpenGL context creation. You will have to handle them by yourself. The code is simply a binding to the pointer loading part of the glad library: glad

Usage:

extern crate gl;
extern crate gl_loader;

// Load OpenGL library.
gl_loader::init_gl();
// Load all the OpenGL function pointer using the `gl` crate.
gl::load_with(|symbol| gl_loader::get_proc_address(symbol) as *const _);
// Unload the OpenGL library.
gl_loader::end_gl();

Functions

end_gl

Close the OpenGL library. This function does nothing if init_gl() has not been called.

get_proc_address

This function take an OpenGL function name and output its function pointer.

init_gl

Load the OpenGL system library. It is usually necesseray to be able to load function pointer.