Home
Products
Community
Manuals
Contact
Login or Signup

minib3d just procedural?

BlitzMax Modules Forums/MiniB3D/minib3d just procedural?

Pete Carter(Posted 1+ years ago) #1
I've only covered b3d code to blitzmax and minib3d in the past so never tryed anything oo in it. I can seam to make it work the oo way is it not possible?


ima747(Posted 1+ years ago) #2
It supports oo, I write all my b3d code in oo manner so it's easier to port to iMiniB3D


Yasha(Posted 1+ years ago) #3
The interface functions just call the methods which actually do something, so yes it is generally possible and I suppose it might even be a bit faster (if BlitzMax still doesn't do inlining?). It should not make any other difference to your code if you use it as intended though (obviously you can also get inventive and just call internals as you like, which might).

There isn't really any OO going on in miniB3D anyway though; with the obvious exception of Copy and Free, I don't think there's really any polymorphism in serious use. It's a very procedural design.


Pete Carter(Posted 1+ years ago) #4
I just can't seem to use things like createsphere in the blitzmax way only in the b3d sphere = createsphere() kind of way. Ill post some code if its not clear what im on about. Its when im usinga create function in a type. It just errors.


Yasha(Posted 1+ years ago) #5
What's the "BlitzMax way"?

CreateSphere is just like the other functions: a wrapper for the (in this case, static) method. How are you importing miniB3D? Perhaps the problem is that the real method isn't visible?


AdamRedwoods(Posted 1+ years ago) #6
minib3d object-oriented coding:
object+"."+command

example:
local mysphere:TMesh = TMesh.CreateSphere()
''since CreateSphere is a function (versus a method), you would call the main Type.

''b3d way
PositionEntity(mysphere,1,0,5)

''bmax way
mysphere.PositionEntity(1,0,5)



Pete Carter(Posted 1+ years ago) #7
Ahh! what an idiot thanks for the example. i was going about it all wrong.


ProfJake(Posted 1+ years ago) #8
There is a file called "functions.bmx" or so. There you can see which
methods and Type functions are called by each B3D-like function.