Update some libraries

This commit is contained in:
Simon Sapin 2015-12-01 02:11:54 +01:00
parent 5b819eda9a
commit e4f1c7358d
4 changed files with 32 additions and 32 deletions

View file

@ -1,6 +1,6 @@
[package] [package]
name = "glutin" name = "glutin"
version = "0.4.2" version = "0.4.3"
authors = ["tomaka <pierre.krieger1708@gmail.com>"] authors = ["tomaka <pierre.krieger1708@gmail.com>"]
description = "Cross-plaform OpenGL context provider." description = "Cross-plaform OpenGL context provider."
keywords = ["windowing", "opengl"] keywords = ["windowing", "opengl"]
@ -17,8 +17,8 @@ libc = "0.2"
shared_library = "0.1.0" shared_library = "0.1.0"
[build-dependencies] [build-dependencies]
gl_generator = "0.2.0" gl_generator = "0.4"
khronos_api = "0.0.8" khronos_api = "1.0"
[dev-dependencies] [dev-dependencies]
clock_ticks = "0.1.0" clock_ticks = "0.1.0"
@ -44,7 +44,7 @@ objc = "0.1.8"
[target.x86_64-apple-darwin.dependencies] [target.x86_64-apple-darwin.dependencies]
objc = "0.1.8" objc = "0.1.8"
cgl = "0.1" cgl = "0.1"
cocoa = "0.1.4" cocoa = "0.2"
core-foundation = "0" core-foundation = "0"
core-graphics = "0" core-graphics = "0"

View file

@ -4,7 +4,7 @@ use CreationError::OsError;
use GlAttributes; use GlAttributes;
use GlContext; use GlContext;
use PixelFormatRequirements; use PixelFormatRequirements;
use libc; use std::os::raw::c_void;
use std::ptr; use std::ptr;
use core_foundation::base::TCFType; use core_foundation::base::TCFType;
@ -57,7 +57,7 @@ impl HeadlessContext {
}; };
// Load the function pointers as we need them to create the FBO // Load the function pointers as we need them to create the FBO
gl::load_with(|s| headless.get_proc_address(s) as *const libc::c_void); gl::load_with(|s| headless.get_proc_address(s) as *const c_void);
Ok(headless) Ok(headless)
} }

View file

@ -1,15 +1,15 @@
#![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))] #![cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))]
#![allow(dead_code)] #![allow(dead_code)]
use libc; use std::os::raw::{c_void, c_char, c_int};
pub const RTLD_LAZY: libc::c_int = 0x001; pub const RTLD_LAZY: c_int = 0x001;
pub const RTLD_NOW: libc::c_int = 0x002; pub const RTLD_NOW: c_int = 0x002;
#[link="dl"] #[link="dl"]
extern { extern {
pub fn dlopen(filename: *const libc::c_char, flag: libc::c_int) -> *mut libc::c_void; pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void;
pub fn dlerror() -> *mut libc::c_char; pub fn dlerror() -> *mut c_char;
pub fn dlsym(handle: *mut libc::c_void, symbol: *const libc::c_char) -> *mut libc::c_void; pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void;
pub fn dlclose(handle: *mut libc::c_void) -> libc::c_int; pub fn dlclose(handle: *mut c_void) -> c_int;
} }

View file

