Plaster

common-lisp
(defun tex-sub-image-2d (target level xoffset yoffset width height format type data) (if (pointerp data) (%gl:tex-sub-image-2d target level xoffset yoffset width height format type data) (let ((type1619 (symbolic-type->real-type type))) (let* ((array1618 data) (count1617 (length array1618))) (with-foreign-object (array type1619 count1617) (case type1619 (cl-opengl-bindings:byte (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:byte i) (aref array1618 i)))) (cl-opengl-bindings:ubyte (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:ubyte i) (aref array1618 i)))) (cl-opengl-bindings:short (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:short i) (aref array1618 i)))) (cl-opengl-bindings:ushort (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:ushort i) (aref array1618 i)))) (cl-opengl-bindings:int (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:int i) (aref array1618 i)))) (cl-opengl-bindings:uint (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:uint i) (aref array1618 i)))) (cl-opengl-bindings:float (loop for i below count1617 do (setf (mem-aref array 'cl-opengl-bindings:float i) (aref array1618 i)))) (t (loop for i below count1617 do (setf (mem-aref array type1619 i) (aref array1618 i))))) (cl-opengl-bindings:tex-sub-image-2d target level xoffset yoffset width height format type array))))))