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'
// 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.RunGame is called).
// statement. It is assured that 'the main thread' runs on the OS main thread. There are some Ebiten functions (e.g.,
// DeviceScaleFactor) that must be called on the main thread under some conditions (typically, before ebiten.RunGame
// is called).
//
// Environment variables
//
@ -72,5 +73,6 @@
// `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
// 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

View File

@ -18,7 +18,7 @@ import (
"errors"
)
// Thread defines threading behavior in ebiten.
// Thread defines threading behavior in Ebiten.
type Thread interface {
Call(func() error) error
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.
// 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 {
return uiDriver().DeviceScaleFactor()
}