RosettaCodeData/Task/OpenGL/OxygenBasic/opengl.basic

42 lines
798 B
Plaintext

title="Rotating Triangle"
include "OpenglSceneFrame.inc"
sub Initialize(sys hWnd)
'=======================
SetTimer hWnd,1,10,NULL
end sub
'
sub Scene(sys hWnd)
'==================
'
static single ang1,angi1=1
'
glClearColor 0.3, 0.3, 0.5, 0
glClear GL_COLOR_BUFFER_BIT or GL_DEPTH_BUFFER_BIT
'
glLoadIdentity
'
'
gltranslatef 0.0, 0.0, -4.0
glrotatef ang1, 0.0, 0.0, 1.0
'
glBegin GL_TRIANGLES
glColor3f 1.0, 0.0, 0.0 : glVertex3f 0.0, 1.0, 0.0
glColor3f 0.0, 1.0, 0.0 : glVertex3f -1.0, -1.0, 0.0
glColor3f 0.0, 0.0, 1.0 : glVertex3f 1.0, -1.0, 0.0
glEnd
'
'UPDATE ROTATION ANGLES
'
ang1+=angi1
if ang1>360 then ang1-=360
'
end sub
sub Release(sys hwnd)
'====================
killTimer hwnd, 1
end sub