mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Start function in Game interface
This commit is contained in:
@ -8,6 +8,7 @@ import (
|
||||
|
||||
type Game interface {
|
||||
Init()
|
||||
Start()
|
||||
|
||||
FrameStart()
|
||||
Update()
|
||||
@ -26,11 +27,13 @@ func Run(g Game) {
|
||||
w := g.GetWindow()
|
||||
ui := g.GetImGUI()
|
||||
|
||||
g.Init()
|
||||
|
||||
//Simulate an imgui frame during init so any imgui calls are allowed within init
|
||||
tempWidth, tempHeight := w.SDLWin.GetSize()
|
||||
tempFBWidth, tempFBHeight := w.SDLWin.GLGetDrawableSize()
|
||||
ui.FrameStart(float32(tempWidth), float32(tempHeight))
|
||||
g.Init()
|
||||
g.Start()
|
||||
ui.Render(float32(tempWidth), float32(tempHeight), tempFBWidth, tempFBHeight)
|
||||
|
||||
for g.ShouldRun() {
|
||||
|
||||
Reference in New Issue
Block a user