X-Git-Url: http://uxul.de/gitweb/?p=uxul-world.git;a=blobdiff_plain;f=opengl.lisp;fp=opengl.lisp;h=e35026db7e042b62f80b54bb5d1c01b2c8f5ac4e;hp=61c8e909355298220c6b43856bdc53441a480968;hb=8f6d2e9fa2cee1be6687044f2f4813630305682b;hpb=fe47814b2cd1ec57db67e494ff48faae46ffe21c diff --git a/opengl.lisp b/opengl.lisp index 61c8e90..e35026d 100644 --- a/opengl.lisp +++ b/opengl.lisp @@ -31,10 +31,12 @@ (destructuring-bind (x1 y1 x2 y2) imgs (setf x (- x +screen-width+)) (setf y (- y +screen-height+)) - (gl:bind-texture :texture-2d *spritesheet-id*) - (gl:with-primitive :quads - (gl:tex-coord x1 y1) (gl:vertex x (+ y h)) - (gl:tex-coord x2 y1) (gl:vertex (+ x w) (+ y h)) - (gl:tex-coord x2 y2) (gl:vertex (+ x w) y) - (gl:tex-coord x1 y2) (gl:vertex x y)))) - + ;(gl:bind-texture :texture-2d *spritesheet-id*) + (macrolet ((writedown (&rest vars) + `(progn + ,@(mapcar #'(lambda (var) + `(setf (cffi:mem-aref uxul-world::*ptr* :float (1- (incf uxul-world::*offset*))) (float ,var 0.0))) vars)))) + (writedown x1 y1 x (+ y h) + x2 y1 (+ x w) (+ y h) + x2 y2 (+ x w) y + x1 y2 x y)))) \ No newline at end of file