Mojo2 for NGBlitzMax Forums/BlitzMax NG/Mojo2 for NG
| With everyone wetting their pants over Monkey's Mojo2 "engine", I thought it only fair we weren't left out of the fun too :|
It's a port of Monkey2's mojo2 implementation, which is open source.
It only works with NG, as it duplicates some of the Interfaces (as opposed to Types) that are used on Monkey.
There's a bunch of examples (rather than bananas :-p ) that are straight ports from Monkey, but in the style your used to in BlitzMax. And they all "just work".
The lighting demos are quite pretty, if you like that kind of thing.
You'll need the latest NG.
This weekend I want to test it (NG!) better & deeper!
| Do not forget to rebuild all modules if you already had NG installed - the latest BCC changed some things which enforces a module rebuild.|
| Just to note: If you get a tstringmap not found, you need to nab the updated brl.map mod from Bruceys git repo.|
| There's a new Windows release of BlitzMax NG at https://github.com/bmx-ng/bmx-ng/releases|
Includes TDM MinGW 5.1.0, SDL backend and (mky.)mojo2 modules.
| Yummmmmmyyyyyyyyyyy! :)|
| Downloding now :D|
(I need to update MY own MaxGUI version to use NG as soon as possible :P)
ps: just a note, I don't know if there's a way to 'link togheter' GITHUB download link for the latest version AND http://www.bmx-ng.com/main/downloads/ without a manual setup...
I know already the answer 'point to github'... but an indipendent website looks more 'professional' :D
just tested the latest release 66.03.07 and toying with mojo2 module.
It seems to run everything fine, except for RenderDemo
If I try to uncomment
'canvas.SetViewport( 0,0,GraphicsWidth(),GraphicsHeight()) 'canvas.SetProjectionMatrix( Mat4Ortho( 0,640,0,480,-1,1 ) )
or set Graphics 640,480,0
After 2 light's loop I get 'Incomplete Framebuffer' error.
| Via github-api you can fetch all published releases on the given github-project. Now just use the latest release as the "most current one" when linking from your project website|
I do this exactly that way for http://www.tvtower.org
As Brucey might add win32, mac ... releases, he should think of a consistent naming scheme - so the other websites could filter according to parts of the name ( find("mac") ).
this is a json response you could use to fetch your "latest releases" (filtered by OS - through naming schemes).
Edit: this is a stripped down variant of my info getter:
I looked at the official GITHUB API just yesterday, I should restart to use PHP to integrate these informations (in some ways) in my site.
With LibCurl module, MaxIDE could check if the user is running the latest version and/or download directly it (just free thinking of course :D)
I think the valid KEYs are (reading from GitHub API v3)
browser_download_url (for the download link)
updated_at (last change I suppose)
ps: I suppose there's no info in the BMX-NG package about the 'current version'... so comparing what version user is running is quite hard.
| You only get the file name ... so if that naming scheme is constant, you could use that.|
what you could do too: use "published_at" to convert that into a timestamp which you compare to something... only useful, if binaries change between releases. - or if the ide is aware of it and stores the "latest downloaded release date" somewhere ...
| What would be needed to make it work with Blitzmax instead of NG? Is not that I dont want to use NG is just that I am not sure how mature it is and would like to use the mojo2 port you have there.|
| Vanilla BlitzMax does not support "Interfaces", which is what "mky.mod" uses.|
I did not have a closer look, but as BlitzMax (vanilla) does work without interfaces, there are surely ways out there to "emulate behaviour" (extend types). So you could convert code to make it work with vanilla.
| I'm sure it's possible to back-port it. |
| Will probably do it, thanks for the info. |
| Might be enough to convert these "byteptr - int"-conversions + the interfaces with simple types.|
Ahh and in maps.c you should replace the link to tree.h with "brl.mod/map.mod/tree/tree.h" (in NG this is placed in brl.mod/blitz.mod/tree/tree.h).
| I will try to modifiy it so that it works in both vanilla and NG.|
Will post later this week with what I have done.
Thanks for the tips
| I've back-ported most of it to run under the legacy compiler.|
The only thing I don't have working is the rendererdemo, as it implements some of the interfaces.
Otherwise, the examples appear to be working.
| Your commit made it indeed running here on Linux Mint.|
?bmxng For Local char:Int=EachIn Text ?Not bmxng For Local i:Int=0 Until Text.length Local char:Int = Text[i] ? [...] Next
samples not working (or needing adjustment):
- shadereffect (colormaterial not found)
Local rgba:Int=a*255 Shl 24 | b*255 Shl 16 | g*255 Shl 8 | r*255 Local pix:Int Ptr = data.pixels
"Compile Error: Bitwise operators can only be used with integers"
"Compile Error: Unable to convert from 'Byte Ptr' to 'Int Ptr'"
Local rgba:Int=int(a*255) Shl 24 | int(b*255) Shl 16 | int(g*255) Shl 8 | int(r*255) Local pix:Int Ptr = Int Ptr(data.pixels)
- mojodemo (optional if you do not have the sdl.mod)
'Import brl.GLGraphics Import sdl.sdlgraphics
Import brl.GLGraphics 'Import sdl.sdlgraphics
| Maybe port Mike Hart's fantomX framework which uses Mojo2?|