From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Luis_Souto_Gra=C3=B1a?= Newsgroups: gmane.lisp.guile.user Subject: Function set-gl-vertex-array in Guile-opengl Date: Fri, 25 Jan 2019 11:36:33 +0100 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="128638"; mail-complaints-to="usenet@blaine.gmane.org" To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jan 25 15:58:22 2019 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gn2w1-000XLy-Fu for guile-user@m.gmane.org; Fri, 25 Jan 2019 15:58:21 +0100 Original-Received: from localhost ([127.0.0.1]:45877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gn2w0-0001Lj-Bu for guile-user@m.gmane.org; Fri, 25 Jan 2019 09:58:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50628) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmxyI-0004Vn-LZ for guile-user@gnu.org; Fri, 25 Jan 2019 04:40:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmxur-0007Wh-NG for guile-user@gnu.org; Fri, 25 Jan 2019 04:36:51 -0500 Original-Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]:39012) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gmxur-0007UG-Hw for guile-user@gnu.org; Fri, 25 Jan 2019 04:36:49 -0500 Original-Received: by mail-io1-xd44.google.com with SMTP id k7so7222760iob.6 for ; Fri, 25 Jan 2019 01:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=W7KB114CmvNFZYf964LsrCGepdiW5VwdnDpz9As3URM=; b=Z7ZCW6GmfuF1SA6v9cObmSBZ7MY5w5rchtAt1XzODpv9lVuNI50DdbR0T8a5uJ/ihM nbNXnV0UgRziRkhG9NaBpV3H50+3ghcqMkKPuKEBlHxZlMByMNhFhmbOB9N+qu6x2/T2 97HRquzRFR+6AbHBYoL5ALs/0MBOcwV48zWSbtgwXVz2YrzqLnMYu6r+dy5x2E2ccsRv k/BDh9nJehhHP5QI9PGvBfuBasq0sVfL/+yTAkLlpaNPxbmxqhiy2QPiDffq0I6n7ZUv 2S4ayP7CwHpxF+JDiFPWin7Gd0wHYqelolz+4QXIEiABPUj+PVZ5E4crUQ1VbLxAj4xv L/dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=W7KB114CmvNFZYf964LsrCGepdiW5VwdnDpz9As3URM=; b=n5h3E4FmM3RiS7zcA4OzodAKTBosweN22FJM8JsidMtwYgGO181IevAJcAo2JhinN+ TbOw7Dz9y42viPIqyxYgvO0GuZDBuXdwaCdkkaaK8nG3loafHWPBAxfEnlx7JEsc+5os hLt/ihWGxr6/eXbkNPX4x1ciXLNtTjHPaaarhaQ989ZWr4ICnMbqn+ChcmpbHHwv0Kqt FNITFcgb0uTJu9JFMlkvnYekeYeDyBTd6CpxxZIhDX2Xmr/z40NYzaBRGIUw5dc2075Y O4tvhkiZGpHbv+RVK1dnyxHHvbqoiro9UY44ss9swHqP4u8ZJnTWlW7OyY5hPoz/ZPLK /dew== X-Gm-Message-State: AHQUAuY2tI4kYbgOozeuzSz0yCYjpmIazF//o9NVuKIOV94t0HX0hqVt E2DvCZJyNQUYXoOQF+uMmy4HBRLO5qot7MQwUzQAkK1W X-Google-Smtp-Source: AHgI3IZIyICFidFdNue/GBVkUnKOxm5oB5qM7kKk+CNhZ3rWCiEO+PouyTy2XoBXdfSxKcyC9CwVqYtJH4FXGhyKscc= X-Received: by 2002:a5e:840f:: with SMTP id h15mr5694936ioj.42.1548409003102; Fri, 25 Jan 2019 01:36:43 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d44 X-Mailman-Approved-At: Fri, 25 Jan 2019 09:57:46 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:15255 Archived-At: Hello, I'm trying to use the function set-gl-vertex-array in Guile-opengl . It needs a bytevector as an argument. I wrote this doing a copy-paste from here: https://github.com/marcomaggi/vicare/blob/master/attic/lab/gears.scm (use-modules (rnrs bytevectors)) (use-modules (system foreign)) (define (f32vector . lst) (define-syntax f32set! (syntax-rules () ((_ bv n value) (bytevector-ieee-single-native-set! bv (* n 30) value)))) (let ((bv (make-bytevector (* (length lst) 30)))) (let loop ((i 0) (lst lst)) (cond ((null? lst) bv) (else (f32set! bv i (car lst)) (loop (+ i 1) (cdr lst))))))) (define points (f32vector 30.0 30.0 0.0 10.0 10.0 0.0 70.0 30.0 0.0 90.0 10.0 0.0 70.0 70.0 0.0 90.0 90.0 0.0 30.0 70.0 0.0 10.0 90.0 0.0 30.0 30.0 0.0 10.0 10.0 0.0)) > points #vu8(0 0 240 65 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 240 ..... > (bytevector-length points) 900 > (bytevector->pointer points) # So, it works well. Now, if I write: (use-modules (gl) (glut)) > ,apropos set-gl-vertex-array (gl): set-gl-vertex-array # > (set-gl-vertex-array (bytevector->pointer points) 3) ERROR: In procedure scm-error: unhandled array-pointer type 3 Can someone tell me what the solution is?