Code archives/3D Graphics - Misc/A few DB commands for B3D

This code has been declared by its author to be Public Domain code.

Download source code

A few DB commands for B3D by Captain Wicker (crazy hillbilly)2012
Just Include the Source File
Include "DBA.bb"
Hope this will help others!
;DBA Commands v0.1
;By Captain Wicker
;Modify and Use as you wish

Function Sync()
UpdateWorld 
RenderWorld
Flip
End Function 

Function SetDisplayMode(width#,height#,depth#)
Graphics3D(width#,height#,depth#,3)
SetBuffer BackBuffer()
DEF_camera=CreateCamera()
DEF_light=CreateLight()
RotateEntity DEF_light,90,0,0
End Function 

Function MakeLight()
num#=CreateLight()
End Function

Function MakeSphere(Seg#)
num#=CreateSphere(Seg#)
End Function

Function MakeCamera()
num#=CreateCamera()
End Function

Function MakeCube()
num#=CreateCube()
End Function

Function MakeCone()
num#=CreateCone()
End Function

Function LoadBitmap()
num#=LoadImage(filename$)
End Function

Comments

Yasha2012
With the exception of Sync, every single one of these functions will do nothing except leak memory.

Just use a Find and Replace in future.


Matty2012
I think the intent is to allow users the joy of DB-like instability!


Guy Fawkes2012
HA!


Captain Wicker (crazy hillbilly)2012
I appreciate the discrimination and plan to recreate the entire command set from DBP for Blitz whilst adding shader support via external DLLs!


Yasha2012
...meanwhile, from those of use who don't really care one way or the other about this petty feud with DBP, have you looked at your code again to see why it won't work? I can tell you, but it would be good if you worked it out yourself.

Start with "what causes a memory leak?" (i.e. memory objects becoming unreachable, and therefore unusable/unfreeable).


Captain Wicker (crazy hillbilly)2012
unusable/unfreeable

I plan on fixing this as soon as I complete the library I will work out the bugs. :D


Yasha2012
Dude, there are... three maybe four things cripplingly wrong at least with each of the individual Make functions above! These aren't "bugs": the library is completely non-functional for multiple reasons.

If you don't understand why, either read up or please ask. You obviously haven't finished learning about functions yet.


_PJ_2012

I appreciate the discrimination and plan to recreate the entire command set from DBP for Blitz whilst adding shader support via external DLLs!


That's quite ambitious I think, considering the problems with the code you already posted so far.
Not trying to sound harsh, but Yasha does make a very valid point.

1) Understand that # is for Floating Point Variables, % is for Integers and $ is for Strings.

2) The 'Return' command is your friend (and of Function command ;) )

3) Does DB not allow parenting?

4) Maybe DEF_* need to be global values?

5) Loading null string image files will never catch on!


RemiD2013
Sometimes i hesitate to post an example in the code archives, but when i see this thing i am reassured.

So basicly you create/load meshes/textures and they are lost in memory, all by themselves ?
Ok why not.


Code Archives Forum