mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-02 22:14:29 +01:00
doc: goroutine-safe -> concurrent-safe
This commit is contained in:
parent
6a6f9ad2a2
commit
922fc7edfc
14
input.go
14
input.go
@ -20,28 +20,28 @@ import (
|
||||
|
||||
// IsKeyPressed returns a boolean indicating whether key is pressed.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func IsKeyPressed(key Key) bool {
|
||||
return ui.CurrentInput().IsKeyPressed(ui.Key(key))
|
||||
}
|
||||
|
||||
// CursorPosition returns a position of a mouse cursor.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func CursorPosition() (x, y int) {
|
||||
return ui.CurrentInput().CursorPosition()
|
||||
}
|
||||
|
||||
// IsMouseButtonPressed returns a boolean indicating whether mouseButton is pressed.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func IsMouseButtonPressed(mouseButton MouseButton) bool {
|
||||
return ui.CurrentInput().IsMouseButtonPressed(ui.MouseButton(mouseButton))
|
||||
}
|
||||
|
||||
// GamepadAxisNum returns the number of axes of the gamepad.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
//
|
||||
// NOTE: Gamepad API is available only on desktops, Chrome and Firefox.
|
||||
// To use this API, browsers might require rebooting the browser.
|
||||
@ -51,7 +51,7 @@ func GamepadAxisNum(id int) int {
|
||||
|
||||
// GamepadAxis returns the float value [-1.0 - 1.0] of the axis.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
//
|
||||
// NOTE: Gamepad API is available only on desktops, Chrome and Firefox.
|
||||
// To use this API, browsers might require rebooting the browser.
|
||||
@ -61,7 +61,7 @@ func GamepadAxis(id int, axis int) float64 {
|
||||
|
||||
// GamepadButtonNum returns the number of the buttons of the gamepad.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
//
|
||||
// NOTE: Gamepad API is available only on desktops, Chrome and Firefox.
|
||||
// To use this API, browsers might require rebooting the browser.
|
||||
@ -71,7 +71,7 @@ func GamepadButtonNum(id int) int {
|
||||
|
||||
// IsGamepadButtonPressed returns the boolean indicating the buttons is pressed or not.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
//
|
||||
// NOTE: Gamepad API is available only on desktops, Chrome and Firefox.
|
||||
// To use this API, browsers might require rebooting the browser.
|
||||
|
10
run.go
10
run.go
@ -134,7 +134,7 @@ const FPS = 60
|
||||
|
||||
// CurrentFPS returns the current number of frames per second of rendering.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
//
|
||||
// This value represents how many times rendering happens in 1/60 second and
|
||||
// NOT how many times logical game updating (a passed function to Run) happens.
|
||||
@ -148,7 +148,7 @@ func CurrentFPS() float64 {
|
||||
// The game screen is not updated when IsRunningSlowly is true.
|
||||
// It is recommended to skip heavy processing, especially drawing, when IsRunningSlowly is true.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func IsRunningSlowly() bool {
|
||||
return currentRunContext.IsRunningSlowly()
|
||||
}
|
||||
@ -230,21 +230,21 @@ func Run(f func(*Image) error, width, height, scale int, title string) error {
|
||||
// SetScreenSize changes the (logical) size of the screen.
|
||||
// This doesn't affect the current scale of the screen.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func SetScreenSize(width, height int) {
|
||||
currentRunContext.SetScreenSize(width, height)
|
||||
}
|
||||
|
||||
// SetScreenSize changes the scale of the screen.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func SetScreenScale(scale int) {
|
||||
currentRunContext.SetScreenScale(scale)
|
||||
}
|
||||
|
||||
// ScreenScale returns the current screen scale.
|
||||
//
|
||||
// This function is goroutine-safe.
|
||||
// This function is concurrent-safe.
|
||||
func ScreenScale() int {
|
||||
return ui.CurrentUI().ScreenScale()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user