From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user Subject: Re: guile-user Digest, Vol 216, Issue 15 Date: Tue, 24 Nov 2020 00:19:05 -0800 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4547"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user To: Tim Meehan Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue Nov 24 09:19:38 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1khTY0-000143-LX for guile-user@m.gmane-mx.org; Tue, 24 Nov 2020 09:19:36 +0100 Original-Received: from localhost ([::1]:33156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khTXz-0005rp-M6 for guile-user@m.gmane-mx.org; Tue, 24 Nov 2020 03:19:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55506) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khTXn-0005r7-8j for guile-user@gnu.org; Tue, 24 Nov 2020 03:19:23 -0500 Original-Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]:46574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khTXj-0007Gm-Hh for guile-user@gnu.org; Tue, 24 Nov 2020 03:19:22 -0500 Original-Received: by mail-pg1-x530.google.com with SMTP id w4so16756501pgg.13 for ; Tue, 24 Nov 2020 00:19:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NKNmkRY0iof76DOjar2globHa3wDPAwnoblhQCQUJ8A=; b=TDa6gFfv/StovIYwqvX5eDqLHTlNubVVuEmkjYJxN/jC88b9KofUCJbPU7cReRRwlQ KLsjzy2MMlyRIr+l6z8RYD0VVQE7uz0YaJdSzYRnPW5z1LL9bqzdTNFFQGDEFjzBG5OD EU41fUfsnYqmHltx+azXqIG7BmFHgk3jo0pUXfiDxiropSZHveS8B+CEAQmZqL7eO8pi X/ed1Uw7NTUpuMPlLGilLEOu8eDiiyGUx3R8XYpSzDCK28FaXNQoT4CXxVF/IUpVbt3U lL2N5qTZjsXdFTWMQNP3K87MyewutlM/cGbOg84EpdgOsttfHUpv2P3e/ee0JTok4iAf gFVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NKNmkRY0iof76DOjar2globHa3wDPAwnoblhQCQUJ8A=; b=gwU2AxhHuGsPLx92l4j5+A4ePszXtA2kmcjGWUanFqjEOxdEBe5zGzK+X4cR6wmwwC rpSbDgsu2gnpcMDpCMnNCu1kCZSKHEUGMsPxSSb9m1nHN2eRLBe6nkBq/TlqrrAnSs4Y 43yeaw6yi0AzZ1Ck+xUnHHdpOOyNnfkfPu48+Ju3+iVGEZHA12MnrQHfW3Gdd0GEyqcQ 3S9T6xpxAbfqh+3Z3cwFnXv9PA4jzGcyXe45jZCK7sYKqWHIp+RYnuN5D04bn3c3Zjwc 7x1doCkUYhp4NySiirR3Y7CFWZsXsaOWLhYr2CdcMtINJsDi05rg+j04UOQ0G5tcEMbN PgLw== X-Gm-Message-State: AOAM530sbnkYauvo+EkEVqlsvAp27df1+qzvYj4T+gRLPK6QqlWekCLT qYqvIWSmZegdXJs0a281zsVhfSr5xL7zxOs1vQo= X-Google-Smtp-Source: ABdhPJxz7nj+t05URV9hsVywFTKzPODtqEXDp8Mj8uy9uPwnJgfpstQIscd10bPcnrGAk+X22ZcM0M4TzVRHq4zpzsY= X-Received: by 2002:a63:6ecb:: with SMTP id j194mr2844781pgc.420.1606205957549; Tue, 24 Nov 2020 00:19:17 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=aconchillo@gmail.com; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17053 Archived-At: Hi Tim, yes, you should definitely checkout Chickadee. There are some cool demos in the examples directory. Best, Aleix On Mon, Nov 23, 2020, 5:55 PM Tim Meehan wrote: > Ok - I'm very new to Guile, and had run across "Sly" (game framework) by > dthomson? (My assumption, based on checking out a couple of links: > https://github.com/guildhall/guile-sly, > http://www.draketo.de/proj/py2guile/ > at bottom of page) ... > > I'm interested in learning how to do games (Guile is a hobby, games are > fun). > Based on the recent announcement of Chickadee 0.6.0, I'm assuming I should > check that out instead of Sly? > > On Fri, Nov 20, 2020 at 11:02 AM wrote: > > > Send guile-user mailing list submissions to > > guile-user@gnu.org > > > > To subscribe or unsubscribe via the World Wide Web, visit > > https://lists.gnu.org/mailman/listinfo/guile-user > > or, via email, send a message with subject or body 'help' to > > guile-user-request@gnu.org > > > > You can reach the person managing the list at > > guile-user-owner@gnu.org > > > > When replying, please edit your Subject line so it is more specific > > than "Re: Contents of guile-user digest..." > > > > > > Today's Topics: > > > > 1. Chickadee 0.6.0 released (Thompson, David) > > 2. getting to know the FFI ... (Tim Meehan) > > > > > > ---------------------------------------------------------------------- > > > > Message: 1 > > Date: Thu, 19 Nov 2020 21:11:09 -0500 > > From: "Thompson, David" > > To: Guile User > > Subject: Chickadee 0.6.0 released > > Message-ID: > > > TrzaBkhhZ2ov+EfEmqOPZdBfjFn68tYucA@mail.gmail.com> > > Content-Type: text/plain; charset="UTF-8" > > > > Hey everyone, > > > > I just released Chickadee 0.6.0. Chickadee is a game programming > > library for Guile. It handles window management, > > keyboard/mouse/controller input, hardware-accelerated rendering, > > audio, scripting, and more. > > > > Most notably it now supports OpenGL 2 (rejoice, old thinkpad users!), > > can render TrueType/OpenType fonts, and has preliminary support for 2D > > vector graphics. > > > > See the link below for full release details and download links: > > https://dthompson.us/chickadee-060-released.html > > > > - Dave > > > > > > > > ------------------------------ > > > > Message: 2 > > Date: Thu, 19 Nov 2020 21:02:51 -0600 > > From: Tim Meehan > > To: guile-user@gnu.org > > Subject: getting to know the FFI ... > > Message-ID: > > > BsE2PJgQ@mail.gmail.com> > > Content-Type: text/plain; charset="UTF-8" > > > > I figured that I would try and do something simple-ish to see how well I > > understood the FFI. I found this GTK tutorial, written in Chez Scheme: > > https://github.com/jhidding/lyonesse/blob/master/gtk-tutorial/window.scm > > I just tried to replace the Chez FFI calls with Guile FFI calls. > > > > I'm not sure how to tell GTK about a callback that is written in Guile. > > I'm not sure how to pass a string to GTK ... > > > > Cheers, > > My bug-ridden source follows: > > > > ; The original code was in Chez Scheme, link below: > > ; > https://github.com/jhidding/lyonesse/blob/master/gtk-tutorial/window.scm > > > > ; I gather that it just pops up a window? > > ; He didn't connect the "X" to the destroy action, > > ; so the window might be hard to get rid of. > > > > (use-modules (system foreign)) > > > > (define libgtk (dynamic-link "libgtk-3")) > > (define libgdk (dynamic-link "libgdk-3")) > > (define libgio (dynamic-link "libgio-2.0")) > > (define libgobject (dynamic-link "libgobject-2.0")) > > > > ;; GtkApplication* -> GtkWidget* > > (define gtk-application-window-new > > (pointer->procedure > > '* > > (dynamic-func "gtk_application_window_new" libgtk) > > (list '*))) > > > > > > ;; GtkWindow*, gchar* -> void > > (define gtk-window-set-title > > (pointer->procedure > > void > > (dynamic-func "gtk_window_set_title" libgtk) > > (list '* '*))) > > > > > > (define gtk-window-set-default-size > > (pointer->procedure > > void > > (dynamic-func "gtk_window_set_default_size" libgtk) > > (list '*))) > > > > > > ;; GtkWidget* -> void > > (define gtk-widget-show-all > > (pointer->procedure > > void > > (dynamic-func "gtk_widget_show_all" libgtk) > > (list '*))) > > > > > > ;; gchar*, GApplicationFlags -> GtkApplication* > > (define gtk-application-new > > (pointer->procedure > > '* > > (dynamic-func "gtk_application_new" libgtk) > > (list '* int))) ; FIXME guess > > > > > > ;; GApplication*, int, char ** -> int > > (define g-application-run > > (pointer->procedure > > int > > (dynamic-func "g_application_run" libgio) > > (list '* int '*))) > > > > > > ;; gpointer, gchar*, GCallback, gpointer, GConnectFlags -> gulong > > (define g-signal-connect-object > > (pointer->procedure > > unsigned-long > > (dynamic-func "g_signal_connect_object" libgobject) > > (list '* '* '* '* int))) > > > > > > ;; gpointer -> void > > (define g-object-unref > > (pointer->procedure > > void > > (dynamic-func "g_object_unref" libgobject) > > (list '*))) > > > > > > (define (activate gtk-app user-data) > > (let ([window (gtk-application-window-new gtk-app)]) > > (gtk-window-set-title window "Example Window") > > (gtk-window-set-default-size window 200 200) > > (gtk-widget-show-all window))) > > > > > > ;; HELP: This obviously won't work. > > ;; How would I give GTK a Guile callback? > > (define (callback p) > > (let ([code (foreign-callable p (iptr iptr) void)]) > > (lock-object code) > > (foreign-callable-entry-point code))) > > > > > > ;; HELP: how do you pass a string from Guile to a C function? > > (define (main) > > (let ([argc (length (command-line))] > > [argv (command-line)] > > [app (gtk-application-new (scm->pointer "what needs this > > anyway?") 0)]) > > (g-signal-connect-object app "activate" (callback activate) 0 0) > > (g-application-run app 0 0) > > (g-object-unref app))) > > > > (main) > > > > > > ------------------------------ > > > > Subject: Digest Footer > > > > _______________________________________________ > > guile-user mailing list > > guile-user@gnu.org > > https://lists.gnu.org/mailman/listinfo/guile-user > > > > > > ------------------------------ > > > > End of guile-user Digest, Vol 216, Issue 15 > > ******************************************* > > >