New to BlitzMax, a few questions inside.

BlitzMax Forums/BlitzMax Beginners Area/New to BlitzMax, a few questions inside.

ReconditePhreak(Posted 2011) [#1]
I remember playing with BlitzBasic way back in the day, and I thought I'd get back into BlitzMax for fun personal projects.

I'm an experienced developer, so the language constructs themselves don't confuse me, but I do still have some questions about specifics.

1. I've come across Blide, and I've installed the free version of it. I got the impression that Blide hasn't had a release in several years. The experience has been great so far, but is it still supported in a meaningful way? I'm considering purchasing it.

2. Is there better documentation than the default built in documentation? I've found the current documentation to be very lacking.

3. Is there an API listing I can browse? something like doxygen would create, etc. One of the things I like to do when picking something up is to get a broad idea of what's there. I may not always know how something is used, but it's better if I have an idea of what API calls exist, etc.

4. And a little more specific, how do you determine the pixel length/width of a piece of text before drawing it via DrawText? For example, if you were trying to center a piece of text, you would need the dimensions first. I'm guessing you can somehow draw it into a buffer first and get the dimensions of said buffer? I have no idea how you would go about doing it.

5. What exactly is the purpose of EVENT_WINDOWCLOSE? When creating a game loop, my first attempt was to use PollEvent and test if CurrentEvent.id = EVENT_WINDOWCLOSE, but trying to close the window was still ignored (I'm running in windowed mode for my testing). Using AppTerminate() worked, so I'm guessing there's a subtlety there I'm not aware of.

That's it for now, although I'm sure I'll have more questions as time goes on :)

Edit:

thought of a few more questions

6. What is the scope of const variables? I can't seem to specify local or global scope, and I couldn't really find a solid answer.

7. Is there a way to make a field in a UDT read only?

Last edited 2011

Last edited 2011

Last edited 2011


Midimaster(Posted 2011) [#2]
to 4.
TextWidth() TextHeight()

to 5.
if you use BMax only without the MaxGui there is no need to use the EVENTS

to 6.
They can be GLOBAL if defined outside a FUNCTION orTYPE.
They can be "GLOBAL inside a Type", if defined inside a Type
They can be LOCAL, if defined inside a Function

Graphics 800,600
Const g%=5
fps=CreateTimer(1)
Repeat
	Print 
	Print "outside T=" + I + "      G=" + g + "      W=" + w
	test
	ABC.Check
	WaitTimer fps
Until KeyHit(key_escape)

Function Test()
	Const I%=12
	Print "inside T=" + I + "      G=" + g + "      W=" + w

End Function

Type ABC
	Const w%=123
	
	Function Check()
		Print "in type T=" + I + "      G=" + g + "      W=" + w

	
	End Function
End Type	



ReconditePhreak(Posted 2011) [#3]
Thanks for the response Midimaster.

Thanks for 4, I didn't realize that family of functions existed.

I did come across a small tidbit about 5. It seems the GUI stuff uses the event system, and the "graphics" system uses things like KeyHit, etc. Are those mutually exclusive? Is there ever a reason to respond to the event system when you're using the "Graphics" stuff, or do they both provide 100% coverage of the things you would prefer to respond to?

As to 6, I'm assuming by "they can be", what you mean is that, depending on where the const declaration is, determines their scope? In other words, they abide by lexical scope rather than being explicitly scoped like other variables?


H&K(Posted 2011) [#4]
1)
Blide is updated all the time, and bugs are fixed by Ziggy either directly or soon as, depending on how much work it takes
The free version IS older, I have a paid licence so I'm not sure how much older, but any bugs it has are NOT IDE bugs. (It does get updated, but less often ;- But if you can afford to buy it. But it should work anyway)

2)
Yes Here

3)
I assume MaX GUI (which is free has some)


mpmxyz(Posted 2011) [#5]
In fact both brl.polledinput (KeyHit, KeyDown etc.) and brl.eventqueue (WaitEvent, PeekEvent etc.) use the same event source. (a "hook" from brl.hook created in brl.event)
So they are equivalent if you only want to see if the user pressed a key - for everything else you should use the event queue or create an event hook.
Also constants have the same scope as global variables. (I tried it with a modification of Midimasters code.)

You want to have a list of all commands?
Then you should have a look at hotdocs.
I'm sorry I couldn't find a link to an english site but this version also supports code using the ?Threaded condition. (Just download the file and start hotdocs! ;-))
You might have to move the "index.html" file to the correct directory to replace the standard help.


xlsior(Posted 2011) [#6]
1) The paid version of blide still receives frequent updates, including both bugfixes and new features. The free version is quite a bit behind, as an incentive for people to buy the paid version.

2) There have been some wiki's in the past with additional info, but yeah -- nothing great.

4) Textwidth / Textheight. Note that it does not take your current scale into account, so it you use SetScale to change that, make sure to multiply the results of the textwidth/textheight with the same value.

5) Using MaxGUI, an application can spawn multiple windows which can be monitored.


ReconditePhreak(Posted 2011) [#7]
ok, thanks for the responses everyone, I think I've gotten what I needed :) I'm sure I'll have more questions, but for now I just need to keep my head down and work with it a bit.


ziggy(Posted 2011) [#8]
Last BLIde update is from less than a month ago, and there are plans to relase another update soon. It's being maintained and there are regular updates for the Paid version. The free version has been kept on hold as I can't have the time to maintain BLIde Plus + BLIde Free + Jungle Ide + Jungle Lite, so BLIde Free Edition, has been put on hold until further notice. BLIde Plus is still being activelly developed and supported.