1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
procedure GLInit;
const
light0_position:TGLArrayf4=( 0.0, 5.0, 5.0, 1.0);
ambient: TGLArrayf4=( 0.98, 0.878, 0.478, 1.0);
var
stri : string;
begin
SetExceptionMask([exInvalidOp..exPrecision]);
glMatrixMode(GL_PROJECTION);
glLoadIdentity;
with batdisgnfrm.perspanel do
glFrustum(-xfrustum, xfrustum, -xfrustum * height / width, xfrustum * height / width, poseecran, 12000.0);
// glFrustum(-1.0, 1.0, -1.0, 1.0, poseecran, 12000.0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity;
glEnable(GL_DEPTH_TEST);
glclearcolor(0.0, 0.0, 0.0, 1.0);
// glclearcolor(0.149, 0.490, 0.929, 1.0); // ciel
glEnable(GL_LIGHTING);
glLightfv(GL_LIGHT0, GL_POSITION, @light0_position);
glLightfv(GL_LIGHT0, GL_AMBIENT, @ambient);
glEnable(GL_LIGHT0);
gldisable(GL_LIGHTING);
// stri := glgetstring(GL_VERSION);
// showmessage(stri);
end; |