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 {
|
type Game interface {
|
||||||
Init()
|
Init()
|
||||||
|
Start()
|
||||||
|
|
||||||
FrameStart()
|
FrameStart()
|
||||||
Update()
|
Update()
|
||||||
@ -26,11 +27,13 @@ func Run(g Game) {
|
|||||||
w := g.GetWindow()
|
w := g.GetWindow()
|
||||||
ui := g.GetImGUI()
|
ui := g.GetImGUI()
|
||||||
|
|
||||||
|
g.Init()
|
||||||
|
|
||||||
//Simulate an imgui frame during init so any imgui calls are allowed within init
|
//Simulate an imgui frame during init so any imgui calls are allowed within init
|
||||||
tempWidth, tempHeight := w.SDLWin.GetSize()
|
tempWidth, tempHeight := w.SDLWin.GetSize()
|
||||||
tempFBWidth, tempFBHeight := w.SDLWin.GLGetDrawableSize()
|
tempFBWidth, tempFBHeight := w.SDLWin.GLGetDrawableSize()
|
||||||
ui.FrameStart(float32(tempWidth), float32(tempHeight))
|
ui.FrameStart(float32(tempWidth), float32(tempHeight))
|
||||||
g.Init()
|
g.Start()
|
||||||
ui.Render(float32(tempWidth), float32(tempHeight), tempFBWidth, tempFBHeight)
|
ui.Render(float32(tempWidth), float32(tempHeight), tempFBWidth, tempFBHeight)
|
||||||
|
|
||||||
for g.ShouldRun() {
|
for g.ShouldRun() {
|
||||||
|
|||||||
Reference in New Issue
Block a user