Exemple #1
0
func RenderAdvanced(x, y, dx, dy, rot float64, flip bool) {
	setupTextureList()
	if textureList == 0 {
		return
	}
	var run, op mathgl.Mat4
	run.Identity()
	op.Translation(float32(x), float32(y), 0)
	run.Multiply(&op)
	op.Translation(float32(dx/2), float32(dy/2), 0)
	run.Multiply(&op)
	op.RotationZ(float32(rot))
	run.Multiply(&op)
	if flip {
		op.Translation(float32(-dx/2), float32(-dy/2), 0)
		run.Multiply(&op)
		op.Scaling(float32(dx), float32(dy), 1)
		run.Multiply(&op)
	} else {
		op.Translation(float32(dx/2), float32(-dy/2), 0)
		run.Multiply(&op)
		op.Scaling(float32(-dx), float32(dy), 1)
		run.Multiply(&op)
	}
	gl.PushMatrix()
	gl.MultMatrixf((*gl.Float)(&run[0]))
	gl.Enable(gl.TEXTURE_2D)
	gl.CallList(textureList)
	gl.PopMatrix()
}
Exemple #2
0
func Render(x, y, dx, dy float64) {
	var run, op mathgl.Mat4
	run.Identity()
	op.Translation(float32(x), float32(y), 0)
	run.Multiply(&op)
	op.Scaling(float32(dx), float32(dy), 1)
	run.Multiply(&op)

	gl.PushMatrix()
	gl.Enable(gl.TEXTURE_2D)
	gl.MultMatrixf((*gl.Float)(&run[0]))
	gl.CallList(textureList)
	gl.PopMatrix()
}