Skip to content

Commit

Permalink
Test.
Browse files Browse the repository at this point in the history
Signed-off-by: Hal Gentz <[email protected]>
  • Loading branch information
goddessfreya committed Mar 29, 2019
1 parent d1ab814 commit 48a0fea
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion glutin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ glutin_egl_sys = { version = "0.1.2", path = "../glutin_egl_sys" }
glutin_emscripten_sys = { version = "0.1.0", path = "../glutin_emscripten_sys" }

[target.'cfg(any(target_os = "ios", target_os = "macos"))'.dependencies]
objc = "0.2"
objc = "0.2.6"
glutin_gles2_sys = { version = "0.1.2", path = "../glutin_gles2_sys" }

[target.'cfg(target_os = "macos")'.dependencies]
Expand Down
14 changes: 0 additions & 14 deletions glutin/src/api/ios/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
//! SIGKILL'ed

use crate::os::ios::{WindowBuilderExt, WindowExt};
use crate::os::ContextTraitExt;
use crate::{
Api, ContextError, CreationError, EventsLoop, GlAttributes, GlRequest,
PixelFormat, PixelFormatRequirements, Window, WindowBuilder,
Expand Down Expand Up @@ -445,16 +444,3 @@ impl Drop for Context {
let _: () = unsafe { msg_send![self.eagl_context, release] };
}
}

impl ContextTraitExt for Context {
type Handle = *mut raw::c_void;
#[inline]
unsafe fn raw_handle(&self) -> Self::Handle {
self.eagl_context as *mut raw::c_void
}

#[inline]
unsafe fn get_egl_display(&self) -> Option<*const raw::c_void> {
None
}
}
18 changes: 18 additions & 0 deletions glutin/src/os/ios.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
#![cfg(target_os = "ios")]

use crate::os::ContextTraitExt;
use crate::{Context, ContextCurrentState};

pub use winit::os::ios::{MonitorIdExt, WindowBuilderExt, WindowExt};

use std::os::raw;

impl<T: ContextCurrentState> ContextTraitExt for Context<T> {
type Handle = *mut raw::c_void;
#[inline]
unsafe fn raw_handle(&self) -> Self::Handle {
self.eagl_context as *mut raw::c_void
}

#[inline]
unsafe fn get_egl_display(&self) -> Option<*const raw::c_void> {
None
}
}
4 changes: 2 additions & 2 deletions glutin/src/os/macos.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![cfg(target_os = "macos")]

use crate::os::ContextTraitExt;
use crate::Context;
use crate::{Context, ContextCurrentState};

pub use winit::os::macos::ActivationPolicy;
pub use winit::os::macos::MonitorIdExt;
Expand All @@ -10,7 +10,7 @@ pub use winit::os::macos::WindowExt;

use std::os::raw;

impl ContextTraitExt for Context {
impl<T: ContextCurrentState> ContextTraitExt for Context<T> {
type Handle = *mut raw::c_void;

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion glutin/src/windowed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::marker::PhantomData;
///
/// // draw everything here
///
/// windowed_context.window().swap_buffers();
/// windowed_context.swap_buffers();
/// std::thread::sleep(std::time::Duration::from_millis(17));
/// }
/// # }
Expand Down

0 comments on commit 48a0fea

Please sign in to comment.