From d3355c5aaf02db2ad9ca33af03aa1cf037254470 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Tue, 5 Apr 2016 22:37:54 -0400 Subject: [PATCH] Update gl_generator to 0.5 and bump version --- Cargo.toml | 4 ++-- build.rs | 15 +++++---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6426143..9149741 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,14 +1,14 @@ [package] name = "offscreen_gl_context" license = "MIT / Apache-2.0" -version = "0.1.2" +version = "0.1.3" authors = ["ecoal95 ", "The Servo Project Developers"] description = "Creation and manipulation of HW accelerated offscreen rendering contexts in multiple platforms. Originally intended for the Servo project's WebGL implementation." repository = "https://github.com/ecoal95/rust-offscreen-rendering-context" build = "build.rs" [build-dependencies] -gl_generator = "0.4" +gl_generator = "0.5" khronos_api = "1.0" # NOTE: Just for testing use, there are no other changes diff --git a/build.rs b/build.rs index 595045c..227daf9 100644 --- a/build.rs +++ b/build.rs @@ -4,6 +4,7 @@ extern crate khronos_api; use std::env; use std::fs::File; use std::path::PathBuf; +use gl_generator::{Registry, Api, Profile, Fallbacks}; fn main() { let target = env::var("TARGET").unwrap(); @@ -11,20 +12,14 @@ fn main() { 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, - gl_generator::Fallbacks::All, - khronos_api::GLX_XML, vec![], - "1.4", "core", &mut file).unwrap(); + Registry::new(Api::Glx, (1, 4), Profile::Core, Fallbacks::All, []) + .write_bindings(gl_generator::StaticGenerator, &mut file).unwrap(); } if target.contains("android") || target.contains("linux") { let mut file = File::create(&dest.join("egl_bindings.rs")).unwrap(); - gl_generator::generate_bindings(gl_generator::StaticGenerator, - gl_generator::registry::Ns::Egl, - gl_generator::Fallbacks::All, - khronos_api::EGL_XML, vec![], - "1.4", "core", &mut file).unwrap(); + Registry::new(Api::Egl, (1, 4), Profile::Core, Fallbacks::All, []) + .write_bindings(gl_generator::StaticGenerator, &mut file).unwrap(); println!("cargo:rustc-link-lib=EGL"); } }