mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 12:50:04 -04:00
make_current() is now unsafe
This commit is contained in:
@@ -34,7 +34,7 @@ pub struct MonitorID(uint);
|
||||
///
|
||||
/// let window = Window::new(None, "Hello world!", &Default::default(), None).unwrap();
|
||||
///
|
||||
/// window.make_current();
|
||||
/// unsafe { window.make_current() };
|
||||
///
|
||||
/// loop {
|
||||
/// for event in window.poll_events().move_iter() { // note: this may change in the future
|
||||
@@ -200,9 +200,10 @@ impl Window {
|
||||
self.window.wait_events()
|
||||
}
|
||||
|
||||
/// Sets the context as the current context.
|
||||
#[inline]
|
||||
#[experimental]
|
||||
pub fn make_current(&self) {
|
||||
pub unsafe fn make_current(&self) {
|
||||
self.window.make_current()
|
||||
}
|
||||
|
||||
|
||||
@@ -310,8 +310,8 @@ impl Window {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn make_current(&self) {
|
||||
unsafe { ffi::wglMakeCurrent(self.hdc, self.context) }
|
||||
pub unsafe fn make_current(&self) {
|
||||
ffi::wglMakeCurrent(self.hdc, self.context)
|
||||
}
|
||||
|
||||
pub fn get_proc_address(&self, addr: &str) -> *const () {
|
||||
|
||||
@@ -232,8 +232,8 @@ impl Window {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn make_current(&self) {
|
||||
let res = unsafe { ffi::glXMakeCurrent(self.display, self.window, self.context) };
|
||||
pub unsafe fn make_current(&self) {
|
||||
let res = ffi::glXMakeCurrent(self.display, self.window, self.context);
|
||||
if res == 0 {
|
||||
fail!("glXMakeCurrent failed");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user