예제 #1
0
func drawSelection(p1, p2 Point) {
	min, max := minMaxPoints(p1, p2)

	gl.Color3ub(255, 0, 0)
	gl.Begin(gl.LINES)
	gl.Vertex2i(int(min.X), int(min.Y))
	gl.Vertex2i(int(max.X), int(min.Y))

	gl.Vertex2i(int(min.X), int(min.Y))
	gl.Vertex2i(int(min.X), int(max.Y))

	gl.Vertex2i(int(max.X), int(max.Y))
	gl.Vertex2i(int(max.X), int(min.Y))

	gl.Vertex2i(int(max.X), int(max.Y))
	gl.Vertex2i(int(min.X), int(max.Y))
	gl.End()
	gl.Color3ub(255, 255, 255)
}
예제 #2
0
func drawProgress(w, h, percents, pending int) {
	switch pending {
	case None:
		gl.Color3ub(200, 0, 0)
		drawQuad(0, h-BarSize, w, BarSize, 0, 0, 1, 1)
		gl.Color3ub(255, 255, 255)
		return
	case Small:
		gl.Color3ub(200, 200, 0)
	case Big:
		gl.Color3ub(200, 200, 0)
		drawQuad(0, h-BarSize, w, BarSize, 0, 0, 1, 1)
		gl.Color3ub(200, 0, 0)
	}
	step := float32(w) / 100
	drawQuad(0, h-BarSize, int(float32(percents)*step), BarSize, 0, 0, 1, 1)
	gl.Color3ub(255, 255, 255)
}