Skip to content
This repository was archived by the owner on Apr 28, 2021. It is now read-only.

Commit 4aa52ec

Browse files
authored
fixes for GLFW 2.0 (#57)
1 parent 7e00292 commit 4aa52ec

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/callbacks.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ returns `Signal{NTuple{4, Int}}`
5050
"""
5151
function keyboard_buttons(window, s::Signal{NTuple{4, Int}}=Signal((0,0,0,0)))
5252
keydict = Dict{Int, Bool}()
53-
GLFW.SetKeyCallback(window, (window, button::Cint, scancode::Cint, action::Cint, mods::Cint) -> begin
53+
GLFW.SetKeyCallback(window, (window, button, scancode, action, mods) -> begin
5454
push!(s, (Int(button), Int(scancode), Int(action), Int(mods)))
5555
end)
5656
s
@@ -62,7 +62,7 @@ containing the pressed button the action and modifiers.
6262
[GLFW Docs](http://www.glfw.org/docs/latest/group__input.html#ga1e008c7a8751cea648c8f42cc91104cf)
6363
"""
6464
function mouse_buttons(window, s::Signal{NTuple{3, Int}}=Signal((0,0,0)))
65-
GLFW.SetMouseButtonCallback(window, (window, button::Cint, action::Cint, mods::Cint) -> begin
65+
GLFW.SetMouseButtonCallback(window, (window, button, action, mods) -> begin
6666
push!(s, (Int(button), Int(action), Int(mods)))
6767
end)
6868
s

src/events.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ end
1717

1818
function add_complex_signals!(screen)
1919
@materialize keyboard_buttons, mouse_buttons = screen.inputs
20-
20+
2121
no_scancode = map(remove_scancode, keyboard_buttons)
2222

2323
button_s = merge(
@@ -47,12 +47,12 @@ Builds a Set of keys, accounting for released and pressed keys
4747
"""
4848
function currently_pressed_keys(v0::Set{Int}, button_action_mods)
4949
button, action, mods = button_action_mods
50-
if button != GLFW.KEY_UNKNOWN
51-
if action == GLFW.PRESS
50+
if button != Int(GLFW.KEY_UNKNOWN)
51+
if action == Int(GLFW.PRESS)
5252
push!(v0, button)
53-
elseif action == GLFW.RELEASE
53+
elseif action == Int(GLFW.RELEASE)
5454
delete!(v0, button)
55-
elseif action == GLFW.REPEAT
55+
elseif action == Int(GLFW.REPEAT)
5656
# nothing needs to be done, besides returning the same set of keys
5757
else
5858
error("Unrecognized enum value for GLFW button press action: $action")

src/screen.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ function destroy!(screen::Screen)
505505
end
506506
if nw.handle != C_NULL
507507
GLFW.DestroyWindow(nw)
508-
nw.handle = C_NULL
508+
# nw.handle = C_NULL
509509
end
510510
else # delete from parent
511511
filter!(s-> !(s===screen), screen.parent.children) # remove from parent

0 commit comments

Comments
 (0)