I'm busy learning BlitzMax (Mark, damn, it rules!) and I was wondering where all the commands like FreeImage are gone. I guess "release" does the same? If so, why is the handle to the image released, and not the actual memory it uses?
Please try the example below. (I have blitzMax on M:\ so you have to change it in C:\ or something else)
Note to Mark: a lot of commands can use some additional descriptions. In Blitz you used to 1. explain what it does (like now), 2. give a more human description of what it does "chit-chat", and 3. an example. Well, I miss (2) for some commands :-)
Please try the example below. (I have blitzMax on M:\ so you have to change it in C:\ or something else)
Strict Graphics 800,600,0 Type Oink Field x% Field y% Field image Function Create:Oink(a$) ' The constructor refers to object Oink (After the ':") and asks for a string as argument. ' A function does not know anything about where it is, unlike the method, so we must do this. Print "At start, mem: "+MemAlloced() Local o:Oink = New Oink Local x, y, image o.x = x o.y = y o.x = 100 o.y = 200 o.image = image o.image = LoadImage ("M:\Blitzmax\samples\birdie\games\platformgame\media\tiles\block1.PNG") Print "Object created, image loaded, mem: "+MemAlloced() Return o End Function Method Destroy () ' Be gone, thou evil object! Release image FlushMem Print "Object removed, mem: "+MemAlloced() End Method End Type ' --------------------------------------------------------------------------------------------- Local o:Oink = Oink.Create("HAHA!") o.Destroy() End
Note to Mark: a lot of commands can use some additional descriptions. In Blitz you used to 1. explain what it does (like now), 2. give a more human description of what it does "chit-chat", and 3. an example. Well, I miss (2) for some commands :-)