simple shader test
This commit is contained in:
parent
35373a45bb
commit
326bd01c7a
5
res/shader/blob.frag
Normal file
5
res/shader/blob.frag
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
// Setting Each Pixel To Red
|
||||||
|
gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
|
||||||
|
}
|
5
res/shader/blob.vert
Normal file
5
res/shader/blob.vert
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
// Transforming The Vertex
|
||||||
|
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||||
|
}
|
|
@ -39,8 +39,12 @@
|
||||||
man (first (gs/q :name :man))]
|
man (first (gs/q :name :man))]
|
||||||
(gs/update-entity (assoc man :x (:mousex input) :y (:mousey input)))))
|
(gs/update-entity (assoc man :x (:mousex input) :y (:mousey input)))))
|
||||||
|
|
||||||
(defn render-gs [gs]
|
(defn render-gs [gs g]
|
||||||
(gs/with-gs gs
|
(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)]
|
(doseq [sprite (gs/q :type :sprite)]
|
||||||
(if-let [image (res/get-image (:image sprite))]
|
(if-let [image (res/get-image (:image sprite))]
|
||||||
(.draw image (:x sprite) (:y sprite))))))
|
(.draw image (:x sprite) (:y sprite))))))
|
||||||
|
@ -63,7 +67,7 @@
|
||||||
(scr/update-screen screen screennext)))))
|
(scr/update-screen screen screennext)))))
|
||||||
|
|
||||||
(defmethod slick/render-game :game [screen graphics]
|
(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]
|
(defmethod slick/update-game :timeshift [screen inputtln delta]
|
||||||
(let [input-from-tln (tln/timeline-last-value inputtln)
|
(let [input-from-tln (tln/timeline-last-value inputtln)
|
||||||
|
|
Loading…
Reference in a new issue