From 2b18ce8748f6681e545224b87f6e67ba04e0edf4 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 11 Jan 2014 18:11:13 +0900 Subject: [PATCH] Rename PollEvents -> DoEvents --- example/main.go | 4 ++-- ui/cocoa/mainloop.c | 2 +- ui/cocoa/ui.go | 6 +++--- ui/ui.go | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example/main.go b/example/main.go index 91db1f883..6e2544228 100644 --- a/example/main.go +++ b/example/main.go @@ -66,7 +66,7 @@ func main() { s := make(chan os.Signal, 1) signal.Notify(s, os.Interrupt, syscall.SIGTERM) for { - u.PollEvents() + u.DoEvents() select { default: drawing <- graphics.NewLazyContext() @@ -76,7 +76,7 @@ func main() { context.Flush(actualContext) }) after := time.After(time.Duration(int64(time.Second) / 120)) - u.PollEvents() + u.DoEvents() <-after case <-s: return diff --git a/ui/cocoa/mainloop.c b/ui/cocoa/mainloop.c index be6d13176..c0c685508 100644 --- a/ui/cocoa/mainloop.c +++ b/ui/cocoa/mainloop.c @@ -77,7 +77,7 @@ EbitenGameWindow* CreateGameWindow(size_t width, size_t height, const char* titl return window; } -void PollEvents(void) { +void DoEvents(void) { for (;;) { NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] diff --git a/ui/cocoa/ui.go b/ui/cocoa/ui.go index ebfdb82eb..37a9fe4de 100644 --- a/ui/cocoa/ui.go +++ b/ui/cocoa/ui.go @@ -5,7 +5,7 @@ package cocoa // // void Run(void); // void StartApplication(void); -// void PollEvents(void); +// void DoEvents(void); // import "C" import ( @@ -42,8 +42,8 @@ func (u *cocoaUI) CreateGameWindow(width, height, scale int, title string) ui.Ga return u.sharedContext.createGameWindow(width, height, scale, title) } -func (u *cocoaUI) PollEvents() { - C.PollEvents() +func (u *cocoaUI) DoEvents() { + C.DoEvents() } func (u *cocoaUI) RunMainLoop() { diff --git a/ui/ui.go b/ui/ui.go index a5de0b383..eba3dac42 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -33,7 +33,7 @@ type WindowClosedEvent struct { } type UI interface { - PollEvents() + DoEvents() CreateGameWindow(screenWidth, screenHeight, screenScale int, title string) GameWindow RunMainLoop() }