load_with switched to take Rust void rather than the c_void

This commit is contained in:
Tony Aldridge
2015-11-16 13:57:41 +00:00
parent 7a6ceb3ea2
commit 80e408d9ee
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ name = "sdl2"
description = "SDL2 bindings for Rust"
repository = "https://github.com/AngryLawyer/rust-sdl2"
documentation = "http://angrylawyer.github.io/rust-sdl2/sdl2/"
version = "0.10.0"
version = "0.11.0"
license = "MIT"
authors = [ "Tony Aldridge <tony@angry-lawyer.com>" ]
keywords = ["SDL", "windowing", "graphics"]
+2 -2
View File
@@ -95,7 +95,7 @@ download through Crates.io:
```toml
[dependencies]
sdl2 = "0.10"
sdl2 = "0.11"
```
Alternatively, pull it from GitHub
@@ -138,7 +138,7 @@ bindings:
let sdl_context = sdl2::init().unwrap();
let video_subsystem = sdl_context.video().unwrap();
gl::load_with(|name| video_subsystem.gl_get_proc_address(name) as *const _);
gl::load_with(|name| video_subsystem.gl_get_proc_address(name));
```
Note that these bindings are very raw, and many of the calls will require
+1 -1
View File
@@ -15,7 +15,7 @@ path = "src/lib.rs"
[dependencies]
num = "0.1"
libc = "0.2.1"
libc = "0.2"
[build-dependencies.pkg-config]
version = "0.3"
+3 -3
View File
@@ -1,4 +1,4 @@
use libc::{c_void, c_int, c_float, uint32_t};
use libc::{c_int, c_float, uint32_t};
use std::ffi::{CStr, CString};
use std::mem;
use std::ops::{Deref, DerefMut};
@@ -620,9 +620,9 @@ impl VideoSubsystem {
/// Gets the pointer to the named OpenGL function.
///
/// This is useful for OpenGL wrappers such as [`gl-rs`](https://github.com/bjz/gl-rs).
pub fn gl_get_proc_address(&self, procname: &str) -> *const c_void {
pub fn gl_get_proc_address(&self, procname: &str) -> *const () {
match CString::new(procname) {
Ok(procname) => unsafe { ll::SDL_GL_GetProcAddress(procname.as_ptr()) },
Ok(procname) => unsafe { ll::SDL_GL_GetProcAddress(procname.as_ptr()) as *const () },
// string contains a nul byte - it won't match anything.
Err(_) => ptr::null()
}