Wanna learn Bmax, but I just....

BlitzMax Forums/BlitzMax Programming/Wanna learn Bmax, but I just....

bytecode77(Posted 2007) [#1]
well, i tried to learn bmax, but the conditions were so frightening...

1. the default bmax ide is... well, lets just don't talk about it :/
2. i tried a few others but didn't really find one that is satisfying. i use Protean for bb, but that doesnt work on bmax!
3. the compiling process is very slow. compiling the miniB3d module takes me over 5 minutes! - i mean, how do you guys work on miniB3d if compiling the module takes that long???

any suggestions?


grable(Posted 2007) [#2]
If you use "Quick Build" it should only take long the first time you compile, or when you change something.

Its also a bit faster in Release mode.

Personally i find MaxIDE a breeze, though i use scite and makefiles in some projects.

EDIT: Oh yeah, and look into the Framework command (it saves time when linking)


degac(Posted 2007) [#3]
1 + 2: I use MaxIDE Community Edition, others Blide - personal tastes
3: compiling is 'slow'? Maybe the FIRST compilation could take some times, but then it runs...
'Import "minib3d.bmx"

'Framework minib3d
Import sidesign.minib3d


Graphics3D 640,480
ClearTextureFilters

Global camera=CreateCamera()
MoveEntity camera,2,1,-4
RotateEntity camera,30,30,0

light = CreateLight()
EntityColor light,255,0,0
Global  cube_max=50
Global cube:tmesh[cube_max + 1]
Global xx:Float=2

For i=0 To  cube_max
cube[i]=CreateCube()
PositionEntity cube[i],Rnd(-xx,xx),Rnd(-xx,xx),Rnd(-xx,xx)
EntityColor cube[i] , Rnd(255) , Rnd(255) , Rnd(255)
ScaleEntity cube[i],0.2,0.2,0.2
Next


s:Float = 2.5
Global sizex:Float=640/s
Global sizey:Float=480/s
Global glowtexture=CreateTexture (512,512,256)
Global sp = CreateSprite(camera)
Print sizex + " " + sizey
Print (640/sizex)
'MoveEntity sp , - .25 , - 0.06 , 1.21
MoveEntity sp , 0 , 0 , 1.21
Print "Sx : " + Float(GraphicsWidth() ) / 512
Print "Sy : " + Float(GraphicsHeight())/512

ScaleSprite sp,Float(GraphicsWidth())/512,-Float(GraphicsHeight())/sizey

TextureBlend glowtexture,5  
EntityAlpha sp, 0.84

While  Not AppTerminate()
	For i=0 To cube_max
	TurnEntity cube[i],0,0.0,0.5
	Next
	
	UpdateWorld
		
	BackBufferToTex(glowtexture)
	EntityTexture sp,glowtexture
	RenderWorld
	Flip
Wend

End

just for curiosity, how much long it takes to compile the above piece of code? On my computer (Athlon64 3500) 1-2 sec (in debug off), a little longer with debug on


bytecode77(Posted 2007) [#4]
max ide community editon? where's the change :?
i will stick to blide

i dont like these messages at startup, but i think i'm fine with it.

except, if you tell me why they pop up:)

i have to take time to check out the compiling process. if i still get problems, i will write back :)

thanks guys!
bye :)


Dreamora(Posted 2007) [#5]
Perhaps you installed the demo first and then BM 1.18 + updates and forgot to deinstall the demo first.

The documentation thing is normal on the first run, no mather which IDE


bytecode77(Posted 2007) [#6]
nope, the full version is installed and the demo is not installed.


ziggy(Posted 2008) [#7]
Devils child: If running from Vista, be sure to have disabled the UAC, and to be running BLIde (and BlitzMax) from an administrative account, otherwise you can spect all kind of strange things. Also, be sure to be using BlitzMax 1.26 or greater with BLIde (See help / BlitzMax version)


verfum(Posted 2008) [#8]
Max always seems daunting to start but honestly, it's the solid way forward, the language is actually close to programming, B3D is a language in it's own, nothing else like it, so your stuck with it, at least Bmax is kind of like c#, as in it's object oriented, which is the way forward, you dont even have to declare your variable types in bb, which is chaos! I mean whats this all about

Type A
     Field myField%
End Type

Local myObj.A = New A  ;Uh? access the A variable?
myObj/myField = 10     ;WHAT!!  divide by myField!?


It's just awefull to work with, not knocking it too much though, it's still a good program to use, but they really did make all the right improvements with Bmax.

Minib3d is slow, especially when it's running, it takes an age to load in the meshes, if you want decent 3D in Bmax look at the Irrlicht wrapper module.


verfum(Posted 2008) [#9]
This is what sold me with Bmax, if this doesn't make you wet your pants then there is something wrong, this is my old Doom2D code in b3d, mega cut down though.
Type Player          ; Player struct
	Field x#,y#
        Field image$
End Type

Global player1.Player=createPlayer(2400,1220,"player.bmp")

While Not KeyDown(1)
	Cls

        For p.Player = Each Player
	updatePlayer(p)
	Next

	Flip
Wend
End

Function createPlayer.Player(x#,y#,file$)
	p.Player = New Player
	p\x# = x#
	p\y# = y#
        p\image$ = LoadImage(file)
	Return p
End Function

Function updatePlayer(p.Player)
        DrawImage p\image$, p\x#, p\y#
End Function



Now this is the same thing but in Bmax:
Type Player
        Field x:Float, y:Float
        Field image:TImage

        Function Create:Player(x:Float, y:Float, file:String)
                 For Local ent:Player = New Player
                 ent.x = x
                 ent.y = y
                 ent.image = LoadImage(file)
                 Return ent
        End Function

        Method Update()
                 DrawImage image, x, y
        End Method

End Type

Local player1:Player = Player.Create(2400,1220,"player.bmp")

While Not KeyDown(KEY_ESCAPE)
        Cls

        player1.Update()

        Flip
Wend
End


Notice how much cleaner it is, using encapsulated functions within the player type, the code is far better to read, look in the Update function, no p\x#, just x.


nawi(Posted 2008) [#10]
"For Local ent:Player = New Player", why do you us For?


Damien Sturdy(Posted 2008) [#11]

For Local ent:Player = New Player



I smell a mistake... :-P


Dreamora(Posted 2008) [#12]
definitely ^^


verfum(Posted 2008) [#13]
HAHA whoops!

Local ent:Player = New Player

<blush>