Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
Lonsdaleiter committed May 14, 2020
1 parent 0bf73c2 commit a38d69f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 16 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"
description = "Unsafe Rusty Metal."
repository = "https://github.com/Lonsdaleiter/iron-oxide"
keywords = ["metal", "graphics", "bindings", "objective c", "gamedev", "macos", "ios"]
categories = ["graphics", "os::macos-apis", "game-development", "rendering::graphics-api"]
categories = ["graphics", "os::macos-apis", "os::ios-apis", "game-development", "rendering::graphics-api"]
include = ["src/*", "Cargo.toml", "README.md"]
readme = "README.md"
license = "MIT"
Expand All @@ -24,4 +24,3 @@ raw-window-handle = "0.3.3"
winit = "0.22.1"
colog = "1.0.0"
png = "0.16.3"
cgmath = "0.17.0"
1 change: 0 additions & 1 deletion examples/quad/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct MetalBoilerplate {
const QUAD_LEN: NSUInteger = 6;
const QUAD_VERTS: NSUInteger = 24;
const QUAD_BYTES: [f32; QUAD_VERTS as usize] = [
// TODO add the other triangle
-1.0f32, -1.0, // v1
0.0, 0.0, 0.0, 1.0, // black
1.0, -1.0, // v2
Expand Down
3 changes: 0 additions & 3 deletions examples/skybox/main.rs

This file was deleted.

5 changes: 5 additions & 0 deletions src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ pub unsafe fn MTLCreateSystemDefaultDevice() -> MTLDevice {
}

#[allow(non_snake_case)]
/// Does not function exactly as the `MTLCopyAllDevices` Metal function. Will, if the device
/// running this function is iOS, instead create the system default device and put it
/// into a vector.
pub unsafe fn MTLCopyAllDevices() -> Vec<MTLDevice> {
#[cfg(target_os = "macos")]
{
Expand All @@ -72,6 +75,8 @@ pub unsafe fn MTLCopyAllDevices() -> Vec<MTLDevice> {
}

#[allow(non_snake_case)]
/// If the provided display id is not the valid id of a monitor on this device,
/// the program will stall.
pub unsafe fn CGDirectDisplayCopyCurrentMetalDevice(display_id: u32) -> MTLDevice {
MTLDevice::from_ptr({
let obj = externs::CGDirectDisplayCopyCurrentMetalDevice(display_id);
Expand Down
14 changes: 4 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,19 @@
//! `iron-oxide` provides unsafe [Metal](https://developer.apple.com/documentation/metal?language=objc)
//! bindings for Rust.
//!
//! # Metal Functionality
//! The Metal documentation for most structs, traits, methods, and functions can be found by
//! googling their names (adjusted from snake_case to camelCase).
//!
//! Not all of Metal's functionality is added. The pointer underlying a MTL(something) can
//! be accessed with `get_ptr`, and messages can be sent to it with `objc`'s `msg_send!`, if
//! necessary functionality isn't yet implemented. This is very unsafe.
//!
//! # Metal Docs
//!
//! It is the responsibility of the user to not use methods or functions which do not exist in
//! OS versions below what they support. macOS, iOS, tvOS, and watchOS only! They can be checked
//! in the Metal docs corresponding with a given method or function.
//!
//! # Examples
//! OS versions below what they support.
//!
//! See the examples directory for examples.
//!
//! # License
//!
//! Licensed under the MIT license.
//! This crate is licensed under the MIT license.
use objc::Message;
use std::ops::Deref;
Expand Down

0 comments on commit a38d69f

Please sign in to comment.