3b/cl-opengl

Pointer issues on Win64 (SBCL)

TeMPOraL opened this issue · 1 comments

Probably expected, given the following comment from gl/types.lisp:

;;; XXX these will be broken on 64-bit systems that do not have 64-bit
;;; longs, such as Win64.  Need to define this type in CFFI and it may
;;; require some sort of grovelling or guessing.

It bit me recently when SDL2 returned a 64bit pointer for large (greater than 255x255px) surfaces.
Hotfix I applied to gl/types.lisp looks like this:

#+(and :WIN32 :X86-64) (defctype ptrdiff-t :unsigned-long-long)
#-(and :WIN32 :X86-64) (defctype ptrdiff-t :unsigned-long)
3b commented

should be fixed now