Hey Brucey!

BlitzMax Forums/Brucey's Modules/Hey Brucey!

BLaBZ(Posted 2013) [#1]
Brucey!

Your modules and skills are incredible!

This would make for an awesome module!

https://code.google.com/p/angleproject/

What are your thoughts on creating a wrapper for this?

What would the difficulty be?

If it's not something you're interesting in developing would you be willing guide me through the wrapping process to have blitzMAX make extern c calls?

I don't have a lot of c++ experience but I'm always willing to learn :)

Thanks!


Kryzon(Posted 2013) [#2]
It's good that you put up this thread; I've been meaning to ask him how would one go about wrapping the Panda3D engine:
http://www.panda3d.org/manual/index.php/Interrogate

It has an "interrogate" tool to generate C calls, but it's ancient and most likely code-rotten.
The engine comes with lots of LIB files which I wouldn't know how to wrap.

EDIT: In hindsight, maybe I should've put my own thread instead of borrowing yours.


BLaBZ(Posted 2013) [#3]
haha, Panda seems pretty old. Not sure what this has to do with angle but I am equally fascinated with porting\wrapping code.

:)


BLaBZ(Posted 2013) [#4]
This shows how to instantiate external objects and make extern function calls.

http://en.wikibooks.org/wiki/BlitzMax/Language/Interfacing_with_C

Though I feel like wrapping something like ANGLE is easier said than done.


Brucey(Posted 2013) [#5]
Hallo!

I'm not sure how you would do this one, actually. The sample provided as part of the project only mentions 3 functions, and the rest of the sample appears to be fairly standard OpenGL/ES stuff.
Which implies that the angle functionality is just exposed using things like eglGetProcAddress() ?

For things that return function pointers, the OpenAL module is a good example, as the entire API is exposed using function pointers at runtime.

Most of my modules define a fixed set of external function calls - These GL things appear to set function pointers depending on whether particular functionality is available.

To make a regular extern function definition in BlitzMax, you look at the definition as described in the header, and translate it :
// header
int someFunction(int arg1, float arg2);

' Max
Extern
    Function someFunction:Int(arg1:Int, arg2:Float)
End Extern

Then you can just call the function from your App like any other function.

C++ is harder, and I usually wrap the C++ as a C-style function call instead, in a C++ glue source file.

There are lots of examples in my modules.

I think Angle is probably a more-complicated project to wrap for BlitzMax.


BLaBZ(Posted 2013) [#6]
Hmm interesting!

Thanks for looking into it brucey! I might approach this at a later date when I have time to do lots of research.

:)