Cant get the Nehe Tutorial working?
BlitzMax Forums/BlitzMax Beginners Area/Cant get the Nehe Tutorial working?
| ||
| when I run the opengl tutorials program and it say cant find interface for module "brl.blitzgl" as it seem to me that I need download the brl.blitzgl to put in the blitzmax Mod to make work... is that correct? |
| ||
I got just one problem and going through the tutorials 3
'Framework brl.blitzgl
'Import brl.max2d
Global ScreenWidth:Int=800
Global ScreenHeight:Int=600
Global ScreenDepth:Int=32
GLGraphics(ScreenWidth,ScreenHeight,ScreenDepth,0,BGL_BACKBUFFER | BGL_DEPTHBUFFER) '| BGL_FULLSCREEN
InitGl()
While Not KeyHit( KEY_ESCAPE )
nehe3()
glColor3f(1.0,1.0,1.0)
'Framecounter--------------------------------------------
Framecounter_counter=Framecounter_counter+1
If Framecounter_time=0 Then Framecounter_time=MilliSecs()
If Framecounter_time+1001 <MilliSecs() Then
Framecounter_framerate=Framecounter_counter
Framecounter_counter=0
Framecounter_time=MilliSecs()
EndIf
GLDrawText("FPS : "+Framecounter_framerate,ScreenWidth-(8*12),ScreenHeight-16-8)
'--------------------------------------------------------
GLDrawText("Nehe lesson 3",10,24)
' FlushMem
bglSwapBuffers ' One problem and it doesnt work...how can i make work?
Wend
End
Function InitGl()
glClearColor(0.0, 0.0, 0.0, 0.0)
glClearDepth 1.0
glDepthFunc(GL_LESS)
glEnable(GL_DEPTH_TEST)
glFrontFace(GL_CW)
glShadeModel(GL_SMOOTH)
glViewport(0,0,ScreenWidth,ScreenHeight)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
gluPerspective(45.0,Float(ScreenWidth)/Float(ScreenHeight),1.0,100.0)
glMatrixMode(GL_MODELVIEW)
End Function
Function nehe3()
glClear GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT
glLoadIdentity()
glTranslatef(-1.5,0.0,-6.0)
glBegin GL_POLYGON
glColor3f 1.0,0.0,0.0 ' Set The Color To Red
glVertex3f 0.0, 1.0, 0.0 ' Top
glColor3f 0.0,1.0,0.0 ' Set The Color To Green
glVertex3f 1.0,-1.0, 0.0 ' Bottom Right
glColor3f 0.0,0.0,1.0 ' Set The Color To Blue
glVertex3f -1.0,-1.0, 0.0 ' Bottom Left
glEnd
glTranslatef 3.0,0.0,0.0
glColor3f 0.5,0.5,1.0 ' // Set The Color To Blue One Time Only
glBegin GL_QUADS
glVertex3f -1.0, 1.0, 0.0 ' Top Left
glVertex3f 1.0, 1.0, 0.0 ' Top Right
glVertex3f 1.0,-1.0, 0.0 ' Bottom Right
glVertex3f -1.0,-1.0, 0.0 ' Bottom Left
glEnd
End Function
|
| ||
| brl.blitzgl is obsolete. thats from an old version of BlitzMax. bglswapbuffer = flip() download the up to date ones that work from kfprimm on github: https://github.com/kfprimm/nehe_bmx reference from here: http://www.blitzmax.com/Community/posts.php?topic=41689#1086638 Last edited 2011 |
| ||
| Thanks Jesse :) |