This commit is contained in:
Andrey Parhomenko 2023-02-17 09:04:47 +05:00
parent 28622fda2d
commit dbd1b50ff7

View file

@ -1,44 +0,0 @@
package gx
import (
"github.com/hajimehoshi/ebiten/v2"
)
type WindowConfig struct {
Title string
Width, Height int
}
type Engine struct {
wcfg *WindowConfig
}
type engine Engine
func New(
title string,
w, h int,
) *Engine {
e := &Engine{
}
}
func (e *engine) Update() error {
return nil
}
func (e *engine) Draw(s *ebiten.Image) {
}
func (e *engine) Layout(ow, oh int) (int, int) {
return e.wcfg.Width, e.wcfg.Height
}
func (e *Engine) Run() error {
ebiten.SetWindowTitle(e.wcfg.Title)
ebiten.SetWindowSize(e.wcfg.Width, e.wcfg.Height)
return ebiten.RunGame(engine(e))
}