Rename PollEvents -> DoEvents

This commit is contained in:
Hajime Hoshi 2014-01-11 18:11:13 +09:00
parent ffc08a75d3
commit 2b18ce8748
4 changed files with 7 additions and 7 deletions

View File

@ -66,7 +66,7 @@ func main() {
s := make(chan os.Signal, 1) s := make(chan os.Signal, 1)
signal.Notify(s, os.Interrupt, syscall.SIGTERM) signal.Notify(s, os.Interrupt, syscall.SIGTERM)
for { for {
u.PollEvents() u.DoEvents()
select { select {
default: default:
drawing <- graphics.NewLazyContext() drawing <- graphics.NewLazyContext()
@ -76,7 +76,7 @@ func main() {
context.Flush(actualContext) context.Flush(actualContext)
}) })
after := time.After(time.Duration(int64(time.Second) / 120)) after := time.After(time.Duration(int64(time.Second) / 120))
u.PollEvents() u.DoEvents()
<-after <-after
case <-s: case <-s:
return return

View File

@ -77,7 +77,7 @@ EbitenGameWindow* CreateGameWindow(size_t width, size_t height, const char* titl
return window; return window;
} }
void PollEvents(void) { void DoEvents(void) {
for (;;) { for (;;) {
NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask NSEvent* event = [NSApp nextEventMatchingMask:NSAnyEventMask
untilDate:[NSDate distantPast] untilDate:[NSDate distantPast]

View File

@ -5,7 +5,7 @@ package cocoa
// //
// void Run(void); // void Run(void);
// void StartApplication(void); // void StartApplication(void);
// void PollEvents(void); // void DoEvents(void);
// //
import "C" import "C"
import ( 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) return u.sharedContext.createGameWindow(width, height, scale, title)
} }
func (u *cocoaUI) PollEvents() { func (u *cocoaUI) DoEvents() {
C.PollEvents() C.DoEvents()
} }
func (u *cocoaUI) RunMainLoop() { func (u *cocoaUI) RunMainLoop() {

View File

@ -33,7 +33,7 @@ type WindowClosedEvent struct {
} }
type UI interface { type UI interface {
PollEvents() DoEvents()
CreateGameWindow(screenWidth, screenHeight, screenScale int, title string) GameWindow CreateGameWindow(screenWidth, screenHeight, screenScale int, title string) GameWindow
RunMainLoop() RunMainLoop()
} }