'---------------------
sub orthopersp(long p)
'=====================
'
double m,n
n=orthosize
m=n*aspect
'
if p then
glOrtho -m, m, -n, n, 1.0, 100.0 'left right bottom top near far
else
gluPerspective 45.0, aspect, 1, 100.0 'viewAngle,aspect,near,far
end if
end sub
'
'------------------------
sub SetProjection(long p)
'========================
'
glMatrixMode GL_PROJECTION
glLoadIdentity
orthopersp(p)
glMatrixMode GL_MODELVIEW
glLoadIdentity
end sub