Skip to content

Commit 492f14c

Browse files
allenderveeableful
authored andcommitted
examples: opengl: Move gl init call
1 parent c2be3e6 commit 492f14c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/opengl/opengl.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@ func main() {
2222
}
2323
defer sdl.Quit()
2424

25-
if err = gl.Init(); err != nil {
26-
panic(err)
27-
}
28-
2925
window, err = sdl.CreateWindow(winTitle, sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED,
3026
winWidth, winHeight, sdl.WINDOW_OPENGL)
3127
if err != nil {
@@ -38,6 +34,10 @@ func main() {
3834
}
3935
defer sdl.GLDeleteContext(context)
4036

37+
if err = gl.Init(); err != nil {
38+
panic(err)
39+
}
40+
4141
gl.Enable(gl.DEPTH_TEST)
4242
gl.ClearColor(0.2, 0.2, 0.3, 1.0)
4343
gl.ClearDepth(1)

0 commit comments

Comments
 (0)