comp.lang.ada
 help / color / mirror / Atom feed
From: David Botton <david@botton.com>
Subject: Native Mac OS X example with Gnoga
Date: Fri, 3 Oct 2014 11:17:34 -0700 (PDT)
Date: 2014-10-03T11:17:34-07:00	[thread overview]
Message-ID: <59cfbd13-e920-4484-b128-e5509a190236@googlegroups.com> (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;


                 reply	other threads:[~2014-10-03 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox