From fdec236609ec1130b5f4a4192d22ed72fc718f77 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 1 Jan 2001 22:23:51 -0500 Subject: [PATCH] Switch to using a projective transformation. --- wayland-system-compositor.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wayland-system-compositor.c b/wayland-system-compositor.c index fe3bf32..d868910 100644 --- a/wayland-system-compositor.c +++ b/wayland-system-compositor.c @@ -345,8 +345,8 @@ background_create(struct wlsc_output *output, const char *filename) glBindTexture(GL_TEXTURE_2D, background->texture); glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); if (gdk_pixbuf_get_has_alpha(pixbuf)) format = GL_RGBA; @@ -417,6 +417,7 @@ repaint_output(struct wlsc_output *output) struct wlsc_compositor *ec = output->ec; struct wlsc_surface *es; struct wlsc_input_device *eid; + double s = 3000; if (!eglMakeCurrent(ec->display, output->surface, output->surface, ec->context)) { fprintf(stderr, "failed to make context current\n"); @@ -426,10 +427,13 @@ repaint_output(struct wlsc_output *output) glViewport(0, 0, output->width, output->height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0, output->width, output->height, 0, 0, 1000.0); + glFrustum(-output->width / s, output->width / s, output->height / s, -output->height / s, 1, s); glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); glClearColor(0, 0, 0.2, 1); + glTranslatef(-output->width / 2, -output->height/ 2, -s / 2); + if (output->background) draw_surface(output->background); else -- 2.7.4