Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 790 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 790 Bytes

Example: gl-glfw

This is basic example showcasing glad-gl in combination with glfw.

To run the example use the following command:

./init.sh && cargo run

The init.sh script is just a small utility used to generate the glad-gl crate into the build/ directory. The Cargo.toml references the dependency using:

[dependencies]
glad-gl = { path = "./build/glad-gl" }

This example is the basic example of the glfw crate with some OpenGL instructions added and just one additional line to initialize glad:

    gl::load(|e| glfw.get_proc_address_raw(e) as *const std::os::raw::c_void);

That's all that is needed to initialize and use OpenGL using glad!