veandco / go-sdl2

SDL2 binding for Go
https://godoc.org/github.com/veandco/go-sdl2
BSD 3-Clause "New" or "Revised" License
2.17k stars 219 forks source link

fixed readme example #591

Closed valantonini closed 4 months ago

valantonini commented 4 months ago

hi,

tried to run the example and received:

# command-line-arguments
./main.go:34:9: impossible type switch case: sdl.QuitEvent
    event (variable of type sdl.Event) cannot have dynamic type sdl.QuitEvent (method GetTimestamp has pointer receiver)

Looks like a pointer is needed in the switch.

cheers,

val

veeableful commented 4 months ago

Hi @valantonini, the example applies for the master branch. I presume you used v0.4.x?

valantonini commented 4 months ago

apologies. i was on 0.4.38.