Skip to content

Commit d245a75

Browse files
committed
Every render function returns rendering object.
1 parent e1c6792 commit d245a75

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/hyperspace/ui.clj

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,34 +49,42 @@
4949

5050
(defn render-missile
5151
[{position :position
52-
radius :radius}]
52+
radius :radius
53+
:as missile}]
5354
(GL11/glColor3f 1.0 0.0 1.0)
54-
(draw-ellipse position radius 30))
55+
(draw-ellipse position radius 30)
56+
missile)
5557

5658
(defn render-planet
5759
[{position :position
58-
radius :radius}]
60+
radius :radius
61+
:as planet}]
5962
(GL11/glColor3f 0.0 1.0 0.0)
60-
(draw-ellipse position radius 30))
63+
(draw-ellipse position radius 30)
64+
planet)
6165

6266
(defn render-fragment
6367
[{position :position
64-
radius :radius}]
68+
radius :radius
69+
:as fragment}]
6570
(GL11/glColor3f 1.0 0.0 0.0)
66-
(draw-ellipse position radius 30))
71+
(draw-ellipse position radius 30)
72+
fragment)
6773

6874
(defn render-trace
6975
[trace]
7076
(GL11/glColor3f 1.0 1.0 0.0)
7177
(GL11/glBegin GL11/GL_LINE_STRIP)
7278
(doseq [[x, y] trace]
7379
(GL11/glVertex2f x y))
74-
(GL11/glEnd))
80+
(GL11/glEnd)
81+
trace)
7582

7683
(defn render-player
7784
[{[x, y :as position] :position
7885
radius :radius
79-
[a, d :as heading] :heading}]
86+
[a, d :as heading] :heading
87+
:as player}]
8088
(GL11/glColor3f 0.0 1.0 1.0)
8189
(draw-ellipse position radius 30)
8290

@@ -86,7 +94,8 @@
8694
(vector-sum position))]
8795
(GL11/glVertex2f x y)
8896
(GL11/glVertex2f hx hy))
89-
(GL11/glEnd))
97+
(GL11/glEnd)
98+
player)
9099

91100
(defn render-world
92101
[{planets :planets

0 commit comments

Comments
 (0)