gpu-dawn: update to latest glfw get/setUserPointer API (#154)

Updates gpu-dawn to use the latest glfw get/setUserPointer API introduced in hexops/mach#152

Helps hexops/mach#153
This commit is contained in:
Alex G Rice 2022-01-09 20:58:18 -07:00 committed by GitHub
parent 786da94468
commit abe9475d6e
Failed to generate hash of commit

View file

@ -114,10 +114,10 @@ pub fn main() !void {
swap_chain: c.WGPUSwapChain,
swap_chain_format: c.WGPUTextureFormat,
};
setup.window.setUserPointer(CallbackPayload, &.{ .swap_chain = swap_chain, .swap_chain_format = swap_chain_format });
setup.window.setUserPointer(&.{ .swap_chain = swap_chain, .swap_chain_format = swap_chain_format });
setup.window.setFramebufferSizeCallback((struct {
fn callback(window: glfw.Window, width: u32, height: u32) void {
const pl = window.getUserPointer(*CallbackPayload);
const pl = window.getUserPointer(CallbackPayload);
c.wgpuSwapChainConfigure(pl.?.swap_chain, pl.?.swap_chain_format, c.WGPUTextureUsage_RenderAttachment, @intCast(u32, width), @intCast(u32, height));
}
}).callback);