mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 04:08:53 +01:00
Rename PollEvents -> DoEvents
This commit is contained in:
parent
ffc08a75d3
commit
2b18ce8748
@ -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
|
||||||
|
@ -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]
|
||||||
|
@ -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() {
|
||||||
|
2
ui/ui.go
2
ui/ui.go
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user