probabilmente hai commesso qualche errore di copiatura...il codice del modulo Mmain è questo:
' Gambas module file
PRIVATE CONST ScrWidth AS Integer = 640
PRIVATE CONST ScrHeight AS Integer = 480
PRIVATE Screen AS NEW Window(TRUE) AS "Screen"
PUBLIC SUB Main()
screen.Width = ScrWidth
screen.Height = ScrHeight
Screen.show()
Screen.Border = Screen.Resizable
InitGL()
END
PUBLIC SUB InitGL()
Gl.ShadeModel(gl.GL_SMOOTH)
Gl.ClearColor(0.0, 0.0, 0.0, 1.0)
Gl.Clear(gl.GL_COLOR_BUFFER_BIT AND gl.GL_DEPTH_BUFFER_BIT)
Gl.ClearDepth(1.0)
Gl.Enable(gl.GL_DEPTH_TEST)
Gl.DepthFunc(gl.GL_LEQUAL)
Gl.Hint(gl.GL_PERSPECTIVE_CORRECTION_HINT, gl.GL_NICEST)
END
PUBLIC SUB screen_resize()
DIM ratio AS Float
DIM Height AS Integer
Height = Screen.Height
IF Height = 0 THEN Height = 1
ratio = Screen.Width / Height
Gl.Viewport(0, 0, Screen.Width, Screen.Height)
Gl.MatrixMode(gl.GL_PROJECTION)
Gl.LoadIdentity()
Glu.Perspective(45.0, ratio, 0.1, 100.0)
Gl.MatrixMode(gl.GL_MODELVIEW)
GL.LoadIdentity()
END
PUBLIC SUB Screen_draw()
gl.ClearColor(0, 0, 0, 1)
Gl.Clear(gl.GL_COLOR_BUFFER_BIT AND gl.GL_DEPTH_BUFFER_BIT)
Gl.LoadIdentity()
Gl.Translatef(-1.5, 0.0, -6.0)
gl.Begin(gl.GL_TRIANGLES)
gl.Vertex3f(0.0, 1.0, 0.0)
gl.Vertex3f(-1.0, -1.0, 0.0)
gl.Vertex3f(1.0, -1.0, 0.0)
gl.End
Gl.Translatef(3.0, 0.0, 0.0)
gl.Begin(gl.GL_QUADS)
gl.Vertex3f(-1.0, 1.0, 0.0)
gl.Vertex3f(1.0, 1.0, 0.0)
gl.Vertex3f(1.0, -1.0, 0.0)
gl.Vertex3f(-1.0, -1.0, 0.0)
gl.End
WAIT 0.01
END
PUBLIC SUB Screen_keyPress()
IF key.Code = key.F1 THEN Screen.Fullscreen = NOT Screen.Fullscreen
IF key.Code = key.Esc THEN Screen.Close()
END