func display() { gl.Clear(gl.COLOR_BUFFER_BIT) gl.Begin(gl.TRIANGLES) l := t.units for e := l.Front(); e != nil; e = e.Next() { b := e.Value.(*Entity) //r := b.rot_matrix p := b.pos gl.Color3f(0.0, 0.0, 1.0) /* blue */ gl.Vertex2f(p[0], p[1]) gl.Color3f(0.0, 1.0, 0.0) /* green */ gl.Vertex2f(20+p[0], 20+p[1]) gl.Color3f(1.0, 0.0, 0.0) /* red */ gl.Vertex2f(p[0], 20+p[1]) } gl.End() gl.Flush() /* Single buffered, so needs a flush. */ glut.SwapBuffers() }
func display() { gl.Clear(gl.COLOR_BUFFER_BIT) drawShip(angle) drawBullets() glut.SwapBuffers() }