mrcsnm / d-metal-binding Goto Github PK
View Code? Open in Web Editor NEWBindings for the D language to Apple's Metal Graphics API
License: Boost Software License 1.0
Bindings for the D language to Apple's Metal Graphics API
License: Boost Software License 1.0
Compiling on macOS ARM64 with LDC 1.32.0 yields this error:
d-metal-binding/source/objc/runtime.d(10,12): Error: Internal compiler error: Type 'Expression' not implemented: 'class'
Possibly a compiler bug?
Although it does compile and produces a static binary, I'm not really sure how to use the hello_triangle example, or what the main()
function I need to write to use it would look like. I've written the equivalent in Objective-C, but that uses NSApplication, NSWindow etc which aren't included in this binding. Can this be documented or added to the examples?
Thank you!
When compiling the following small example, linking to SDL2 and d-metal-binding, a linker error is thrown that _objc_msgSend_stret is undefined.
import std.stdio;
import std.exception;
import bindbc.sdl;
import metal;
import objc.runtime;
import objc.meta;
void main() {
// Init SDL2
auto load = loadSDL();
enforce(load != SDLSupport.noLibrary, "SDL2 not found!");
SDL_Init(SDL_INIT_VIDEO);
SDL_Window* window = SDL_CreateWindow("Metal Test", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_METAL | SDL_WINDOW_ALLOW_HIGHDPI);
SDL_MetalView view = SDL_Metal_CreateView(window);
CAMetalLayer layer = cast(CAMetalLayer)SDL_Metal_GetLayer(view);
writeln(layer.drawableSize());
writeln("Edit source/app.d to start your project.");
}
Relevant output from dub
ld: Undefined symbols:
_objc_msgSend_stret, referenced from:
CAMetalLayer::drawableSize() in libmetal.a[12](objc.metal_gen.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A large part of the API has no way to release references to the classes created, this in my testing can result in some memory leaks.
A lower class than Object should probably be added, which provides just an interface to retain
, release
, autorelease
and retainCount
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.