C for Blitzers

BlitzMax Forums/BlitzMax Tutorials/C for Blitzers

Otus(Posted 2009) [#1]
This tutorial attempts to show the basics of working with C in your BlitzMax programs. BlitzMax manual/help has a section titled “Interfacing with C and other languages”, but I find it short and confusing.

HTML

PDF (142KB)

Sample sources (.zip 3KB)

Please let me know of any errors or if I missed something important.


rs22(Posted 2009) [#2]
I've always wondered how to do this. Very useful. Thanks!


plash(Posted 2009) [#3]
Thanks!

This will come in handy :)


ImaginaryHuman(Posted 2009) [#4]
This is pretty cool, and good to know. Might have to experiment with osx screensavers again :-)


plash(Posted 2009) [#5]
What about more complex Max objects? (Types that have Methods, Functions and many different types of Fields)

EDIT: Or, I guess more importantly, what about programmer-defined objects from C to Max?


Otus(Posted 2009) [#6]
What about more complex Max objects? (Types that have Methods, Functions and many different types of Fields)


Fields can be accessed in (their source code) order, no matter how many there are. With respect to Functions, Types are just namespaces; TType.Func could be accessed using _bb_TType_Func from C. I don't know about Methods - that could be complicated due to inheritance etc.

EDIT: Or, I guess more importantly, what about programmer-defined objects from C to Max?


If you mean objects of C++ classes, I don't use C++, but you might want to see this tutorial by skidracer: Importing C++ / STL tutorial. If you mean C structs - they are just a way of describing what a block of memory means. A pointer to a structure is still a pointer to raw memory.

Hmm... I think I'll write at least one more part on objects and look into methods.


plash(Posted 2009) [#7]
Yeah, I meant to say C/C++ classes to Max Types.

I'd never seen skidracer's tutorial, will study..


Armitage 1982(Posted 2009) [#8]
Thank you very much !

This is a well appreciated documentation :)
Finally I will be able to use some of the C specificities.

YEAH !


Ian Thompson(Posted 2009) [#9]
Jans web page seems down for me?


Tobo(Posted 2009) [#10]
Same here: both.


TeraBit(Posted 2009) [#11]
Still down :/


CyBeRGoth(Posted 2009) [#12]
I used to have a copy of the PDF file on an old pc, unfortunately I cant find it at the moment, if anyone else has it and is willing to send, seeing as Otus' site is down, I can host it if needed.


markcw(Posted 2009) [#13]
Mirrored it here http://www.blitzmax.com/logs/userlog.php?user=8652&log=1737

I don't have the html version because that was the webpage.


Otus(Posted 2009) [#14]
Sorry, the site was down due to host issues, but should be up now. It would be nice to get notifications for replies on these threads..

Also, I've been doing quite a lot of C+Blitz programming lately, so I'll probably update the tutorial soon enough...


jpavel(Posted 2009) [#15]
> so I'll probably update the tutorial soon enough...

Just as encouragement, I'd definitely find an updated tutorial very helpful!


semar(Posted 2009) [#16]
Thanks for the tutorials, well done, and quite interesting :)

Keep on the good work,
Sergio.


b32(Posted 2011) [#17]
I know it's an old thread, but still: thanks! Really helpful.