;;; Code:
(define-module (figl gl types)
- #:use-module (system foreign)
- #:re-export (void)
- #:export (GLboolean
+ #:use-module (figl runtime)
+ #:use-module ((system foreign) #:renamer (symbol-prefix-proc 'ffi:))
+ #:export (void
+ GLboolean
GLbyte
GLubyte
GLchar
void-*))
(define %ptr
- (case (sizeof '*)
- ((4) uint32)
- ((8) uint64)
+ (case (ffi:sizeof '*)
+ ((4) ffi:uint32)
+ ((8) ffi:uint64)
(else (error "unknown pointer size"))))
-(define GLboolean uint8)
-(define GLbyte int8)
-(define GLubyte uint8)
-(define GLchar int8)
-(define Glshort int16)
-(define GLushort uint16)
-(define GLint int32)
-(define GLuint uint32)
-(define GLsizei int32)
-(define GLenum uint32)
-(define GLintptr %ptr)
-(define GLsizeiptr %ptr)
-(define GLbitfield uint32)
-(define GLfloat float)
-(define GLclampf float)
-(define GLdouble double)
-(define GLclampd double)
+(define-simple-foreign-type void ffi:void)
+(define-simple-foreign-type GLboolean ffi:uint8)
+(define-simple-foreign-type GLbyte ffi:int8)
+(define-simple-foreign-type GLubyte ffi:uint8)
+(define-simple-foreign-type GLchar ffi:int8)
+(define-simple-foreign-type Glshort ffi:int16)
+(define-simple-foreign-type GLushort ffi:uint16)
+(define-simple-foreign-type GLint ffi:int32)
+(define-simple-foreign-type GLuint ffi:uint32)
+(define-simple-foreign-type GLsizei ffi:int32)
+(define-simple-foreign-type GLenum ffi:uint32)
+(define-simple-foreign-type GLintptr %ptr)
+(define-simple-foreign-type GLsizeiptr %ptr)
+(define-simple-foreign-type GLbitfield ffi:uint32)
+(define-simple-foreign-type GLfloat ffi:float)
+(define-simple-foreign-type GLclampf ffi:float)
+(define-simple-foreign-type GLdouble ffi:double)
+(define-simple-foreign-type GLclampd ffi:double)
;; All of these have different meanings and we should be able to do a
;; basic job at teasing them out, but for now, just use the limited
;; annotation from (system foreign).
-(define GLboolean-* '*)
-(define GLchar-* '*)
-(define GLdouble-* '*)
-(define GLenum-* '*)
-(define GLfloat-* '*)
-(define GLint-* '*)
-(define GLsizei-* '*)
-(define GLubyte-* '*)
-(define GLuint-* '*)
-(define GLvoid-* '*)
-(define const-GLchar-* '*)
-(define const-GLchar-** '*)
-(define const-GLclampf-* '*)
-(define const-GLdouble-* '*)
-(define const-GLenum-* '*)
-(define const-GLfloat-* '*)
-(define const-GLint-* '*)
-(define const-GLsizei-* '*)
-(define const-GLubyte* '*)
-(define const-GLubyte-* '*)
-(define const-GLubyte-* '*)
-(define const-GLuint-* '*)
-(define const-GLvoid-* '*)
-(define const-GLvoid-** '*)
-(define void-* '*)
+(define-simple-foreign-type GLboolean-* '*)
+(define-simple-foreign-type GLchar-* '*)
+(define-simple-foreign-type GLdouble-* '*)
+(define-simple-foreign-type GLenum-* '*)
+(define-simple-foreign-type GLfloat-* '*)
+(define-simple-foreign-type GLint-* '*)
+(define-simple-foreign-type GLsizei-* '*)
+(define-simple-foreign-type GLubyte-* '*)
+(define-simple-foreign-type GLuint-* '*)
+(define-simple-foreign-type GLvoid-* '*)
+(define-simple-foreign-type const-GLchar-* '*)
+(define-simple-foreign-type const-GLchar-** '*)
+(define-simple-foreign-type const-GLclampf-* '*)
+(define-simple-foreign-type const-GLdouble-* '*)
+(define-simple-foreign-type const-GLenum-* '*)
+(define-simple-foreign-type const-GLfloat-* '*)
+(define-simple-foreign-type const-GLint-* '*)
+(define-simple-foreign-type const-GLsizei-* '*)
+(define-simple-foreign-type const-GLubyte* '*)
+(define-simple-foreign-type const-GLubyte-* '*)
+(define-simple-foreign-type const-GLubyte-* '*)
+(define-simple-foreign-type const-GLuint-* '*)
+(define-simple-foreign-type const-GLvoid-* '*)
+(define-simple-foreign-type const-GLvoid-** '*)
+(define-simple-foreign-type void-* '*)