OSDN Git Service

layers/planes: connected with screen flyweight
[rulp/rulp.git] / graphics / render.lisp
index ffea82f..5b14ece 100644 (file)
@@ -35,7 +35,7 @@ rectangle directly, but use the arrange-rect")
 (defmethod texture ((s screen))
   "returns the screen texture, useful for accelerated enviroinments"
   (unless (slot-value s 'texture)
-    (setf (slot-value s 'texture) (sdl2:create-texture-from-surface *renderer* (surface s)))
+    (setf (slot-value s 'texture) (sdl2:create-texture-from-surface rulp.render:*renderer* (surface s)))
     (sdl2:free-surface (slot-value s 'surface))
     (setf (slot-value s 'surface) nil))
   (slot-value s 'texture))
@@ -57,9 +57,9 @@ rectangle directly, but use the arrange-rect")
 (defun make-grid (span)
   "create a square grid"
   (loop :for i :from 0 :to *window-width* :by span
-        :do (sdl2:render-draw-line *renderer* i 0 i *window-height*))
+        :do (sdl2:render-draw-line rulp.render:*renderer* i 0 i *window-height*))
   (loop :for j :from 0 :to *window-height* :by span
-        :do (sdl2:render-draw-line *renderer* 0 j *window-width* j)))
+        :do (sdl2:render-draw-line rulp.render:*renderer* 0 j *window-width* j)))
 
 (defun find-on-plane (x y plane)
   "find the entity in real-coordinates (x,y) in plane"
@@ -75,9 +75,10 @@ rectangle directly, but use the arrange-rect")
 the plane 'as is' and the entities with the grid-layout function"
   `(when *plane*
      ;; NOTE: add error for non-screen planes
-     (sdl2:render-copy ,renderer (texture *plane*)
-                       :source-rect nil
-                       :dest-rect (screen-destination *plane* t))
+     (display *plane*)
+     ;; (sdl2:render-copy ,renderer (texture *plane*)
+     ;;                   :source-rect nil
+     ;;                   :dest-rect (screen-destination *plane* t))
      (loop :for entity :in *entities-list*
            :do
               (when (displayp entity)