!******************************************************************************
!*       This is a part of the Compaq Visual Fortran Source Code Samples.
!******************************************************************************
subroutine Key_l()
use twaveinc
use dfopngl
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_Key_l@0' :: Key_l
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'Key_l' :: Key_l
!DEC$ ENDIF

    lighting = NOT(lighting)
    if (lighting) then
        call fglEnable(GL_LIGHTING)
        call fglEnable(GL_LIGHT0)
    else
        call fglDisable(GL_LIGHTING)
        call fglDisable(GL_LIGHT0)
    end if
end

subroutine Key_d()
use twaveinc
use dfopngl

!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_Key_d@0' :: Key_d
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'Key_d' :: Key_d
!DEC$ ENDIF

    depth = NOT(depth)
    if (depth) then
        call fglEnable(GL_DEPTH_TEST)
        clearMask = IOR(clearmask, GL_DEPTH_BUFFER_BIT)
    else
        call fglDisable(GL_DEPTH_TEST)
        clearMask = IAND(clearmask, NOT(GL_DEPTH_BUFFER_BIT))
    end if
end

