summaryrefslogtreecommitdiff
path: root/src/terminal.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-08-10 11:49:12 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-08-10 11:49:12 +0200
commit4e9ad1b915a73ac126b46ac14da8edbe6da023d0 (patch)
tree63fc40fe7a4681c8a7bd0e65e92501b9b816b68b /src/terminal.c
parent2652637fb9d0e0878cc0233e7c3a16b2b27beb97 (diff)
terminal: choose "gltex" renderer if OpenGL is available
If the uterm backend supports OpenGL, then we should use the "gltex" renderer as the "bblit" renderer performs pretty badly on OpenGL displays. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/terminal.c')
-rw-r--r--src/terminal.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/terminal.c b/src/terminal.c
index b0d41c1..6cf509c 100644
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -151,6 +151,7 @@ static int add_display(struct kmscon_terminal *term, struct uterm_display *disp)
int ret;
unsigned int cols, rows;
const struct kmscon_font_attr attr = { "", 0, 20, false, false, 0, 0 };
+ const char *be;
kmscon_dlist_for_each(iter, &term->screens) {
scr = kmscon_dlist_entry(iter, struct screen, list);
@@ -178,7 +179,13 @@ static int add_display(struct kmscon_terminal *term, struct uterm_display *disp)
goto err_screen;
}
- ret = kmscon_text_new(&scr->txt, NULL);
+ ret = uterm_screen_use(scr->screen);
+ if (!ret)
+ be = "gltex";
+ else
+ be = NULL;
+
+ ret = kmscon_text_new(&scr->txt, be);
if (ret) {
log_error("cannot create text-renderer");
goto err_font;