<CsoundSynthesizer>
<CsOptions>

-+Y

</CsOptions>
<CsInstruments>

	sr = 100
	kr = 100
	ksmps = 1
	nchnls = 1

	GLfps	30, .5
	GLpanel	"OpenGL panel", 500, 400
	GLpanel_end
	FLrun

#include "OpenGL.h"

gi1	ftgen	1,0,256,19,1,1,0,1

gi10	ftgen	10,0,256,10,1

;giVidHand	GLopenVideoFile	"madgab.avi", 0
giVidHand	GLopenVideoFile	"C:/My_Docs4/My_Web/OrcSco/images/madgab.avi", 0

GLinsert_i $GL_INIT

	glMatrixMode	$GL_PROJECTION 
	glLoadIdentity
	gluPerspective	30,.1,10
	glMatrixMode	$GL_MODELVIEW 
	glLoadIdentity

	glEnable	$GL_DEPTH_TEST	
	glEnable	$GL_CULL_FACE
	glEnable	$GL_TEXTURE_2D	
	glEnable	$GL_COLOR_MATERIAL


	
GLinsert_i $GL_NOT_VALID
	glClear	$GL_COLOR_BUFFER_BIT + $GL_DEPTH_BUFFER_BIT 

GLinsert_i 1


;///////////////////////////////////////////////////
	instr	1
;///////////////////////////////////////////////////

tos	GLoscili	250, 300, gi1
;tos	=	tos
tph	GLphasor	tos+10
trot	=	tph * 360

tph2	GLphasor	800
tframe	=	tph2 * 389

gkTex	GLvideo2tex	giVidHand, tframe 

	glLoadIdentity
	glRotate		trot, 0,0,1
	glTranslate	0,0,-1.8
	glPushMatrix

;****	standard position
;****	GLtexSquare	.5,       0,1,  1,1,  1,0,  0,0

	glScale		.8,.8,1

	glColor3		.5+tph,.5,.5+tph2

	glTranslate 	0, -.5, 0
	glTranslate 	-.5,0,0

	GLtexSquare	.5,       0,-1,  .5,-1,  .5,-.5,  0,-.5
	glTranslate 	1,0,0
	GLtexSquare	.5,       -.5,-1,  -1,-1,  -1,-.5,  -.5,-.5

	glTranslate 	0,1,0
	GLtexSquare	.5,       -.5,.5,  -1,.5,  -1,0,  -.5,0
	glTranslate 	-1,0,0
	GLtexSquare	.5,       0,.5,  .5,.5,  .5,0,  0,0

	glPopMatrix

GLinsert	1.1
	
	endin



</CsInstruments>
<CsScore>

i1 0 3600 1

</CsScore>
</CsoundSynthesizer>
