BlitzMax language binding

Hi folks :slight_smile:

I’m in the process of writing a BlitzMax language binding for openFrameworks.
Well, I only started it on Friday, but most of the fundamentals are up and running on both Windows and Mac, and I’ve added a couple of examples.

As you can see, the binding mirrors the API very closely, which makes it very easy to port the C++ examples over. (apart from operator overloads… where we have to use a little poetic-license)

  
  
	Method update()  
  
		Local newFrame:Int = False  
  
		vidGrabber.grabFrame()  
		newFrame = vidGrabber.isFrameNew()  
		  
		If newFrame Then  
	  
			colorImg.setFromPixels(vidGrabber.getPixels(), 320,240)  
		  
			grayImage.copy(colorImg)  
			If learnBackground = True Then  
				grayBg.copy(grayImage)  
				learnBackground = False  
			End If  
			  
			' take the abs value of the difference between background   
			' and incoming and then threshold:  
			grayDiff.absDiff(grayBg, grayImage)  
			grayDiff.threshold(threshold)  
			  
			' find contours which are between the size of 20 pixels and  
			' 1/3 the w*h pixels.  
			' also, find holes is set to true so we will get interior  
			' contours as well....  
			contourFinder.findContours(grayDiff, 20, (340*240)/3, 10, True)  
		End If  
  
  
		If KeyHit(key_escape) Then  
			End  
		End If  
	End Method  
  

It doesn’t use GLUT, because it has it’s own GL Context handling framework, and we can mix both BlitzMax native graphics functions with openFrameworks, which is kinda cool.
I’m also looking at wxWidgets GLCanvas integration (once I get a better understanding of the event system in openFrameworks), which could be useful.

With my suite of BlitzMax modules, I can see some interesting experiments - like with Box2D or Chipmunk.

Project-homepage

May I congratulate everyone on such an excellent framework. It has been so easy to bind.

Thanks!!

Brucey