OpenGL through Blitzmax

BlitzMax Forums/BlitzMax Programming/OpenGL through Blitzmax

Ryan Burnside(Posted 2007) [#1]
I'm interested in learning OpenGL through blitzmax but it seems that the tutorials on the Nehe site are written for Microsoft Visual C++. Has anyone written any extensive and simple tutorials for using OpenGl in Blitzmax? I searched and came across some the other day but they failed to run. I'm wanting to make a really simple 3D game with 2D gameplay. I just plan to use a minimalistic 3D style for the game no textures and such.


The r0nin(Posted 2007) [#2]
Read the redbook (www.opengl.org). Seriously. It's actually not hard to understand the way they explain it, and all you have to do is convert it over. After reading the first 2 chapters, I whipped up this (to show basic triangle and vertex array operations) in five minutes:

And

It's that easy to code basic images in OpenGL. Now, when you start creating more complicated scenes...


bradford6(Posted 2007) [#3]
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:



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)


Picklesworth(Posted 2007) [#4]
This thread has the tutorials' code all in BlitzMax:
http://www.blitzbasic.com/Community/posts.php?topic=41689

I posted near the bottom a simple program that should get them working in the versions since the big changes.


Ryan Burnside(Posted 2007) [#5]
Thanks for all the help guys!
I think this looks very promising, implimenting it in most languages is similar correct? I figure once I lean it I can play with some C++ and do more than boring DOS boxes. I'll just use it in blitzmax for now however.


ImaginaryHuman(Posted 2007) [#6]
I also recommend reading the whole redbook, it's free and its online and it will help you understand how everything fits together.