extern(Objective-C) bindings to Apple's metal
To use this package, run the following command in your project's root directory:
Put the following dependency into your project's dependences section:
Bindings for the D language to Apple's Metal Graphics API
Those bindings were created by hand and includes comments from apple.developer documentations. If you wish to contrirbute, try to stick to what was done by keeping comments for easier developer understanding on what is happening. If possible, the binding must be user friendly as a programming language to learn Metal.
The Binding has a wrapper over it to make development easier. For example, most arrays are
accessed on Objective-C using
objectIndexedAtSubscript. However, this API is not natural for D.
So, beyond the bindings, this also includes
opIndexAssign, making the API
more familiar to Objective-C.
The binding is a little bit different from Objective-C too by giving g
enum short names. For example
instead of using
MTLPixelFormatR8Unorm, this enum is accessed by using
This will make your code shorter and easier to read. Enums that has a number after the prefix
starts with an underline. For example:
Another detail on this API, using NSArray as the generic type for everything is counter intuitive, so, for making the API more self descriptive, this binding defines 2 concepts:
NSArray_(T): This is an alias that resolves to NSArray. It does not create a type, and it is solely for documentation on function purposes. It is the type you use for interfacing with Objective-C.
NSArrayD(T): This is a structt that wraps a NSArray with
alias arr this. It is strongly typed for keeping your code less error prone. It also wraps
opApplyfor being able to use the foreach and index operators.
- Registered by Marcelo Silva Nascimento Mancini
- 1.0.10 released 4 hours ago
- Copyright © 2023, Hipreme
1.0.10 2023-Mar-20 1.0.9 2023-Mar-20 1.0.8 2023-Mar-19 1.0.7 2023-Mar-18 1.0.6 2023-Mar-17
- Download Stats:
3 downloads today
19 downloads this week
24 downloads this month
24 downloads total
- Short URL: