Stub module for freeglut extensions
authorClinton Ebadi <clinton@unknownlamer.org>
Wed, 27 Nov 2013 01:21:21 +0000 (20:21 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Wed, 27 Nov 2013 01:21:21 +0000 (20:21 -0500)
Exports all symbols that will need to be bound and defines
enumerations based on the freeglut headers.

figl/glut/freeglut.scm [new file with mode: 0644]

diff --git a/figl/glut/freeglut.scm b/figl/glut/freeglut.scm
new file mode 100644 (file)
index 0000000..b57bdd8
--- /dev/null
@@ -0,0 +1,105 @@
+;;; figl
+;;; Copyright (C) 2013 Daniel Hartwig <mandyke@gmail.com>
+;;; Copyright (C) 2013 Clinton Ebadi <clinton@unknownlamer.org>
+;;; 
+;;; 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:
+;;
+;; These bindings are direct mappings to the GLUT extensions provided
+;; by freeglut.
+;;
+;;; Code:
+
+(define-module (figl glut freeglut)
+  #:use-module (figl runtime)
+  #:use-module (figl glut runtime)
+  #:use-module (figl glut types)
+  #:use-module (figl gl types)
+  #:use-module ((system foreign) #:renamer (symbol-prefix-proc 'ffi:))
+  #:use-module (srfi srfi-26)          ; cut
+  #:export (glutInitErrorFunc
+           glutInitWarningFunc
+
+           glutInitContextVersion
+           glutInitContextFlags
+           glutInitContextProfile
+
+           glutMainLoopEvent
+           glutLeaveMainLoop
+
+           glutFullScreenToggle
+           glutLeaveFullScreen
+
+           glutSetMenuFont
+
+           glutPositionFunc
+           glutCloseFunc
+           glutMouseWheelFunc
+           
+           glutSetOption
+           glutGetProcAddress
+
+           glutBitmapString
+           glutBitmapLength
+           glutBitmapHeight
+
+           glutStrokeString
+           glutStrokeLength
+           glutStrokeHeight
+
+           glutWireRhombicDodecahedron
+           glutSolidRhombicDodecahedron
+
+           glutWireTeacup
+           glutSolidTeacup
+           glutWireTeaspoon
+           glutSolidTeaspoon
+
+           freeglut-option
+           freeglut-action
+           freeglut-context))
+
+;;; values taken from freeglut headers
+(define-enumeration
+  freeglut-option
+  (action-on-window-close #x01f9)
+  (init-display-mode #x01f8)
+  (init-window-x #x01f4)
+  (init-window-y #x01f5)
+  (init-window-width #x01f6)
+  (init-window-height #x01f7)
+  (rendering-context #x01fd)
+  (window-cursor #x007a)
+  (aux #x1000)
+  (multisample #x0080)
+  #;
+  (geometry-visualize-normals))
+
+(define-enumeration
+  freeglut-action
+  (exit 0)
+  (main-loop-returns 1)
+  (continue-execution 2))
+
+(define-enumeration
+  freeglut-context
+  (create-new 0)
+  (use-current 1))
+
+(define-glut-procedure (glutSetOption (what int) (value int) -> void)
+  #f)
+
+;;; todo: enumerations for InitContextFlags and InitContextProfile
\ No newline at end of file