diff --git a/res/shader/blob.frag b/res/shader/blob.frag new file mode 100644 index 0000000..266135c --- /dev/null +++ b/res/shader/blob.frag @@ -0,0 +1,5 @@ +void main() +{ + // Setting Each Pixel To Red + gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0); +} diff --git a/res/shader/blob.vert b/res/shader/blob.vert new file mode 100644 index 0000000..6116fa3 --- /dev/null +++ b/res/shader/blob.vert @@ -0,0 +1,5 @@ +void main() +{ + // Transforming The Vertex + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} diff --git a/src/hottub/core.clj b/src/hottub/core.clj index c4c87fd..1d6aae9 100644 --- a/src/hottub/core.clj +++ b/src/hottub/core.clj @@ -39,8 +39,12 @@ man (first (gs/q :name :man))] (gs/update-entity (assoc man :x (:mousex input) :y (:mousey input))))) -(defn render-gs [gs] +(defn render-gs [gs g] (gs/with-gs gs + (let [shader (res/get-shader "res/shader/blob")] + (.bind shader) + (.fillRect g 0 0 100 100) + (.unbind shader)) (doseq [sprite (gs/q :type :sprite)] (if-let [image (res/get-image (:image sprite))] (.draw image (:x sprite) (:y sprite)))))) @@ -63,7 +67,7 @@ (scr/update-screen screen screennext))))) (defmethod slick/render-game :game [screen graphics] - (render-gs (tln/timeline-last-value (:tln screen)))) + (render-gs (tln/timeline-last-value (:tln screen)) graphics)) (defmethod slick/update-game :timeshift [screen inputtln delta] (let [input-from-tln (tln/timeline-last-value inputtln)