Inspired by the purebasic openGL framework Benny posted, I converted the code to bmax.
Framework brl.GLGraphics
Function doIntro()
glClear(GL_COLOR_BUFFER_BIT| GL_DEPTH_BUFFER_BIT)
glRotatef(0.5,1.0,1.0,1.0)
glBegin(GL_TRIANGLES)
glColor3f(1.0,0.0,0.0)
glVertex3f(0.0,-1.0,0.0)
glColor3f(0.0,1.0,0.0)
glVertex3f(1.0,1.0,0.0)
glColor3f(0.0,0.0,1.0)
glVertex3f(-1.0,1.0,0.0)
glEnd()
End Function
GLGraphics( 640, 480, 0, 60, GRAPHICS_BACKBUFFER|GRAPHICS_DEPTHBUFFER )
While Not KeyHit(KEY_ESCAPE)
doIntro()
Flip
Wend
End
It will compile uncompressed to about 95.5kb, and 36.5kb using upx. I believe that its possible to get this a lot smaller. Most of the reason for the size right now is that the official bmax openGL module, which I what this uses, is filled with a lot of functions for context, pixmap and other. Most of which isn't really needed for doing basic raw openGL, so I will try and extract what is needed to just open up a window with an openGL context and using the basic openGL commands. I would like to get it down to about half the size or less. That way it could be used to make 64k stuff with. I doubt that it would be possible to cram it down under the 4k limit, but we'll see when I get further with this.
[edit] I have attached an exe for those without bmax.