mach: platform/libmach: update to latest mach/core API
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
a15b9bb5f6
commit
0eaa56b4ad
1 changed files with 7 additions and 1 deletions
|
|
@ -24,7 +24,13 @@ const allocator = gpa.allocator();
|
||||||
// Will return a null pointer if an error occurred while initializing Core
|
// Will return a null pointer if an error occurred while initializing Core
|
||||||
pub export fn mach_core_init() ?*native.Core {
|
pub export fn mach_core_init() ?*native.Core {
|
||||||
gpu.Impl.init();
|
gpu.Impl.init();
|
||||||
const core = native.Core.init(allocator, .{}) catch {
|
// TODO(libmach): eliminate this allocation
|
||||||
|
var core = allocator.create(native.Core) catch {
|
||||||
|
return @intToPtr(?*native.Core, 0);
|
||||||
|
};
|
||||||
|
// TODO(libmach): allow passing init options
|
||||||
|
core.init(allocator, .{}) catch {
|
||||||
|
// TODO(libmach): better error handling
|
||||||
return @intToPtr(?*native.Core, 0);
|
return @intToPtr(?*native.Core, 0);
|
||||||
};
|
};
|
||||||
return core;
|
return core;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue