I recently discovered Haxe and I want to prototype something in it to see its capabilities. I like to do things myself and I am already used to working with OpenGL.
I want to create my own port for the OpenGL specification but I don’t have the desire to write every existing GL function or typedef by hand. Luckily OpenGL provides a spec XML file that I found out how to parse through a macro. I also found out how to create functions in an empty type by using @:build(…call to my macro…) . Where I am stuck at is adding the typedef’s for the OpenGL language. I wanto to be able to generate with a macro a typedef similar to this:
typedef GLenum = Int;
… but with a macro. I tried build macros and initialization macros but there is not enough documentation or articles on the subject of how to create custom types or classes.