fix opengl init
This commit is contained in:
parent
cb5202f7c4
commit
45f68bcec7
@ -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
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user