'-----------------------------------
'CREATE SCENE FRAME AND SWAP BUFFERS
'===================================
'
static RECT crect
static single sx,sy,sz
'
if act then
'----------
'
'
'SET THE VIEWPORT AND PERSPECTIVE
'
GetClientRect hwnd,&cRect
glViewport 0, 0, crect.right, crect.bottom
double aspect=crect.right/crect.bottom
'
glMatrixMode GL_PROJECTION
glLoadIdentity
gluPerspective 45, aspect, 1.0, 100
glMatrixMode GL_MODELVIEW
glLoadIdentity
'
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
glClearColor 0.5, 0, 0, 0
'
'ACTIVATE TEXTURE
'----------------
'
glEnable GL_TEXTURE_2D
glBindTexture GL_TEXTURE_2D,texn[1]
'
sx=0.2 : sy=0.16 : sz=-1
'
'
'MOVEMENT
'--------
'
'glrotatef ang1, 0,0,1
single x=cos(rad(ang1))*.1 ,y=sin(rad(ang1))*.1,z=0
gltranslatef x,y,z
'
'DRAW SHAPE
'----------
'
'this quad is drawn clockwise
'
glbegin GL_QUADS
'
glTexCoord2f 0,0 : glvertex3f -sx, -sy, sZ
glTexCoord2f 0,1 : glvertex3f -sx, sy, sZ
glTexCoord2f 1,1 : glvertex3f sx, sy, sZ
glTexCoord2f 1,0 : glvertex3f sx, -sy, sZ
'
glend
'
glDisable GL_TEXTURE_2D
'
glfinish
swapBuffers hdc
'
'
'UPDATE ROTATION ANGLES
'----------------------
'
ang1+=angi1
act=0
'
return 0 'done