[][src]Function blaze_rs::load

pub fn load(loader: GLProcLoader) -> CallResult

Loads OpenGL functions used by this library. Requires an active window with an OpenGL context (version 3.0 core and above).

Example (using SDL2)

   use blaze_rs::load;
   use sdl2::video::GLProfile;

   let context = sdl2::init().unwrap();
   let video_sys = context.video().unwrap();
   let gl_attr = video_sys.gl_attr();
   gl_attr.set_context_profile(GLProfile::Core);
   gl_attr.set_context_version(3, 0);
   let window = video_sys.window("Test", 800, 600)
       .opengl()
       .build()
       .unwrap();
   let _ctx = window.gl_create_context().unwrap();

   match load(sdl2::sys::SDL_GL_GetProcAddress) {
       Ok(_) => {}
       Err(e) => panic!(e),
   }