Hi Peter,
This is what I use:
macro AdjustAspect
==================
finit 'intitialise fpu
GetClientRect hwnd,cRect
glViewport 0, 0, crect.right, crect.bottom
aspect=crect.right/crect.bottom
end macro
sub perspective(sys hwnd) label
===============================
glMatrixMode GL_PROJECTION
glLoadIdentity
if pick
gluPickMatrix( mposx, crect.bottom-mposy, 2.0, 2.0, @crect) 'pixel selection zone
end if
gluPerspective 45.0, aspect, 1.0, 1.0e9 'viewAngle,aspect,near,far
glMatrixMode GL_MODELVIEW
glLoadIdentity
end sub
Make sure your gluPerspective prototype specifies doubles, not floats