Skip to content

Commit

Permalink
examples: opengl: Move gl init call
Browse files Browse the repository at this point in the history
  • Loading branch information
allender authored and veeableful committed Nov 14, 2017
1 parent c2be3e6 commit 492f14c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/opengl/opengl.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ func main() {
}
defer sdl.Quit()

if err = gl.Init(); err != nil {
panic(err)
}

window, err = sdl.CreateWindow(winTitle, sdl.WINDOWPOS_UNDEFINED, sdl.WINDOWPOS_UNDEFINED,
winWidth, winHeight, sdl.WINDOW_OPENGL)
if err != nil {
Expand All @@ -38,6 +34,10 @@ func main() {
}
defer sdl.GLDeleteContext(context)

if err = gl.Init(); err != nil {
panic(err)
}

gl.Enable(gl.DEPTH_TEST)
gl.ClearColor(0.2, 0.2, 0.3, 1.0)
gl.ClearDepth(1)
Expand Down

0 comments on commit 492f14c

Please sign in to comment.