This repository has been archived by the owner on Apr 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rs
45 lines (40 loc) · 1.53 KB
/
build.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
extern crate gl_generator;
extern crate khronos_api;
use std::env;
use std::fs::File;
use std::path::{Path, PathBuf};
fn main() {
let target = env::var("TARGET").unwrap();
let out = PathBuf::from(&env::var("OUT_DIR").unwrap());
println!("rerun-if-changed=build.rs");
if target.contains("windows") {
let mut file = File::create(&out.join(Path::new("wgl.rs"))).unwrap();
gl_generator::generate_bindings(
gl_generator::StaticGenerator,
gl_generator::registry::Ns::Wgl,
gl_generator::Fallbacks::All,
khronos_api::WGL_XML,
vec![],
"1.0", "core", &mut file
).unwrap();
let mut file = File::create(&out.join(Path::new("wgl_ex.rs"))).unwrap();
gl_generator::generate_bindings(
gl_generator::StructGenerator,
gl_generator::registry::Ns::Wgl,
gl_generator::Fallbacks::All,
khronos_api::WGL_XML,
vec![
"WGL_ARB_extensions_string".to_string(),
"WGL_EXT_extensions_string".to_string(),
"WGL_ARB_create_context".to_string(),
"WGL_ARB_create_context_profile".to_string(),
"WGL_ARB_pixel_format".to_string(),
"WGL_ARB_pixel_format_float".to_string(),
"WGL_ARB_framebuffer_sRGB".to_string(),
"WGL_EXT_framebuffer_sRGB".to_string(),
"WGL_ARB_multisample".to_string()
],
"1.0", "core", &mut file
).unwrap();
}
}