mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
34596bb1cf
commit
3600c8aa6c
4
doc.go
4
doc.go
@ -45,4 +45,8 @@
|
|||||||
// The EBITEN_INTERNAL_IMAGES_KEY environment variable specifies the key
|
// The EBITEN_INTERNAL_IMAGES_KEY environment variable specifies the key
|
||||||
// to dump all the internal images. This is valid only when the build tag
|
// to dump all the internal images. This is valid only when the build tag
|
||||||
// 'ebitendebug' is specified.
|
// 'ebitendebug' is specified.
|
||||||
|
//
|
||||||
|
// In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go'
|
||||||
|
// statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions that
|
||||||
|
// must be called on the main thread under some conditions (typically, before ebiten.Run is called).
|
||||||
package ebiten
|
package ebiten
|
||||||
|
8
run.go
8
run.go
@ -254,7 +254,7 @@ func (i *imageDumper) update(screen *Image) error {
|
|||||||
// you can disable this automatical device scaling as a result.
|
// you can disable this automatical device scaling as a result.
|
||||||
// You can get the device scale by DeviceScaleFactor function.
|
// You can get the device scale by DeviceScaleFactor function.
|
||||||
//
|
//
|
||||||
// Run must be called from the OS main thread.
|
// Run must be called on the main thread.
|
||||||
// Note that Ebiten bounds the main goroutine to the main OS thread by runtime.LockOSThread.
|
// Note that Ebiten bounds the main goroutine to the main OS thread by runtime.LockOSThread.
|
||||||
//
|
//
|
||||||
// Ebiten tries to call f 60 times a second. In other words,
|
// Ebiten tries to call f 60 times a second. In other words,
|
||||||
@ -342,7 +342,7 @@ func RunWithoutMainLoop(f func(*Image) error, width, height int, scale float64,
|
|||||||
//
|
//
|
||||||
// For actual example, see examples/fullscreen
|
// For actual example, see examples/fullscreen
|
||||||
//
|
//
|
||||||
// ScreenSizeInFullscreen is concurrent-safe.
|
// ScreenSizeInFullscreen must be called on the main thread before ebiten.Run, and is concurrent-safe after ebiten.Run.
|
||||||
func ScreenSizeInFullscreen() (int, int) {
|
func ScreenSizeInFullscreen() (int, int) {
|
||||||
return ui.ScreenSizeInFullscreen()
|
return ui.ScreenSizeInFullscreen()
|
||||||
}
|
}
|
||||||
@ -524,7 +524,7 @@ func SetWindowIcon(iconImages []image.Image) {
|
|||||||
// DeviceScaleFactor might panic on init function on some devices like Android.
|
// DeviceScaleFactor might panic on init function on some devices like Android.
|
||||||
// Then, it is not recommended to call DeviceScaleFactor from init functions.
|
// Then, it is not recommended to call DeviceScaleFactor from init functions.
|
||||||
//
|
//
|
||||||
// DeviceScaleFactor is concurrent-safe.
|
// DeviceScaleFactor must be called on the main thread before ebiten.Run, and is concurrent-safe after ebiten.Run.
|
||||||
func DeviceScaleFactor() float64 {
|
func DeviceScaleFactor() float64 {
|
||||||
return ui.DeviceScaleFactor()
|
return ui.DeviceScaleFactor()
|
||||||
}
|
}
|
||||||
@ -565,7 +565,7 @@ func MaxTPS() int {
|
|||||||
// CurrentTPS returns the current TPS (ticks per second),
|
// CurrentTPS returns the current TPS (ticks per second),
|
||||||
// that represents how many update function is called in a second.
|
// that represents how many update function is called in a second.
|
||||||
//
|
//
|
||||||
// CurrentTPS is concurrent safe.
|
// CurrentTPS is concurrent-safe.
|
||||||
func CurrentTPS() float64 {
|
func CurrentTPS() float64 {
|
||||||
return clock.CurrentTPS()
|
return clock.CurrentTPS()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user