File: gtkgl.scm

package info (click to toggle)
gauche-gtk 0.4.1-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,520 kB
  • ctags: 3,230
  • sloc: ansic: 6,655; lisp: 4,159; sh: 2,707; makefile: 344
file content (34 lines) | stat: -rw-r--r-- 1,129 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;;
;;; gtk/gtkgl.scm - GtkGLExt binding
;;;
;;;  Copyright(C) 2002,2004 by Shiro Kawai (shiro@acm.org)
;;;
;;;  Permission to use, copy, modify, distribute this software and
;;;  accompanying documentation for any purpose is hereby granted,
;;;  provided that existing copyright notices are retained in all
;;;  copies and that this notice is included verbatim in all
;;;  distributions.
;;;  This software is provided as is, without express or implied
;;;  warranty.  In no circumstances the author(s) shall be liable
;;;  for any damages arising out of the use of this software.
;;;
;;;  $Id: gtkgl.scm,v 1.2 2004/02/09 13:38:35 shirok Exp $
;;;

(define-module gtk.gtkgl
  (use gtk)
  (export-all))
(select-module gtk.gtkgl)

(dynamic-load "gauche-gtkgl" :export-symbols #t)

;; Higher-level utilities

(define (with-gtkgl-context widget proc)
  (let ((gldrawable (gtk-widget-get-gl-drawable widget))
        (glcontext  (gtk-widget-get-gl-context widget)))
    (when (gdk-gl-drawable-gl-begin gldrawable glcontext)
      (proc widget gldrawable glcontext)
      (gdk-gl-drawable-gl-end gldrawable))))

(provide "gtk/gtkgl")