diff --git a/engine/game.go b/engine/game.go index 9cf12fb..c884227 100755 --- a/engine/game.go +++ b/engine/game.go @@ -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() { diff --git a/main.go b/main.go index 3886038..be1710c 100755 --- a/main.go +++ b/main.go @@ -98,6 +98,9 @@ func (g *OurGame) Init() { simpleMat.SetUnifVec3("lightColor1", lightColor1) } +func (g *OurGame) Start() { +} + func (g *OurGame) FrameStart() { }