Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

use integers for return values instead of %gl:enum

some functions return values with multiple names, so we can't reliably
compare them against keywords
  • Loading branch information...
commit cfe682043458404c2224cf0e1533cfb6e9ed3462 1 parent 8b893a9
@3b authored
Showing with 13 additions and 9 deletions.
  1. +8 −8 gl/funcs.lisp
  2. +5 −1 tools/generate-funcs.lisp
View
16 gl/funcs.lisp
@@ -229,7 +229,7 @@
(params (:pointer double)))
;;; GL version: 1.0, VERSION_1_0
-(defglfun ("glGetError" get-error) enum)
+(defglfun ("glGetError" get-error) :unsigned-int)
;;; GL version: 1.0, VERSION_1_0
(defglfun ("glGetFloatv" get-float-v) :void
@@ -4950,7 +4950,7 @@
(framebuffers (:pointer uint)))
;;; GL version: 3.0, ARB_framebuffer_object
-(defglextfun ("glCheckFramebufferStatus" check-framebuffer-status) enum
+(defglextfun ("glCheckFramebufferStatus" check-framebuffer-status) :unsigned-int
(target enum))
;;; GL version: 3.0, ARB_framebuffer_object
@@ -5207,7 +5207,7 @@
(sync :pointer))
;;; GL version: 1.2, ARB_sync
-(defglextfun ("glClientWaitSync" client-wait-sync) enum
+(defglextfun ("glClientWaitSync" client-wait-sync) :unsigned-int
(sync :pointer)
(flags bitfield)
(timeout uint64))
@@ -9085,7 +9085,7 @@
(framebuffers (:pointer uint)))
;;; GL version: 1.2, EXT_framebuffer_object
-(defglextfun ("glCheckFramebufferStatusEXT" check-framebuffer-status-ext) enum
+(defglextfun ("glCheckFramebufferStatusEXT" check-framebuffer-status-ext) :unsigned-int
(target enum))
;;; GL version: 1.2, EXT_framebuffer_object
@@ -11234,7 +11234,7 @@
(params (:pointer int)))
;;; GL version: 1.0, EXT_direct_state_access
-(defglextfun ("glCheckNamedFramebufferStatusEXT" check-named-framebuffer-status-ext) enum
+(defglextfun ("glCheckNamedFramebufferStatusEXT" check-named-framebuffer-status-ext) :unsigned-int
(framebuffer uint)
(target enum))
@@ -11590,13 +11590,13 @@
(points (:pointer float)))
;;; GL version: 1.5, APPLE_object_purgeable
-(defglextfun ("glObjectPurgeableAPPLE" object-purgeable-apple) enum
+(defglextfun ("glObjectPurgeableAPPLE" object-purgeable-apple) :unsigned-int
(objectType enum)
(name uint)
(option enum))
;;; GL version: 1.5, APPLE_object_purgeable
-(defglextfun ("glObjectUnpurgeableAPPLE" object-unpurgeable-apple) enum
+(defglextfun ("glObjectUnpurgeableAPPLE" object-unpurgeable-apple) :unsigned-int
(objectType enum)
(name uint)
(option enum))
@@ -11659,7 +11659,7 @@
(params (:pointer double)))
;;; GL version: 1.2, NV_video_capture
-(defglextfun ("glVideoCaptureNV" video-capture-nv) enum
+(defglextfun ("glVideoCaptureNV" video-capture-nv) :unsigned-int
(video_capture_slot uint)
(sequence_num uint)
(capture_time uint64-ext))
View
6 tools/generate-funcs.lisp
@@ -330,9 +330,13 @@
(t arg)))
(defun remap-return (type)
+ ;; the cffi enum doesn't work well for return values due to duplicate
+ ;; names, so we just force it to unsigned int here
(let ((remapped (gethash type *type-map* nil)))
(if remapped
- (remap-base-and-pointer-types remapped)
+ (if (or (string= type "GLenum") (string= remapped "GLenum"))
+ ":unsigned-int"
+ (remap-base-and-pointer-types remapped))
(progn (format t "unable to remap return type ~a ~%" type)
type))))
Please sign in to comment.
Something went wrong with that request. Please try again.