From 5adbc8b1e0e9985ae963f762dc49f349372a866d Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Sat, 26 Apr 2014 20:22:58 +0200 Subject: [PATCH] preparing to go concurrent --- ld48-29.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ld48-29.go b/ld48-29.go index ed9aebd..cdc50f1 100644 --- a/ld48-29.go +++ b/ld48-29.go @@ -159,6 +159,17 @@ func drawSprite(texture gl.Texture, x float64, y float64, a float64, list uint) // main func main() { + c := make(chan int) + + go renderer(c) + + <-c +} + + +// renderer + +func renderer(c chan int) { runtime.LockOSThread() glfw.SetErrorCallback(onError) @@ -185,11 +196,10 @@ func main() { window.SwapBuffers() glfw.PollEvents() } + + c <- 1 } - -// renderer - func setup() (textures map[string]gl.Texture, lists map[string]uint) { gl.Enable(gl.TEXTURE_2D) gl.Enable(gl.DEPTH_TEST)