subroutine CreateDisplayList ()
use msfwin
use opengl
use cubeinc
real(4) glfMaterialColor(4)
data glfMaterialColor / 0.0, 0.0, 1.0, 1.0 /
call fglNewList (DRAWCUBE, GL_COMPILE)
call fglMaterialfv (GL_FRONT, GL_AMBIENT_AND_DIFFUSE, LOC(glfMaterialColor))
call fglBegin(GL_POLYGON)
call fglNormal3f (0.0, 0.0, 1.0)
call fglVertex3f(1.0, 1.0, 1.0)
call fglVertex3f(-1.0, 1.0, 1.0)
call fglVertex3f(-1.0, -1.0, 1.0)
call fglVertex3f(1.0, -1.0, 1.0)
call fglEnd()
call fglBegin(GL_POLYGON)
call fglNormal3f (0.0, 0.0, -1.0)
call fglVertex3f(1.0, 1.0, -1.0)
call fglVertex3f(1.0, -1.0, -1.0)
call fglVertex3f(-1.0, -1.0, -1.0)
call fglVertex3f(-1.0, 1.0, -1.0)
call fglEnd()
call fglBegin(GL_POLYGON)
call fglNormal3f (-1.0, 0.0, 0.0)
call fglVertex3f(-1.0, 1.0, 1.0)
call fglVertex3f(-1.0, 1.0, -1.0)
call fglVertex3f(-1.0, -1.0, -1.0)
call fglVertex3f(-1.0, -1.0, 1.0)
call fglEnd()
call fglBegin(GL_POLYGON)
call fglNormal3f (1.0, 0.0, 0.0)
call fglVertex3f(1.0, 1.0, 1.0)
call fglVertex3f(1.0, -1.0, 1.0)
call fglVertex3f(1.0, -1.0, -1.0)
call fglVertex3f(1.0, 1.0, -1.0)
call fglEnd()
call fglBegin(GL_POLYGON)
call fglNormal3f (0.0, 1.0, 0.0)
call fglVertex3f(-1.0, 1.0, -1.0)
call fglVertex3f(-1.0, 1.0, 1.0)
call fglVertex3f(1.0, 1.0, 1.0)
call fglVertex3f(1.0, 1.0, -1.0)
call fglEnd()
call fglBegin(GL_POLYGON)
call fglNormal3f (0.0, -1.0, 0.0)
call fglVertex3f(-1.0, -1.0, -1.0)
call fglVertex3f(1.0, -1.0, -1.0)
call fglVertex3f(1.0, -1.0, 1.0)
call fglVertex3f(-1.0, -1.0, 1.0)
call fglEnd()
call fglEndList ()
end
subroutine DrawScene (hdc, nAngle)
!MS$ ATTRIBUTES VALUE :: hdc
!MS$ ATTRIBUTES VALUE :: nAngle
use msfwin
use opengl
use cubeinc
integer(4) hdc, nAngle
integer i, j, k
logical(4) bret
call fglClear(IOR(GL_COLOR_BUFFER_BIT , GL_DEPTH_BUFFER_BIT))
call fglMatrixMode(GL_MODELVIEW)
call fglLoadIdentity()
call fglTranslatef(0.0, 0.0, -32.0)
call fglRotatef(50.0, 1.0, 0.0, 0.0)
call fglRotatef(REAL(nAngle), 0.0, 1.0, 0.0)
do i = -3, 3, 3
do j = -3, 3, 3
do k = -3, 3, 3
call fglPushMatrix ()
call fglTranslatef (REAL(i), REAL(j), REAL(k))
call fglCallList (DRAWCUBE)
call fglPopMatrix ()
end do
end do
end do
bret = SwapBuffers(hdc)
end