OpenGL Calls

BlitzMax Forums/MiniB3D Module/OpenGL Calls

BLaBZ(Posted 2012) [#1]
How do I make openGL calls using minib3d?

How do I get a triangle to render on the camera using minib3d?

glLoadIdentity()														' Reset The Current Modelview Matrix
			
			glBegin(GL_TRIANGLE_STRIP)										' Build Quad From A Triangle Strip
				glTexCoord2d(1,1); glVertex3f(5,5,0)					' Top Right
				glTexCoord2d(0,1); glVertex3f(-5,5,0)					' Top Left
				glTexCoord2d(1,0); glVertex3f(5,-5,0)					' Bottom Right
				glTexCoord2d(0,0); glVertex3f(-5,-5,0)					' Bottom Left
			glEnd()	



BLaBZ(Posted 2012) [#2]
Nvm, looks like these calls need to be made between BeginMax2d and Renderworld


AdamRedwoods(Posted 2012) [#3]
also make sure that the camera isn't clearing, or do your own manual camera clear:

CameraClsMode camera,false,false

To do your own clearing, you'd have to make the opengl call (see camera source).
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT)


jkrankie(Posted 2012) [#4]
yep, after renderworld and before beginmax2d.

Cheers
Charlie


BLaBZ(Posted 2012) [#5]
Why do I have to disable the camera clearing or call glClear?

It seems to be working without it?


AdamRedwoods(Posted 2012) [#6]
alternative method.