#!/usr/bin/env guile
!#
-(use-modules (figl glut low-level)
+(use-modules (figl glut enums)
+ (figl glut low-level)
(figl glut)
(figl gl enums)
(figl gl low-level)
(system foreign))
-(define GLUT_RGB #x0000)
-(define GLUT_RGBA #x0000)
-(define GLUT_INDEX #x0001)
-(define GLUT_SINGLE #x0000)
-(define GLUT_DOUBLE #x0002)
-(define GLUT_ACCUM #x0004)
-(define GLUT_ALPHA #x0008)
-(define GLUT_DEPTH #x0010)
-(define GLUT_STENCIL #x0020)
-(define GLUT_MULTISAMPLE #x0080)
-(define GLUT_STEREO #x0100)
-(define GLUT_LUMINANCE #x0200)
-
(define (render-scene)
- (glClear (attrib-mask color-buffer depth-buffer))
+ (glClear (clear-buffer-mask color-buffer depth-buffer))
(glBegin (begin-mode triangles))
(glVertex3f -0.5 -0.5 0.0)
(glVertex3f 0.5 0.0 0.0)
(glutSwapBuffers))
(glutInitWindowSize 320 200)
-(glutInitDisplayMode (logior GLUT_RGB GLUT_DOUBLE GLUT_DEPTH))
+(glutInitDisplayMode (display-mode rgb double depth))
(glut-init (program-arguments))
--- /dev/null
+;;; fgil
+;;; Copyright (C) 2013 Daniel Hartwig <mandyke@gmail.com>
+;;;
+;;; Figl is free software: you can redistribute it and/or modify it
+;;; under the terms of the GNU Lesser General Public License as
+;;; published by the Free Software Foundation, either version 3 of the
+;;; License, or (at your option) any later version.
+;;;
+;;; Figl is distributed in the hope that it will be useful, but WITHOUT
+;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
+;;; Public License for more details.
+;;;
+;;; You should have received a copy of the GNU Lesser General Public
+;;; License along with this program. If not, see
+;;; <http://www.gnu.org/licenses/>.
+
+;;; Commentary:
+;;
+;; figl is the Foreign Interface to GL.
+;;
+;;; Code:
+
+(define-module (figl glut enums)
+ #:use-module (figl runtime)
+ #:export (display-mode))
+
+(define-bitfield
+ display-mode
+ (rgb #x0000)
+ (rgba #x0000)
+ (index #x0001)
+ (single #x0000)
+ (double #x0002)
+ (accum #x0004)
+ (alpha #x0008)
+ (depth #x0010)
+ (stencil #x0020)
+ (multisample #x0080)
+ (stereo #x0100)
+ (luminance #x0200))