Function glfw::init[][src]

pub fn init<UserData: 'static>(
    callback: Option<ErrorCallback<UserData>>
) -> Result<Glfw, InitError>

Initializes the GLFW library. This must be called on the main platform thread.

Wrapper for glfwInit.

Error callback

An error callback can be set if desired. This allows for the handling of any errors that occur during initialization. This can subsequently be changed using the Glfw::set_error_callback function.

Example

extern crate glfw;

fn main() {
   let glfw = glfw::init(glfw::FAIL_ON_ERRORS).unwrap();
}

Returns