Skip to content

Instantly share code, notes, and snippets.

View Niriel's full-sized avatar

Niriel Niriel

View GitHub Profile
@Niriel
Niriel / opengl_vs_goroutines.go
Created February 7, 2013 13:12
OpenGl stops working properly as soon as I try to use goroutines. This piece of code rotates triangle on the screen with OpenGl. I wrote several main loops: * one that uses time.Ticker to control the framerate, * one that listens to SDL events through a channel to know when to stop the program, * one that does both, * and one that does neither (…
package main
import (
"fmt"
"github.com/0xe2-0x9a-0x9b/Go-SDL/sdl"
gl "github.com/chsc/gogl/gl33"
"math"
"runtime"
"time"
"unsafe"