internal/ui: start implementing UserInterface for PS5

Updates #2799
This commit is contained in:
Hajime Hoshi 2023-10-29 19:12:55 +09:00
parent 5fe8c29b4c
commit c4ce1b3503

View File

@ -47,7 +47,12 @@ func (*graphicsDriverCreatorImpl) newPlayStation5() (graphicsdriver.Graphics, er
return nil, errors.New("ui: not implemented yet") return nil, errors.New("ui: not implemented yet")
} }
const deviceScaleFactor = 1 const (
// TODO: Get this value from the SDK.
screenWidth = 3840
screenHeight = 2160
deviceScaleFactor = 1
)
func init() { func init() {
runtime.LockOSThread() runtime.LockOSThread()
@ -68,11 +73,22 @@ func (u *UserInterface) Run(game Game, options *RunOptions) error {
} }
func (u *UserInterface) initOnMainThread(options *RunOptions) error { func (u *UserInterface) initOnMainThread(options *RunOptions) error {
g, lib, err := newGraphicsDriver(&graphicsDriverCreatorImpl{}, options.GraphicsLibrary)
if err != nil {
return err
}
u.graphicsDriver = g
u.setGraphicsLibrary(lib)
return nil return nil
} }
func (u *UserInterface) loopGame() error { func (u *UserInterface) loopGame() error {
// TODO: Implement this for {
if err := u.context.updateFrame(u.graphicsDriver, screenWidth, screenHeight, deviceScaleFactor, u, nil); err != nil {
return err
}
}
return nil return nil
} }