func drawSelection(p1, p2 Point) { min, max := minMaxPoints(p1, p2) gl.Color3ub(255, 0, 0) gl.Begin(gl.LINES) gl.Vertex2i(min.X, min.Y) gl.Vertex2i(max.X, min.Y) gl.Vertex2i(min.X, min.Y) gl.Vertex2i(min.X, max.Y) gl.Vertex2i(max.X, max.Y) gl.Vertex2i(max.X, min.Y) gl.Vertex2i(max.X, max.Y) gl.Vertex2i(min.X, max.Y) gl.End() gl.Color3ub(255, 255, 255) }
func (self *Tile) Draw() { switch self.CurrentLOD { case -1: // TODO: draw single color r, i := self.What.Center() c := complex(r, i) color := mandelbrotAt(c) gl.BindTexture(gl.TEXTURE_2D, 0) gl.Color3ub(color.R, color.G, color.B) drawQuad(self.X, self.Y, self.W, self.H, 0, 0, 1, 1) gl.Color3ub(255, 255, 255) case 0: gl.BindTexture(gl.TEXTURE_2D, self.Texture[0]) drawQuad(self.X, self.Y, self.W, self.H, 0, 0, 1, 1) case 1: gl.BindTexture(gl.TEXTURE_2D, self.Texture[1]) drawQuad(self.X, self.Y, self.W, self.H, 0, 0, 1, 1) default: panic("unreachable") } }