MonkeyPro64 now up! [MONKEY NEWS]

Monkey Forums/Monkey Programming/MonkeyPro64 now up! [MONKEY NEWS]

marksibly(Posted 2012) [#1]
Hi,

[edit]64b now up - fixes a bug with loading databuffer/strings on Android[/edit]

MonkeyPro64 is now available featuring databuffers (again), streams, datastreams and tcpstreams, all wrapped in a new brl module.

To import all the new stuff, just use "Import brl".

Databuffers are pretty much the same as the opengl version (and the opengl version is still there and still used by opengl for now - will change soon) except that Size has been renamed Length ('coz that's what I kept wanting to type!). I generally like to use Size when referring to 'number of bytes' and Length when referring to 'number of elements', but in this case they're the same...

There's a new BINARY_FILES filetype filter in CONFIG.TXT you can use to decide what files should be considered raw data. Such files can be loaded directly into a databuffer via DataBuffer.Load. The filter defaults to "*.bin|*.dat".

You can 'read' a binary file using something like:

Local stream:=New DataStream( DataBuffer.Load( "GameLevel1.bin" ) )
Local mapWidth:=stream.ReadInt()
local mapHeight:=stream.ReadInt()
...etc....

TCP streams are synchronous and no doubt some timeout mechanism will need to be introduced at some point, but they seem to work well enough if you're connected up. Certainly well enough for doing an HttpGET every now and then. UDP isn't in yet though.

See the bananas/mak/httpget sample for a quick demo of tcpstreams. Note: tcp streams only work on C++/Java targets.

[edit]Oh yeah, you can now use mingw to build glfw apps, just set the app config setting GLFW_USE_MINGW to true - in fact, I probably left it in several of the samples!

Note: There's a mingw distro out there with gcc v4.7.1, but Monkey doesn't seem to like it - it's caused a few unexpected crashes here and there. Everything works fine on MSVC, gcc 4.61 and MacOS gcc/llvm, so it doesn't appear to be anything to do with Monkey. If you're using mingw, I recommend using gcc 4.6.1 - here's the one I'm using: http://tdm-gcc.tdragon.net/


Samah(Posted 2012) [#2]
Is this stuff public domain too? I need to know if I can chuck it in monkey-ext.


marksibly(Posted 2012) [#3]
Hi,

Yep - just forgot the README.


Samah(Posted 2012) [#4]
Coolies. I didn't have to do too much to merge it, so I'll push stable once I've built binaries for all three platforms.


Xaron(Posted 2012) [#5]
Awesome! Thanks Mark!


golomp(Posted 2012) [#6]
Thank you Mark !


MikeHart(Posted 2012) [#7]
THANK YOU!!!


Xaron(Posted 2012) [#8]
Regarding the TCP stuff: Do you plan to add asynchronous stuff as well? Blocking calls are a rejection reason for the app store.


Samah(Posted 2012) [#9]
monkey-ext stable merged with v64 and trans binaries built for Windows, Mac, and Linux. Clone the repo and update to the stable branch tip.

http://code.google.com/p/monkey-ext/source/checkout


DruggedBunny(Posted 2012) [#10]
Nice update, thanks Mark!

I've been on gcc 4.6.1 for some time without problems but GLFW + MinGW in Monkey v64 was failing to build until I installed the one at http://tdm-gcc.tdragon.net/ (Used the 32-bit version on Win7 64-bit.)


marksibly(Posted 2012) [#11]
Hi,

> Regarding the TCP stuff: Do you plan to add asynchronous stuff as well?

Yes, but it's complex and a while off yet - see the 'more modules' thread.

In the meantime, an async connect and some polling methods (eg: 'bytes available to read/write without blocking') could perhaps be added to TCPStream. Depending on what you're doing, this might be good enough?

> I've been on gcc 4.6.1 for some time without problems but GLFW + MinGW in Monkey v64 was failing to build

Which mingw distro was it? What errors were you getting?


DruggedBunny(Posted 2012) [#12]
Looks like it was the nuwen.net one -- there's a README_STL.txt with that URL in the main folder. Using that version on a mojo/GLFW project gives:

"G:/DevTools/Monkey/bin/trans_winnt" -target=glfw -config=Debug -run "C:/Users/James/Desktop/vfd/vfd.monkey"
TRANS monkey compiler V1.40
Parsing...
Semanting...
Translating...
Building...
'mingw32-make' is not recognized as an internal or external command,
operable program or batch file.
TRANS FAILED: TRANS Failed to execute 'mingw32-make CCOPTS="" OUT="Debug/MonkeyGame"', return code=1
Done.


Like I said, mingw32-make appears not to be there, but it's worked for STDCPP until now.

In fact, using the 'old' MinGW, the STDCPP target still builds this fine:


'Import mojo
'#GLFW_USE_MINGW="true"

Function Main ()
	Print "Hi"
End


... but uncommenting the top two lines and trying to build for GLFW, I still get that mingw32-make error. Switch to 'new' MinGW and it builds fine.

Sure enough, the TDM version contains "MinGW\bin\mingw32-make.exe" and the nuwen.net version doesn't. Perhaps I had a minimal installation of nuwen.net (can't remember what options it gave)... I know I installed 'everything' with TDM.


marksibly(Posted 2012) [#13]
Hi,

Yeah, make is just 'make' in the nuwen mingw, but 'mingw32-make.exe' in the others. The stdcpp target doesn't use make, so no problem there.

I can probably make it check for either.


slenkar(Posted 2012) [#14]
Thanks for the GLFW MINGW

When I put #GLFW_USE_MINGW="~qtrue~q" at the beggining of my source it still uses the microsoft tools to compile

#GLFW_USE_MINGW="true" works


Rushino(Posted 2012) [#15]
Thanks mark ! :) This update gonna be really useful ! I was looking for something similar.


Amon(Posted 2012) [#16]
Thanks, Mark!


semar(Posted 2012) [#17]
Nice news - thanks Mark.

By the way, are there any plans to add HTTP GET and POST for HTML5 and Flash targets too ?

Regards,
Sergio.


Neuro(Posted 2012) [#18]
HTTP GET for glfw works great :).


TeaBoy(Posted 2012) [#19]
WOW!! Monkey keeps getting better and better :o)


Skn3(Posted 2012) [#20]
Great stuff, look forward to messing around with this.


Xaron(Posted 2012) [#21]
In the meantime, an async connect and some polling methods (eg: 'bytes available to read/write without blocking') could perhaps be added to TCPStream. Depending on what you're doing, this might be good enough?


Yes Mark, that would be enough for the moment. :)


CodeGit(Posted 2012) [#22]
HTTP Get for Android works well. I am able to get back results from my server in London using a web service written in ASP.NET. Cool.......


EdzUp(Posted 2012) [#23]
So using the mingw version does that mean it does need .net anymore or is there something else that requires it?


therevills(Posted 2012) [#24]
is there something else that requires it?

XNA/Window Phone stuff ;)


EdzUp(Posted 2012) [#25]
So is xna required to compile for win32?


dopeyrulz(Posted 2012) [#26]
EdzpUp,

No - XNA is not required for win32, but the C++ Visual Studio Express version is.


Sub_Zero(Posted 2012) [#27]
Very nice (c)64 update... Much needed functionality to monkey ;)


marksibly(Posted 2012) [#28]
64b now up - fixes a bug with loading databuffer/strings on Android.


Samah(Posted 2012) [#29]
monkey-ext updated to v64b in all branches. No compilation required for stable.


golomp(Posted 2012) [#30]
Thank you for bug corrected Mark.