build.rs 440 B

123456789101112131415
  1. extern crate gl_generator;
  2. use gl_generator::{Api, Fallbacks, GlobalGenerator, Profile, Registry};
  3. use std::env;
  4. use std::fs::File;
  5. use std::path::Path;
  6. fn main() {
  7. let dest = env::var("OUT_DIR").unwrap();
  8. let mut file = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap();
  9. Registry::new(Api::Gl, (3, 0), Profile::Core, Fallbacks::All, [])
  10. .write_bindings(GlobalGenerator, &mut file)
  11. .unwrap();
  12. }