mirror of
https://github.com/EnumeratedDev/typer.git
synced 2026-10-31 11:31:48 +00:00
Split drawing and processing events into different functions
This commit is contained in:
1 parent
7af696cc20
commit
ab19981179
2 files changed
+3
No files matched your search
@@ -40,6 +40,7 @@ func main() {
|
||||
|
||||
for window.screen != nil {
|
||||
window.Draw()
|
||||
window.ProcessEvents()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -126,7 +126,9 @@ func (window *Window) Draw() {
|
||||
|
||||
// Update screen
|
||||
window.screen.Show()
|
||||
}
|
||||
|
||||
func (window *Window) ProcessEvents() {
|
||||
// Poll event
|
||||
ev := window.screen.PollEvent()
|
||||
|
||||
|
||||
Reference in new issue
Block a user