diff --git a/platform/platform.go b/platform/platform.go index b1555b5..caba3cf 100644 --- a/platform/platform.go +++ b/platform/platform.go @@ -5,7 +5,6 @@ import ( "runtime" "github.com/FooSoft/lazarus/math" - "github.com/go-gl/gl/v2.1/gl" "github.com/veandco/go-sdl2/sdl" ) @@ -46,11 +45,6 @@ func NewWindow(title string, size math.Vec2i, scene Scene) (*Window, error) { sdl.GLSetAttribute(sdl.GL_CONTEXT_MINOR_VERSION, 1) sdl.GLSetAttribute(sdl.GL_DOUBLEBUFFER, 1) - log.Println("opengl global init") - if err := gl.Init(); err != nil { - return nil, err - } - singleton.sdlIsInit = true } diff --git a/platform/window.go b/platform/window.go index 09649d6..b11d37c 100644 --- a/platform/window.go +++ b/platform/window.go @@ -44,6 +44,11 @@ func newWindow(title string, size math.Vec2i, scene Scene) (*Window, error) { w.makeCurrent() + log.Println("opengl init") + if err := gl.Init(); err != nil { + return nil, err + } + w.imguiContext, err = imgui.New(w.DisplaySize(), w.BufferSize()) if err != nil { w.Destroy()