examples/render: fix window not showing up in macOS
Signed-off-by: Lilis Iskandar <lilis@veand.co>
This commit is contained in:
parent
cebe7cd7f1
commit
29a79b36df
|
@ -34,6 +34,17 @@ func run() int {
|
|||
}
|
||||
defer renderer.Destroy()
|
||||
|
||||
running := true
|
||||
|
||||
for running {
|
||||
for event := sdl.PollEvent(); event != nil; event = sdl.PollEvent() {
|
||||
switch event.(type) {
|
||||
case *sdl.QuitEvent:
|
||||
running = false
|
||||
}
|
||||
}
|
||||
|
||||
renderer.SetDrawColor(0, 0, 0, 255)
|
||||
renderer.Clear()
|
||||
|
||||
renderer.SetDrawColor(255, 255, 255, 255)
|
||||
|
@ -63,8 +74,8 @@ func run() int {
|
|||
renderer.FillRects(rects)
|
||||
|
||||
renderer.Present()
|
||||
sdl.PollEvent()
|
||||
sdl.Delay(2000)
|
||||
sdl.Delay(16)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue