mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-30 13:20:06 -04:00
Warning fixes for OS X.
This commit is contained in:
@@ -28,8 +28,8 @@ pub struct HeadlessContext {
|
||||
}
|
||||
|
||||
impl HeadlessContext {
|
||||
pub fn new((width, height): (u32, u32), pf_reqs: &PixelFormatRequirements,
|
||||
opengl: &GlAttributes<&HeadlessContext>) -> Result<HeadlessContext, CreationError>
|
||||
pub fn new((width, height): (u32, u32), _pf_reqs: &PixelFormatRequirements,
|
||||
_opengl: &GlAttributes<&HeadlessContext>) -> Result<HeadlessContext, CreationError>
|
||||
{
|
||||
let context = unsafe {
|
||||
let attributes = [
|
||||
|
||||
@@ -6,7 +6,6 @@ use {CreationError, Event, MouseCursor, CursorState};
|
||||
use CreationError::OsError;
|
||||
use libc;
|
||||
|
||||
use Api;
|
||||
use ContextError;
|
||||
use GlAttributes;
|
||||
use GlContext;
|
||||
@@ -21,9 +20,7 @@ use native_monitor::NativeMonitorId;
|
||||
use objc::runtime::{Class, Object, Sel, BOOL, YES, NO};
|
||||
use objc::declare::ClassDecl;
|
||||
|
||||
use cgl;
|
||||
use cgl::{CGLEnable, kCGLCECrashOnRemovedFunctions, CGLSetParameter, kCGLCPSurfaceOpacity};
|
||||
use cgl::CGLContextObj as CGL_CGLContextObj;
|
||||
|
||||
use cocoa::base::{id, nil};
|
||||
use cocoa::foundation::{NSAutoreleasePool, NSDate, NSDefaultRunLoopMode, NSPoint, NSRect, NSSize,
|
||||
@@ -758,7 +755,7 @@ impl Window {
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn set_cursor_position(&self, x: i32, y: i32) -> Result<(), ()> {
|
||||
pub fn set_cursor_position(&self, _x: i32, _y: i32) -> Result<(), ()> {
|
||||
unimplemented!();
|
||||
}
|
||||
}
|
||||
@@ -820,6 +817,7 @@ impl IdRef {
|
||||
IdRef(i)
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
fn retain(i: id) -> IdRef {
|
||||
if i != nil {
|
||||
let _: id = unsafe { msg_send![i, retain] };
|
||||
@@ -856,6 +854,7 @@ impl Clone for IdRef {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(non_snake_case)]
|
||||
unsafe fn NSEventToEvent(window: &Window, nsevent: id) -> Option<Event> {
|
||||
if nsevent == nil { return None; }
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ use GlContext;
|
||||
use PixelFormat;
|
||||
use PixelFormatRequirements;
|
||||
use Robustness;
|
||||
use WindowAttributes;
|
||||
|
||||
use gl_common;
|
||||
use libc;
|
||||
|
||||
@@ -68,6 +68,7 @@ pub use window::{AvailableMonitorsIter, MonitorId, get_available_monitors, get_p
|
||||
pub use native_monitor::NativeMonitorId;
|
||||
|
||||
use std::io;
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
use std::cmp::Ordering;
|
||||
|
||||
mod api;
|
||||
@@ -377,6 +378,7 @@ pub struct PixelFormatRequirements {
|
||||
}
|
||||
|
||||
impl PixelFormatRequirements {
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
fn choose_pixel_format<T, I>(&self, iter: I) -> Result<(T, PixelFormat), CreationError>
|
||||
where I: IntoIterator<Item=(T, PixelFormat)>, T: Clone
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user