Hello,
trying my luck with openGL from FTN95 with the following piece of code:
WINAPP
program GLWindow
include <opengl.ins>
include <windows.ins>
character*20 title
title = 'MyGLExercise'
iwin=winio@('%ca@&',title) ! Define Caption
iwin=winio@('%og&',600,400) ! Open GL
iwin = winio@('%sp&',0,0) ! set window position
iwin=winio@('%lw',iwindow) ! leave window open
! Init OpenGL
call glShadeModel (GL_SMOOTH)
call glClearColor (0.0, 0.0, 1.0, 0.0) ! clear screen to blue
call glClearDepth (1.0)
call glEnable (GL_DEPTH_TEST)
call glDepthFunc (GL_LEQUAL)
call glHint (GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST)
! Clear GL Window
call glClear(ior(GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT))
call glLoadIdentity()
! draw triangle
call glTranslatef(-1.5,0.0,-6.0)
call glcolor3f(1.0,0.0,0.0) ! Set color to red
call glBegin(GL_TRIANGLES)
call glVertex3f(0.0,1.0,0.0)
call glVertex3f(-1.0,-1.0,0.0)
call glVertex3f(1.0,-1.0,0.0)
call glEnd()
! draw square
call glTranslatef(3.0,0.0,0.0)
call glBegin(GL_QUADS)
call glVertex3f(-1.0, 1.0, 0.0)
call glVertex3f( 1.0, 1.0, 0.0)
call glVertex3f( 1.0,-1.0, 0.0)
call glVertex3f(-1.0,-1.0, 0.0)
call glEnd()
call sleep@(5.0)
end
I would expect
- openGL window to open - okay
- clear it to blue - not okay, remains black
- display of triangle and quad in red - not okay.
What did I miss ??
Norbert