cloud-game/pkg/worker/caged/app/app.go
Sergey Stepanov 7ee98c1b03 Add keyboard and mouse support
Keyboard and mouse controls will now work if you use the kbMouseSupport parameter in the config for Libretro cores. Be aware that capturing mouse and keyboard controls properly is only possible in fullscreen mode.

Note: In the case of DOSBox, a virtual filesystem handler is not yet implemented, thus each game state will be shared between all rooms (DOS game instances) of CloudRetro.
2024-08-02 11:04:44 +03:00

34 lines
530 B
Go

package app
type App interface {
AudioSampleRate() int
AspectRatio() float32
AspectEnabled() bool
Init() error
ViewportSize() (int, int)
Scale() float64
Start()
Close()
SetAudioCb(func(Audio))
SetVideoCb(func(Video))
SetDataCb(func([]byte))
Input(port int, device byte, data []byte)
KbMouseSupport() bool
}
type Audio struct {
Data []int16
Duration int32 // up to 6y nanosecond-wise
}
type Video struct {
Frame RawFrame
Duration int32
}
type RawFrame struct {
Data []byte
Stride int
W, H int
}