BlitzMax: Special Edition

BlitzMax Forums/BlitzMax Programming/BlitzMax: Special Edition

Grey Alien(Posted 2015) [#1]
Has anyone ever considered getting all the really useful module tweaks that are just no brainers (not giant things that might break other things) and making a definitive version of BlitzMax?

Of course it would need updated documentation for the new features too.

Mark is busy with Monkey X2 and so I don't see it happening on its own.

Would there be legal issues with that? I guess so as we shouldn't distribute whole modified BRL mods to other users. But maybe if someone was willing to work with Mark, Mark could make it available as a special product update. A sort of official unofficial BlitzMax special edition...

This language is epic and we all know it, but with a few extra module tweaks it's even more epic. Here are some I use on a regular basis:

- Adding NSMiniaturizableWindowMask|NSResizableWindowMask to Mac windows.
- Giving access to TD3D9GraphicsDriver._graphics via a Graphics() method.
- Preventing sleep/restore crashes in d3d9graphics
- Reducing input lag in DX9
- Fix for Steam Overlay graphical glitches.

And now today I'm considering adding cross-platform borderless window support as a module tweak based on some code archives stuff.

Of course there are many more too!


therevills(Posted 2015) [#2]
Brucey has already done some of this:

https://github.com/maxmods/brl.mod

https://github.com/maxmods/pub.mod


Grey Alien(Posted 2015) [#3]
Cool. I see the DX render lag fix in there.


Hotshot2005(Posted 2015) [#4]
Someone(the new creator) who should updated of BlitzMax Where Mark is busy with Monkey X2 then you got the best both in world :)


xlsior(Posted 2015) [#5]
Cool. I see the DX render lag fix in there.


There's also 64-bit compilation for Windows, plus compilation for ARM devices like the the raspberry pi.


therevills(Posted 2015) [#6]
There's also 64-bit compilation for Windows, plus compilation for ARM devices like the the raspberry pi.


That's in BMX-NG, which is quite different as it uses a BMX version of the Monkey translator to C to compile to 64bit and ARM etc.


Brucey(Posted 2015) [#7]
If there's anything specific you want added, feel free to link to some example source and/or raise an issue on github, at one of the urls above.

The maxmods brl/pub repositories should also have up-to-date third-party libraries such as libpng and oggvorbis.


The bmx-ng modules have other enhancements, such as 64-bit stream support (i.e very large files), but are incomplete as far as DirectX and Windows MaxGUI are concerned.


Yasha(Posted 2015) [#8]
Would there be legal issues with that? I guess so as we shouldn't distribute whole modified BRL mods to other users.


The mods are the safe part, they're zlib licensed. That means you can do pretty much anything with them and redistribute in source form at your pleasure. So if it's modules you care about, you don't need Mark's involvement at all: you have all the permissions you need to set up an official special edition module library yourself. This is what makes Brucey's mod version legal.

The only remaining part of BlitzMax that you can't do what you want with is the compiler itself.


Grey Alien(Posted 2015) [#9]
@Brucey: OK thanks for the info. I may well suggest some things then,

@Yasha: Aha, well yeah after I saw Brucey had a repository of them I figured it must be OK.


Grey Alien(Posted 2015) [#10]
@Brucey: Here's one:

So that you can access D3D9GraphicsDriver().graphics()
Very handy especially if you want to get the window handle (.hwnd) to call WinAPI stuff on it. Won't break anything, it's just a useful addition:

modify d3d9graphics.bmx
add this method to TD3D9GraphicsDriver:

	Method Graphics:TD3D9Graphics()
		Return _graphics
	End Method


In fact this and others are listed in this post:
http://www.blitzmax.com/Community/post.php?topic=99175&post=1163066

You already have the lag fix (I'm guessing it uses the same implementation as in that post), but the sleep/restore crash could be worth adding.

Also GfK's Mac tweaks won't break anything and are no-brainers (well I only use the minimise one)


LT(Posted 2015) [#11]
The only remaining part of BlitzMax that you can't do what you want with is the compiler itself.
This is the part that continues to confuse me. Isn't Brucey's NG compiler still BlitzMax?

Let's say I wanted to make a complete game engine that used a built-in NG compiler (open source, no?) instead of a scripting language. Could I do that legally?


Yasha(Posted 2015) [#12]
NG is a different piece of code that does the same thing. What you're definitely not supposed to do at the moment is use the BRL-supplied one in that way, though. That's what Mark's specific comment referred to; that was also before NG was a question anyone had asked.


LT(Posted 2015) [#13]
NG is a different piece of code that does the same thing.
I was under the impression it used some part of the original BRL-supplied one. If that's not the case, then great!

Thanks for the link, btw.


Grisu(Posted 2015) [#14]
Is this fix already in the latest maxgui?
http://www.blitzbasic.com/Community/posts.php?topic=93477


xlsior(Posted 2015) [#15]
I was under the impression it used some part of the original BRL-supplied one. If that's not the case, then great!


It's based on Monkey's C translator, which is open source.

The official blitzmax compiler converts blitz to x86 ASM and then uses FASM to compile. NG converts blitz to C and compiles that. that made it more portable, since there's C compilers for ARM and x64 as well.


Grey Alien(Posted 2015) [#16]
This borderless window code totally works on PC with DX9/GL, haven't tested DX7 but the code looks solid (about to test on Mac). Again this a no-brainer that won't break anything.

http://www.blitzbasic.com/Community/posts.php?topic=102797#1232692


Brucey(Posted 2015) [#17]
It's based on Monkey's C translator, which is open source.

Monkey's C++ translator, which was then pulled apart to add all the functionality that is in BlitzMax but not in Monkey (like more primitive types, pointers, function pointers, exceptions (try/catch), etc)

It generates pure C code based on BlitzMax's core object-oriented C class/object structure, and uses the Boehm GC for garbage collection.

Depending on the code, your compiler and optimisation settings, NG executables can be more efficient than BlitzMax's ASM generated programs.

I've been working on the DX9 modules this weekend, and so far it appears to be performing as expected :-)


LT(Posted 2015) [#18]
Hey Brucey, is iOS support in your plans?


Brucey(Posted 2015) [#19]
Hey Brucey, is iOS support in your plans?

At some point, yes :-)


Grey Alien(Posted 2015) [#20]
re: IOS. Blimey, well if that works well then I'd actually consider porting Regency Solitaire to iPad. At present I'd have to port it to Monkey first and that's too much work.


Brucey(Posted 2015) [#21]
if that works well...

Getting BlitzMax running in Android wasn't too much pain (just plenty of research and googling, and trial and error), and I'd hope, given OS X is my primary platform, that an iOS build should in theory be less effort.
Of course, if would be nice if iOS devices weren't quite so expensive. Even a new Nexus 7 can be had for less than £150, which isn't too much of an investment for developing with.


xlsior(Posted 2015) [#22]
Getting BlitzMax running in Android wasn't too much pain (just plenty of research and googling, and trial and error), and I'd hope, given OS X is my primary platform, that an iOS build should in theory be less effort.
Of course, if would be nice if iOS devices weren't quite so expensive. Even a new Nexus 7 can be had for less than £150, which isn't too much of an investment for developing with.



Just a reminder to those who are interested in iOS: Brucey has a paypal "donate" button on his website. :-?
http://brucey.net/programming/blitz/


Xerra(Posted 2015) [#23]
Put IOS exporting into Blitz and you can take my money. How much do you want? Here's my wallet.


Grey Alien(Posted 2015) [#24]
@Xerra Well it's never quite as simple as just exporting as you have to make the game appropriate for iOS in terms of interface, screen sizes/res/retina, memory management, and of course multi-touch, plus possibly other things like accelerometer and so on. Then you need to make sure you comply with all the onerous Apple conditions in order to submit it to the App Store and have it pass. It's quite a rigmarole, believe me. But yeah, it would be cool :-)

Thing is, right now I don't have time to even think about putting Regency Solitaire on iOS until after I ship my next game. But I certainly will consider it early next year if Brucey's exporter is going well, and would pay for the privilege too!

Meanwhile I've made a donation as a sign of appreciation for Brucey's work over all these years. Thanks Brucey, you are a BlitzMax hero.


Xerra(Posted 2015) [#25]
We're about to put our first IOS game up on appstore this week so I've become aware over last couple of months what's needed on IOS games compared to just exporting for Mac or PC. Our game has been written with objective C using the Cocos 2d framework but I just find that working with these may be lower level than something like Blitz, but I prefered working with what I've been used to up until now.

We're looking now at switching to Swift and, either moving to SpriteKit and selling out completely to how Apple want their games developed for easier acceptance, or maybe sticking with Cocos and Sprite builder. But Blitz could still do the biz as a language for the platform as long as the coder knows they have to code specifically for touch controls and the display sizes of IOS devices. Not for novices, I'd say, but if you have familiarity, and probably being able to use a virtual device system like SpriteBuilder does for testing.

As you would have to use XCode as part of the compilation process anyway then I'm sure a lot of the problems could be ironed out with a bit of work. I would absolutely agree that this would be something that the author should be paid for.


Grey Alien(Posted 2015) [#26]
Ah sounds like you've been through the gauntlet too and made it out alive. Good luck with the launch!


Scaremonger(Posted 2015) [#27]
Here is my two-pence worth for a new blitzmax distribution:

* Application Icon support
* MillisecsLong()
* Native strftime() to complement CurrentTime() and CurrentDate()
* Delta-Time object and Frame Counter (Linked to flip event).
* Update setColor() and SetCLSColor() to accept one parameter $RRGGBB.
* Color conversion type: