!******************************************************************************
!*       This is a part of the Compaq Visual Fortran Source Code Samples.
!******************************************************************************
subroutine InitTexture()
use dfopngl
    call fglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, REAL(GL_REPEAT))
    call fglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, REAL(GL_REPEAT))
    call fglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, REAL(GL_NEAREST))
    call fglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, REAL(GL_NEAREST))
    call fglTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, REAL(GL_MODULATE))
end

subroutine Init()
use dfopngl

external InitMaterials
external InitTexture
external InitMesh

    call fglClearColor(0.0, 0.0, 0.0, 0.0)

    call fglShadeModel(GL_SMOOTH)

    call fglFrontFace(GL_CW)

    call fglDepthFunc(GL_LEQUAL)
    call fglEnable(GL_DEPTH_TEST)

    call InitMaterials()
    call InitTexture()
    call InitMesh()

    call fglMatrixMode(GL_MODELVIEW)
    call fglTranslatef(0.0, 0.4, -1.8)
    call fglScalef(2.0, 2.0, 2.0)
    call fglRotatef(-35.0, 1.0, 0.0, 0.0)
    call fglRotatef(35.0, 0.0, 0.0, 1.0)
end

