mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 06:40:06 -04:00
get_proc_address now returns a libc::c_void
This commit is contained in:
@@ -23,7 +23,7 @@ fn main() {
|
|||||||
|
|
||||||
unsafe { window.make_current() };
|
unsafe { window.make_current() };
|
||||||
|
|
||||||
gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void);
|
gl::load_with(|symbol| window.get_proc_address(symbol));
|
||||||
|
|
||||||
gl::ClearColor(0.0, 1.0, 0.0, 1.0);
|
gl::ClearColor(0.0, 1.0, 0.0, 1.0);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ fn main() {
|
|||||||
|
|
||||||
unsafe { window.make_current() };
|
unsafe { window.make_current() };
|
||||||
|
|
||||||
gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void);
|
gl::load_with(|symbol| window.get_proc_address(symbol));
|
||||||
|
|
||||||
let version = {
|
let version = {
|
||||||
use std::c_str::CString;
|
use std::c_str::CString;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ fn main() {
|
|||||||
fn run(window: init::Window, color: (f32, f32, f32, f32)) {
|
fn run(window: init::Window, color: (f32, f32, f32, f32)) {
|
||||||
unsafe { window.make_current() };
|
unsafe { window.make_current() };
|
||||||
|
|
||||||
gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void);
|
gl::load_with(|symbol| window.get_proc_address(symbol));
|
||||||
|
|
||||||
{
|
{
|
||||||
let win_size = window.get_inner_size().unwrap();
|
let win_size = window.get_inner_size().unwrap();
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ fn main() {
|
|||||||
|
|
||||||
unsafe { window.make_current() };
|
unsafe { window.make_current() };
|
||||||
|
|
||||||
gl::load_with(|symbol| window.get_proc_address(symbol) as *const libc::c_void);
|
gl::load_with(|symbol| window.get_proc_address(symbol));
|
||||||
|
|
||||||
let version = {
|
let version = {
|
||||||
use std::c_str::CString;
|
use std::c_str::CString;
|
||||||
|
|||||||
@@ -265,8 +265,8 @@ impl Window {
|
|||||||
///
|
///
|
||||||
/// Contrary to `wglGetProcAddress`, all available OpenGL functions return an address.
|
/// Contrary to `wglGetProcAddress`, all available OpenGL functions return an address.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get_proc_address(&self, addr: &str) -> *const () {
|
pub fn get_proc_address(&self, addr: &str) -> *const libc::c_void {
|
||||||
self.window.get_proc_address(addr)
|
self.window.get_proc_address(addr) as *const libc::c_void
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Swaps the buffers in case of double or triple buffering.
|
/// Swaps the buffers in case of double or triple buffering.
|
||||||
|
|||||||
Reference in New Issue
Block a user