src/2d.c

changeset 223
4f32c7755138
parent 222
2cb9a71df7a6
child 226
18327d2df79d
--- a/src/2d.c	Thu Jul 24 20:58:00 2025 +0200
+++ b/src/2d.c	Fri Jul 25 18:50:36 2025 +0200
@@ -61,16 +61,17 @@
 }
 
 static AscShaderProgram *asc_rectangle_shader_create(int flags) {
-    const char * const defines[] = {
-        "#define FILL\n",
-        "#define ROUNDED_CORNERS\n",
-        "#define BORDER\n"
-    };
-    return asc_shader_create((AscShaderCodeInfo){
-        .files.vtx = "sprite_vtx.glsl",
-        .files.frag = "rectangle_frag.glsl",
-        .defines.frag_list = defines,
-        .defines.frag_list_select = flags
+    return asc_shader_create((AscShaderCodes){
+        .vtx = {.source_file = "sprite_vtx.glsl"},
+        .frag = {
+            .source_file = "rectangle_frag.glsl",
+            .preamble_code = (const char *[]) {
+                "#define FILL",
+                "#define ROUNDED_CORNERS",
+                "#define BORDER"
+            },
+            .preamble_code_flags = flags,
+        },
     }, sizeof(AscRectangleShader), asc_rectangle_shader_init, flags);
 }
 
@@ -215,15 +216,16 @@
 }
 
 static AscShaderProgram *asc_ellipsis_shader_create(int flags) {
-    const char * const defines[] = {
-        "#define FILL\n",
-        "#define BORDER\n"
-    };
-    return asc_shader_create((AscShaderCodeInfo){
-        .files.vtx = "sprite_vtx.glsl",
-        .files.frag = "ellipsis_frag.glsl",
-        .defines.frag_list = defines,
-        .defines.frag_list_select = flags
+    return asc_shader_create((AscShaderCodes){
+        .vtx = {.source_file = "sprite_vtx.glsl"},
+        .frag = {
+            .source_file = "ellipsis_frag.glsl",
+            .preamble_code = (const char *[]) {
+                "#define FILL",
+                "#define BORDER"
+            },
+            .preamble_code_flags = flags,
+        },
     }, sizeof(AscEllipsisShader), asc_ellipsis_shader_init, flags);
 }
 

mercurial