shader compilation
authorhgn <hgodden00@gmail.com>
Sun, 18 Jul 2021 14:01:17 +0000 (15:01 +0100)
committerhgn <hgodden00@gmail.com>
Sun, 18 Jul 2021 14:01:17 +0000 (15:01 +0100)
Former-commit-id: 79c56f6fa4b07352dd7cce8627246f04508955a7

fishladder.c
stb/stb_ds.h.REMOVED.git-id [new file with mode: 0644]
vg/vg.h.REMOVED.git-id
vg/vg_shader.h.REMOVED.git-id [new file with mode: 0644]

index a9ce03a8dbc245a27f1f7ee670b298d1e2bcf06e..e93d666a7f7a38d2d8b03b67d1a7536fde63ed4a 100644 (file)
@@ -3,6 +3,30 @@
 //#define VG_STEAM
 #include "vg/vg.h"
 
+SHADER_DEFINE( colour_shader, 
+
+       // VERTEX
+       "layout (location=0) in vec3 a_co;"
+       "uniform mat4 uPvm;"
+       ""
+       "void main()"
+       "{"
+       "       vec4 vert_pos = uPvm * vec4( a_co, 1.0 );"
+       "       gl_Position = vert_pos;"
+       "}",
+       
+       // FRAGMENT
+       "out vec4 FragColor;"
+       "uniform vec4 uColour;"
+       ""
+       "void main()"
+       "{"
+       "       FragColor = uColour;"
+       "}"
+       ,
+       UNIFORMS({ "uPvm", "uColour" })
+)
+
 int main( int argc, char *argv[] )
 {
        vg_init( argc, argv, "FishLadder" );
@@ -10,7 +34,7 @@ int main( int argc, char *argv[] )
 
 void vg_start(void)
 {
-
+       SHADER_INIT( colour_shader );
 }
 
 void vg_update(void)
@@ -23,6 +47,11 @@ void vg_render(void)
        
 }
 
+void vg_ui(void)
+{
+       
+}
+
 void vg_free(void)
 {
        
diff --git a/stb/stb_ds.h.REMOVED.git-id b/stb/stb_ds.h.REMOVED.git-id
new file mode 100644 (file)
index 0000000..1be60de
--- /dev/null
@@ -0,0 +1 @@
+926eae9b0ee248f7f60f9f7a3dbb5d8e95c00b65
\ No newline at end of file
index 50eddba2f34e073d80d97ce93c746d4e0366cc67..1e8f4351411d829fccc506f91e028a07f9d661e3 100644 (file)
@@ -1 +1 @@
-5220ae750eba1ee17a6711a195b295db86d3e041
\ No newline at end of file
+28aa229d3515b735bbb51e4f7e24d64bc190e13f
\ No newline at end of file
diff --git a/vg/vg_shader.h.REMOVED.git-id b/vg/vg_shader.h.REMOVED.git-id
new file mode 100644 (file)
index 0000000..b7fe581
--- /dev/null
@@ -0,0 +1 @@
+19c1fc2644023a3108f0e68233023fe92c859f3b
\ No newline at end of file