Update comments

This commit is contained in:
Hajime Hoshi 2020-10-21 03:17:40 +09:00
parent 290f05060a
commit eedb947471
3 changed files with 8 additions and 5 deletions

8
doc.go
View File

@ -50,8 +50,9 @@
// } // }
// //
// In the API document, 'the main thread' means the goroutine in init(), main() and their callees without 'go' // 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 // statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions (e.g.,
// must be called on the main thread under some conditions (typically, before ebiten.RunGame is called). // DeviceScaleFactor) that must be called on the main thread under some conditions (typically, before ebiten.RunGame
// is called).
// //
// Environment variables // Environment variables
// //
@ -72,5 +73,6 @@
// `ebitengl` forces to use OpenGL in any environments. // `ebitengl` forces to use OpenGL in any environments.
// //
// `ebitensinglethread` disables Ebiten's thread safety to unlock maximum performance. If you use this you will have // `ebitensinglethread` disables Ebiten's thread safety to unlock maximum performance. If you use this you will have
// to manage threads yourself. Functions like IsKeyPressed will no longer be concurrent-safe with this build tag. // to manage threads yourself. Functions like IsKeyPressed will no longer be concurrent-safe with this build tag and
// must be called from the main thread.
package ebiten package ebiten

View File

@ -18,7 +18,7 @@ import (
"errors" "errors"
) )
// Thread defines threading behavior in ebiten. // Thread defines threading behavior in Ebiten.
type Thread interface { type Thread interface {
Call(func() error) error Call(func() error) error
Loop() Loop()

3
run.go
View File

@ -297,7 +297,8 @@ func SetRunnableOnUnfocused(runnableOnUnfocused bool) {
// 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 must be called on the main thread before the main loop, and is concurrent-safe after the main loop. // DeviceScaleFactor must be called on the main thread before the main loop, and is concurrent-safe after the main
// loop.
func DeviceScaleFactor() float64 { func DeviceScaleFactor() float64 {
return uiDriver().DeviceScaleFactor() return uiDriver().DeviceScaleFactor()
} }