nehe tutorials

BlitzMax Forums/BlitzMax OpenGL Programming/nehe tutorials

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

You arn't setting Opengl up properly.
Refer to the following code.
SetGraphicsDriver GLGraphicsDriver()
GLGraphics 640,480
' Moved these up here. 
' Only needs to be done once :)
glViewport(0,0,640,480);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();

' Ok, you also need to setupthe Screens perspective.
' ie the Field of view, and the Aspect ratio.
' gluPerspective(FOV,Ratio,NearPlane,farPlane);
gluPerspective(45.0,640/480,0.1,100.0);

' you also need to set the current matrix to the modelviewmatrix.
' this matrix is what lets you move the current world offset from 0,0,0
glMatrixMode(GL_MODELVIEW);					' Select The Modelview Matrix
glLoadIdentity();						' Reset The Modelview Matrix

Repeat

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
glLoadIdentity()
glTranslatef(-1.5,0.0,-6.0);
glBegin(GL_TRIANGLES);
glVertex3f( 0.0, 1.0, 0.0);
glVertex3f(-1.0,-1.0, 0.0);
glVertex3f( 1.0,-1.0, 0.0);
glEnd();


Flip()
Until KeyDown(key_escape)


Any questions ask.

Laters, Drago