2 ;;; Copyright (C) 2013 Daniel Hartwig <mandyke@gmail.com>
4 ;;; Figl is free software: you can redistribute it and/or modify it
5 ;;; under the terms of the GNU Lesser General Public License as
6 ;;; published by the Free Software Foundation, either version 3 of the
7 ;;; License, or (at your option) any later version.
9 ;;; Figl is distributed in the hope that it will be useful, but WITHOUT
10 ;;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 ;;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
12 ;;; Public License for more details.
14 ;;; You should have received a copy of the GNU Lesser General Public
15 ;;; License along with this program. If not, see
16 ;;; <http://www.gnu.org/licenses/>.
20 ;; Mappings from OpenGL to FFI types.
24 (define-module (figl gl types)
25 #:use-module (system foreign)
75 (else (error "unknown pointer size"))))
77 (define GLboolean uint8)
79 (define GLubyte uint8)
81 (define Glshort int16)
82 (define GLushort uint16)
84 (define GLuint uint32)
85 (define GLsizei int32)
86 (define GLenum uint32)
87 (define GLintptr %ptr)
88 (define GLsizeiptr %ptr)
89 (define GLbitfield uint32)
90 (define GLfloat float)
91 (define GLclampf float)
92 (define GLdouble double)
93 (define GLclampd double)
95 ;; All of these have different meanings and we should be able to do a
96 ;; basic job at teasing them out, but for now, just use the limited
97 ;; annotation from (system foreign).
98 (define GLboolean-* '*)
100 (define GLdouble-* '*)
102 (define GLfloat-* '*)
104 (define GLsizei-* '*)
105 (define GLubyte-* '*)
108 (define const-GLchar-* '*)
109 (define const-GLchar-** '*)
110 (define const-GLclampf-* '*)
111 (define const-GLdouble-* '*)
112 (define const-GLenum-* '*)
113 (define const-GLfloat-* '*)
114 (define const-GLint-* '*)
115 (define const-GLsizei-* '*)
116 (define const-GLubyte* '*)
117 (define const-GLubyte-* '*)
118 (define const-GLubyte-* '*)
119 (define const-GLuint-* '*)
120 (define const-GLvoid-* '*)
121 (define const-GLvoid-** '*)