예제 #1
0
파일: manager.go 프로젝트: genbattle/haunts
func RenderAdvanced(x, y, dx, dy, rot float64, flip bool) {
	if textureList != 0 {
		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(&run[0])
		gl.Enable(gl.TEXTURE_2D)
		gl.CallList(textureList)
		gl.PopMatrix()
	}
}
예제 #2
0
파일: manager.go 프로젝트: genbattle/haunts
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(&run[0])
	gl.CallList(textureList)
	gl.PopMatrix()
}