From 6f14e5905d04da492f160cac6ac5a6fc7fd00134 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 15 Mar 2013 15:45:20 +0100 Subject: 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 --- src/text_gltex.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/text_gltex.c') 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(>->shader, gl_static_gltex_vert, -1, - gl_static_gltex_frag, -1, attr, 4, log_llog, NULL); + ret = gl_shader_new(>->shader, vert, vlen, frag, flen, attr, 4, + log_llog, NULL); if (ret) goto err_bold_htable; -- cgit v1.2.3