OpenGL through Blitzmax

BlitzMax Forums/BlitzMax Programming/OpenGL through Blitzmax

a Few approaches:

1. use MiniB3D. It is based on OpenGL and you can make some cool stuff very quickly and it is possible to 'mix' raw OpenGL with MiniB3D

2. Look at the Python Code versions of the NeHe tutorials. Python is very easy to read and should allow you to translate it to blitz rather easily. (I am a little biased towards Python :) )

3. use my handy-dandy nehe-bmax converter:

step 1: download the NeHe tutorials that Extron created 2 years ago: http://www.blitzbasic.com/Community/posts.php?topic=41689

step 2: create a program called "NeheInclude.bmx" inside the Nehe_Tutorial folder with the following code:


Function bglCreateContext(ScreenWidth,ScreenHeight,ScreenDepth,hz,buf) 
	GLGraphics(ScreenWidth,ScreenHeight,ScreenDepth,hz,buf)
End Function
Function bglSwapBuffers()
	Flip
End Function
Function bglDrawText(thetext$,xp:Int,yp:Int)
	GLDrawText(thetext$,xp,yp)
End Function
Function FlushMem()
	' DO Nothing
End Function

Function bglSetSwapInterval(number:Int)
	' Do nothing
End Function
Function bglFixedFontBitmaps()

End Function




step 3:
replace the Framework code in the NeHe tutorial files that you want to run:
Framework blahblah...
Import blahblah...


with this:
Include "neheInclude.bmx"


this will work with most of the tuts. the ones it fails on are generally the Bitmap Fonts, Text ones.

This is a dirty hack but it should get you started. ( I simply wrapped the new GL functions with the Old function names)