mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: refactoring
This commit is contained in:
parent
fd1a90411a
commit
bba32bc06e
@ -23,7 +23,6 @@ package nintendosdk
|
||||
//
|
||||
// // UI
|
||||
// void EbitenInitializeGame();
|
||||
// void EbitenGetScreenSize(int* width, int* height);
|
||||
// void EbitenBeginFrame();
|
||||
// void EbitenEndFrame();
|
||||
import "C"
|
||||
@ -32,12 +31,6 @@ func InitializeGame() {
|
||||
C.EbitenInitializeGame()
|
||||
}
|
||||
|
||||
func ScreenSize() (int, int) {
|
||||
var width, height C.int
|
||||
C.EbitenGetScreenSize(&width, &height)
|
||||
return int(width), int(height)
|
||||
}
|
||||
|
||||
func BeginFrame() {
|
||||
C.EbitenBeginFrame()
|
||||
}
|
||||
|
@ -20,6 +20,9 @@ struct Touch {
|
||||
int y;
|
||||
};
|
||||
|
||||
const int kScreenWidth = 1920;
|
||||
const int kScreenHeight = 1080;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -75,8 +75,7 @@ func (u *userInterfaceImpl) Run(game Game, options *RunOptions) error {
|
||||
gamepad.Update()
|
||||
u.updateInputState()
|
||||
|
||||
w, h := nintendosdk.ScreenSize()
|
||||
if err := u.context.updateFrame(u.graphicsDriver, float64(w), float64(h), deviceScaleFactor, u); err != nil {
|
||||
if err := u.context.updateFrame(u.graphicsDriver, float64(C.kScreenWidth), float64(C.kScreenHeight), deviceScaleFactor, u); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user