* Native Mac OS X example with Gnoga
@ 2014-10-03 18:17 David Botton
0 siblings, 0 replies; only message in thread
From: David Botton @ 2014-10-03 18:17 UTC (permalink / raw)
It's quick and dirty, but I wanted to prove a point, Gnoga can be used for native development.
Using Gnoga and MacGap I created a native Mac OS X app of the Snake example from http://www.gnoga.com
It is downloadable from there if any one wants, when I have more time I'll bind the MacGap API so can do menus, notifications, and all sorts of native Mac stuff. Write some tools to automate things, etc. I also will plan on a special way to build in the future that instead of WebSockets communicates directly to WebKit for native apps.
The process I used was simple:
git clone https://github.com/MacGapProject/MacGap2.git
cd MacGap2/public
I modified the existing index.html with:
<script>
var p = MacGap.resourcePath + "/public/bin/snake";
MacGap.launch (p);
window.open("http://127.0.0.1:8080","_self")
</script>
I then created in public the /bin dir and /html dir, copied snake in to bin and boot.html in to /html/
I then openned MG.xcodeproj
Compiled and done :)
I did modify the snake example so it shutdown the webserver and then closed the OS X as well on game over:
if Game_Over then
delay 2.0;
Gnoga.Server.Connection.Execute_Script
(ID => Main_Window.Connection_ID,
Script => "MacGap.terminate();");
Gnoga.Application.Multi_Connect.End_Application;
exit;
end if;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-03 18:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-03 18:17 Native Mac OS X example with Gnoga David Botton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox