Skip to content

Commit

Permalink
linux GLFW support after API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
arhik committed Oct 18, 2023
1 parent ee0a094 commit 734f402
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions src/linuxglfw.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ function defaultCanvas(::Type{LinuxCanvas}; windowSize = (500, 500))
)
instance = getWGPUInstance()
surfaceRef[] =
wgpuInstanceCreateSurface(instance, surfaceDescriptorRef |> ptr)
wgpuInstanceCreateSurface(instance[], surfaceDescriptorRef |> ptr)
title = "GLFW Window"
canvas = LinuxCanvas(
title,
size,
windowSize,
displayRef,
windowRef,
windowX11Ref,
Expand All @@ -95,7 +95,7 @@ function defaultCanvas(::Type{LinuxCanvas}; windowSize = (500, 500))
nothing,
false,
false,
backend.device,
device,
nothing,
nothing,
defaultInit(MouseState),
Expand Down Expand Up @@ -279,15 +279,20 @@ end

function getContext(gpuCanvas::LinuxCanvas)
if gpuCanvas.context == nothing
context = partialInit(
GPUCanvasContext;
canvasRef = Ref(gpuCanvas),
surfaceSize = (-1, -1),
surfaceId = gpuCanvas.surfaceRef[],
internal = nothing,
device = gpuCanvas.device,
physicalSize = gpuCanvas.size,
compositingAlphaMode = nothing,
context = GPUCanvasContext(
Ref(gpuCanvas),
(-1, -1),
gpuCanvas.surfaceRef[],
nothing,
nothing
gpuCanvas.device,
WGPUTextureFormat_R8Unorm,
WGPUTextureUsage(0),
nothing,
nothing,
gpuCanvas.size,
nothing,
nothing
)
gpuCanvas.context = context
else
Expand Down

0 comments on commit 734f402

Please sign in to comment.