mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Update for gl_generator's changes
This commit is contained in:
parent
a04668e850
commit
7f6f4f8d04
|
@ -9,16 +9,17 @@ license = "Apache-2.0"
|
|||
readme = "README.md"
|
||||
repository = "https://github.com/tomaka/glutin"
|
||||
documentation = "http://tomaka.github.io/glutin/"
|
||||
build = "build.rs"
|
||||
|
||||
[features]
|
||||
default = ["window"]
|
||||
window = []
|
||||
headless = []
|
||||
|
||||
[dependencies.gl_generator]
|
||||
[dependencies.gl_common]
|
||||
git = "https://github.com/bjz/gl-rs"
|
||||
|
||||
[dependencies.gl_common]
|
||||
[build-dependencies.gl_generator]
|
||||
git = "https://github.com/bjz/gl-rs"
|
||||
|
||||
[target.arm-linux-androideabi.dependencies.android_glue]
|
||||
|
|
68
build.rs
Normal file
68
build.rs
Normal file
|
@ -0,0 +1,68 @@
|
|||
extern crate gl_generator;
|
||||
extern crate khronos_api;
|
||||
|
||||
use std::os;
|
||||
use std::io::File;
|
||||
|
||||
fn main() {
|
||||
let target = os::getenv("TARGET").unwrap();
|
||||
let dest = Path::new(os::getenv("OUT_DIR").unwrap());
|
||||
|
||||
if target.contains("windows") {
|
||||
let mut file = File::create(&dest.join("wgl_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StaticGenerator,
|
||||
gl_generator::registry::Ns::Wgl,
|
||||
khronos_api::WGL_XML, vec![],
|
||||
"1.0", "core", &mut file).unwrap();
|
||||
|
||||
let mut file = File::create(&dest.join("wgl_extra_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
||||
gl_generator::registry::Ns::Wgl,
|
||||
khronos_api::WGL_XML,
|
||||
vec![
|
||||
"WGL_ARB_create_context".to_string(),
|
||||
"WGL_EXT_swap_control".to_string()
|
||||
],
|
||||
"1.0", "core", &mut file).unwrap();
|
||||
}
|
||||
|
||||
if target.contains("linux") {
|
||||
let mut file = File::create(&dest.join("glx_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StaticGenerator,
|
||||
gl_generator::registry::Ns::Glx,
|
||||
khronos_api::GLX_XML, vec![],
|
||||
"1.4", "core", &mut file).unwrap();
|
||||
|
||||
let mut file = File::create(&dest.join("glx_extra_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
||||
gl_generator::registry::Ns::Glx,
|
||||
khronos_api::GLX_XML,
|
||||
vec![
|
||||
"GLX_ARB_create_context".to_string(),
|
||||
],
|
||||
"1.4", "core", &mut file).unwrap();
|
||||
}
|
||||
|
||||
if target.contains("android") {
|
||||
let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StaticGenerator,
|
||||
gl_generator::registry::Ns::Egl,
|
||||
khronos_api::EGL_XML, vec![],
|
||||
"1.5", "core", &mut file).unwrap();
|
||||
}
|
||||
|
||||
|
||||
// TODO: only build the bindings below if we run tests/examples
|
||||
|
||||
let mut file = File::create(&dest.join("test_gl_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
||||
gl_generator::registry::Ns::Gl,
|
||||
khronos_api::GL_XML, vec![],
|
||||
"1.1", "core", &mut file).unwrap();
|
||||
|
||||
let mut file = File::create(&dest.join("test_gles1_bindings.rs")).unwrap();
|
||||
gl_generator::generate_bindings(gl_generator::StructGenerator,
|
||||
gl_generator::registry::Ns::Gles1,
|
||||
khronos_api::GL_XML, vec![],
|
||||
"1.1", "core", &mut file).unwrap();
|
||||
}
|
|
@ -7,23 +7,13 @@ use glutin;
|
|||
|
||||
#[cfg(not(target_os = "android"))]
|
||||
mod gl {
|
||||
generate_gl_bindings! {
|
||||
api: "gl",
|
||||
profile: "core",
|
||||
version: "1.1",
|
||||
generator: "struct"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
||||
}
|
||||
|
||||
#[cfg(target_os = "android")]
|
||||
mod gl {
|
||||
pub use self::Gles1 as Gl;
|
||||
generate_gl_bindings! {
|
||||
api: "gles1",
|
||||
profile: "core",
|
||||
version: "1.1",
|
||||
generator: "struct"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/test_gles1_bindings.rs"));
|
||||
}
|
||||
|
||||
pub struct Context {
|
||||
|
|
|
@ -17,12 +17,7 @@ pub mod egl {
|
|||
pub type NativePixmapType = super::EGLNativePixmapType;
|
||||
pub type NativeWindowType = super::EGLNativeWindowType;
|
||||
|
||||
generate_gl_bindings! {
|
||||
api: "egl",
|
||||
profile: "core",
|
||||
version: "1.5",
|
||||
generator: "static"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/egl_bindings.rs"));
|
||||
}
|
||||
|
||||
pub type khronos_utime_nanoseconds_t = khronos_uint64_t;
|
||||
|
|
|
@ -1,25 +1,11 @@
|
|||
/// WGL bindings
|
||||
pub mod wgl {
|
||||
generate_gl_bindings! {
|
||||
api: "wgl",
|
||||
profile: "core",
|
||||
version: "1.0",
|
||||
generator: "static"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/wgl_bindings.rs"));
|
||||
}
|
||||
|
||||
/// Functions that are not necessarly always available
|
||||
pub mod wgl_extra {
|
||||
generate_gl_bindings! {
|
||||
api: "wgl",
|
||||
profile: "core",
|
||||
version: "1.0",
|
||||
generator: "struct",
|
||||
extensions: [
|
||||
"WGL_ARB_create_context",
|
||||
"WGL_EXT_swap_control"
|
||||
]
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/wgl_extra_bindings.rs"));
|
||||
}
|
||||
|
||||
#[link(name = "opengl32")]
|
||||
|
|
|
@ -8,25 +8,12 @@ use libc;
|
|||
|
||||
/// GLX bindings
|
||||
pub mod glx {
|
||||
generate_gl_bindings! {
|
||||
api: "glx",
|
||||
profile: "core",
|
||||
version: "1.4",
|
||||
generator: "static"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/glx_bindings.rs"));
|
||||
}
|
||||
|
||||
/// Functions that are not necessarly always available
|
||||
pub mod glx_extra {
|
||||
generate_gl_bindings! {
|
||||
api: "glx",
|
||||
profile: "core",
|
||||
version: "1.4",
|
||||
generator: "struct",
|
||||
extensions: [
|
||||
"GLX_ARB_create_context"
|
||||
]
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/glx_extra_bindings.rs"));
|
||||
}
|
||||
|
||||
pub type Atom = libc::c_ulong;
|
||||
|
|
|
@ -6,12 +6,7 @@ extern crate glutin;
|
|||
extern crate libc;
|
||||
|
||||
mod gl {
|
||||
generate_gl_bindings! {
|
||||
api: "gl",
|
||||
profile: "core",
|
||||
version: "1.1",
|
||||
generator: "struct"
|
||||
}
|
||||
include!(concat!(env!("OUT_DIR"), "/test_gl_bindings.rs"));
|
||||
}
|
||||
|
||||
#[cfg(feature = "headless")]
|
||||
|
|
Loading…
Reference in a new issue