@ -12,8 +12,8 @@ use PixelFormatRequirements;
use Robustness; use Robustness;
use Api; use Api;
use libc;
use std::ffi::{CStr, CString}; use std::ffi::{CStr, CString};
use std::os::raw::{c_void, c_int};
use std::{mem, ptr}; use std::{mem, ptr};
pub mod ffi; pub mod ffi;
@ -46,13 +46,13 @@ pub struct Context {
#[cfg(target_os = "android")] #[cfg(target_os = "android")]
#[inline] #[inline]
fn get_native_display(egl: &ffi::egl::Egl, fn get_native_display(egl: &ffi::egl::Egl,
native_display: NativeDisplay) -> *const libc::c_void { native_display: NativeDisplay) -> *const c_void {
unsafe { egl.GetDisplay(ffi::egl::DEFAULT_DISPLAY as *mut _) } unsafe { egl.GetDisplay(ffi::egl::DEFAULT_DISPLAY as *mut _) }
} }
#[cfg(not(target_os = "android"))] #[cfg(not(target_os = "android"))]
fn get_native_display(egl: &ffi::egl::Egl, fn get_native_display(egl: &ffi::egl::Egl,
native_display: NativeDisplay) -> *const libc::c_void { native_display: NativeDisplay) -> *const c_void {
// the first step is to query the list of extensions without any display, if supported // the first step is to query the list of extensions without any display, if supported
let dp_extensions = unsafe { let dp_extensions = unsafe {
let p = egl.QueryString(ffi::egl::NO_DISPLAY, ffi::egl::EXTENSIONS as i32); let p = egl.QueryString(ffi::egl::NO_DISPLAY, ffi::egl::EXTENSIONS as i32);
@ -374,9 +374,9 @@ impl<'a> ContextPrototype<'a> {
pub fn finish_pbuffer(self, dimensions: (u32, u32)) -> Result<Context, CreationError> { pub fn finish_pbuffer(self, dimensions: (u32, u32)) -> Result<Context, CreationError> {
let attrs = &[ let attrs = &[
ffi::egl::WIDTH as libc::c_int, dimensions.0 as libc::c_int, ffi::egl::WIDTH as c_int, dimensions.0 as c_int,
ffi::egl::HEIGHT as libc::c_int, dimensions.1 as libc::c_int, ffi::egl::HEIGHT as c_int, dimensions.1 as c_int,
ffi::egl::NONE as libc::c_int, ffi::egl::NONE as c_int,
]; ];
let surface = unsafe { let surface = unsafe {
@ -584,7 +584,7 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
Robustness::NoError => { Robustness::NoError => {
if extensions.iter().find(|s| s == &"EGL_KHR_create_context_no_error").is_some() { if extensions.iter().find(|s| s == &"EGL_KHR_create_context_no_error").is_some() {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_NO_ERROR_KHR as libc::c_int); context_attributes.push(ffi::egl::CONTEXT_OPENGL_NO_ERROR_KHR as c_int);
context_attributes.push(1); context_attributes.push(1);
} }
}, },
@ -592,9 +592,9 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
Robustness::RobustNoResetNotification => { Robustness::RobustNoResetNotification => {
if supports_robustness { if supports_robustness {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY
as libc::c_int); as c_int);
context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as libc::c_int); context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as c_int);
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as c_int;
} else { } else {
return Err(CreationError::RobustnessNotSupported); return Err(CreationError::RobustnessNotSupported);
} }
@ -603,18 +603,18 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
Robustness::TryRobustNoResetNotification => { Robustness::TryRobustNoResetNotification => {
if supports_robustness { if supports_robustness {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY
as libc::c_int); as c_int);
context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as libc::c_int); context_attributes.push(ffi::egl::NO_RESET_NOTIFICATION as c_int);
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as c_int;
} }
}, },
Robustness::RobustLoseContextOnReset => { Robustness::RobustLoseContextOnReset => {
if supports_robustness { if supports_robustness {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY
as libc::c_int); as c_int);
context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as libc::c_int); context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as c_int);
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as c_int;
} else { } else {
return Err(CreationError::RobustnessNotSupported); return Err(CreationError::RobustnessNotSupported);
} }
@ -623,9 +623,9 @@ unsafe fn create_context(egl: &ffi::egl::Egl, display: ffi::egl::types::EGLDispl
Robustness::TryRobustLoseContextOnReset => { Robustness::TryRobustLoseContextOnReset => {
if supports_robustness { if supports_robustness {
context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY context_attributes.push(ffi::egl::CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY
as libc::c_int); as c_int);
context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as libc::c_int); context_attributes.push(ffi::egl::LOSE_CONTEXT_ON_RESET as c_int);
flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as libc::c_int; flags = flags | ffi::egl::CONTEXT_OPENGL_ROBUST_ACCESS as c_int;
} }
}, },
} }