summaryrefslogtreecommitdiff
path: root/src/text_gltex.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2013-03-15 15:45:20 +0100
committerDavid Herrmann <dh.herrmann@gmail.com>2013-11-03 12:15:35 +0100
commit6f14e5905d04da492f160cac6ac5a6fc7fd00134 (patch)
tree21b19b2a23062b0a66601b50ac20c0dadd255fe2 /src/text_gltex.c
parent0a098393c2fe7e40a02b44481194534ad2572d70 (diff)
build: replace genshader by binary linker
Instead of generating C source files, we now use our binary-linker make target which can link in any arbitrary binary file. This way, we can delete genshader and instead link the files directly. This speeds up compilation and makes the code more consistent. We also strip the shaders from useless comments and whitespaces to reduce memory consumption. Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
Diffstat (limited to 'src/text_gltex.c')
-rw-r--r--src/text_gltex.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/text_gltex.c b/src/text_gltex.c
index beb0bba..20f7eb3 100644
--- a/src/text_gltex.c
+++ b/src/text_gltex.c
@@ -141,13 +141,16 @@ static void free_glyph(void *data)
free(glyph);
}
-extern const char *gl_static_gltex_vert;
-extern const char *gl_static_gltex_frag;
+extern const char _binary_src_text_gltex_atlas_vert_bin_start[];
+extern const char _binary_src_text_gltex_atlas_vert_bin_end[];
+extern const char _binary_src_text_gltex_atlas_frag_bin_start[];
+extern const char _binary_src_text_gltex_atlas_frag_bin_end[];
static int gltex_set(struct kmscon_text *txt)
{
struct gltex *gt = txt->data;
- int ret;
+ int ret, vlen, flen;
+ const char *vert, *frag;
static char *attr[] = { "position", "texture_position",
"fgcolor", "bgcolor" };
GLint s;
@@ -177,10 +180,14 @@ static int gltex_set(struct kmscon_text *txt)
goto err_bold_htable;
}
+ vert = _binary_src_text_gltex_atlas_vert_bin_start;
+ vlen = _binary_src_text_gltex_atlas_vert_bin_end - vert;
+ frag = _binary_src_text_gltex_atlas_frag_bin_start;
+ flen = _binary_src_text_gltex_atlas_frag_bin_end - frag;
gl_clear_error();
- ret = gl_shader_new(&gt->shader, gl_static_gltex_vert, -1,
- gl_static_gltex_frag, -1, attr, 4, log_llog, NULL);
+ ret = gl_shader_new(&gt->shader, vert, vlen, frag, flen, attr, 4,
+ log_llog, NULL);
if (ret)
goto err_bold_htable;