<CsoundSynthesizer>
<CsOptions>

-+Y ;*** no audio

</CsOptions>
<CsInstruments>

	sr = 100
	kr = 100
	ksmps = 1
	nchnls = 1

giImg	init	1
giOutImg	init	2
giwidth,giheight,ibpp bmopen	"HyperCubis.png",giImg, 1 ;*** you can use another image


giElem		init	5

giOutTab		ftgen	1,0,256, -2,    1/4,1/4,1/4,.4,.4

	GLfps	40, .5
	GLpanel	"Example of imgGain", 512, 512
	GLpanel_end

	FLpanel	"This Panel contains a Slider Bank",400,150,530
	FLscroll	400, 150
	FLcolor	-2
	FLslidBnk	"red@green@blue@texCoord1@texCoord2", giElem, giOutTab , 300,giElem*20, 80,10 ;***, 0, giMinMaxTab, giExpTab, -12, 
	FLcolor	-1
	FLscroll_end
	FLpanel_end



	FLrun

#include "OpenGL.h"

tb0_init	giOutTab
gkTrig	init	0

gi1	ftgen	20,0,256,19,1,1,0,1
gi10	ftgen	10,0,256,10,1

GLinsert_i $GL_INIT

	glMatrixMode	$GL_PROJECTION 
	glLoadIdentity
	gluPerspective	30,.1,10
	glMatrixMode	$GL_MODELVIEW 
	glLoadIdentity
	glClearColor	0,0,.2,1

	glEnable	$GL_DEPTH_TEST	

	glEnable	$GL_TEXTURE_2D	

	glMaterial $GL_SPECULAR, .8,.8,0,1
	GLshininess 19
	glShadeModel $GL_FLAT
	glColor	1,1,1,1
	
GLinsert_i $GL_NOT_VALID
	glClear	$GL_COLOR_BUFFER_BIT + $GL_DEPTH_BUFFER_BIT 

GLinsert_i 1


;///////////////////////////////////////////////////
	instr	1
;///////////////////////////////////////////////////

k2	oscili	1,.013456,gi1
k4 	phasor	.0211111

kred	=	tb0(k(0)) *4
kgreen	=	tb0(k(1)) *4
kblue	=	tb0(k(2)) *4

k3	=	tb0(k(3)) *4
k3b	=	tb0(k(4)) *4

	glLoadIdentity
	glTranslate	0,0,-1
	glPushMatrix
	glRotate		k2*360,0,0,1

gkTrig	changed kred,kgreen,kblue

koutTrig	imgGain		giOutImg, gkTrig, kred,kgreen,kblue,1, giImg, .8
itex	img2GLtex		koutTrig, giOutImg,1,1
	glBindTexture	itex
	GLtexSquare	1,  0+k3,1-k3b,  1-k3,1-k3b,  1-k3,0+k3b,  k3+0,k3b+0

	glPopMatrix

GLinsert	1.1
	
	endin


</CsInstruments>
<CsScore>

i1 0 3600 1


</CsScore>
</CsoundSynthesizer>

