summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kasprzyk <onestone@opencompositing.org>2008-03-04 16:27:09 +0100
committerDennis kasprzyk <onestone@opencompositing.org>2008-03-04 16:27:09 +0100
commitc13eb67a4c79557e3fa3beaf8e239b38b3979d43 (patch)
treeca34c0f2c93d6dc7dfdcf5d425d040820637e0f9
parent5dcc1680c0bf5c006be168c7571482be72196e64 (diff)
downloadbicubic-c13eb67a4c79557e3fa3beaf8e239b38b3979d43.tar.gz
bicubic-c13eb67a4c79557e3fa3beaf8e239b38b3979d43.tar.bz2
Calculate texture dimensions correctly.
-rw-r--r--bicubic.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/bicubic.c b/bicubic.c
index 64f621b..a635ae3 100644
--- a/bicubic.c
+++ b/bicubic.c
@@ -222,29 +222,19 @@ BicubicDrawWindowTexture (CompWindow *w,
glBindTexture (GL_TEXTURE_1D, bs->lTexture);
(*s->activeTexture) (GL_TEXTURE0_ARB);
- if (texture->target == GL_TEXTURE_2D)
- {
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB, param,
- 1.0f / w->width, 0.0f,
- 0.0f, 0.0f);
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
- param + 1,
- 0.0f, 1.0f / w->height,
- 0.0f, 0.0f);
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
- param + 2,
- w->width, w->height,
- 0.0f, 0.0f);
- }
- else
- {
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB, param,
- 1.0f, 0.0f, 0.0f, 0.0f);
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
- param + 1, 0.0f, 1.0f, 0.0f, 0.0f);
- (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
- param + 2, 1.0f, 1.0f, 0.0f, 0.0f);
- }
+
+ (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB, param,
+ texture->matrix.xx, 0.0f,
+ 0.0f, 0.0f);
+ (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
+ param + 1,
+ 0.0f, -texture->matrix.yy,
+ 0.0f, 0.0f);
+ (*s->programEnvParameter4f) (GL_FRAGMENT_PROGRAM_ARB,
+ param + 2,
+ 1.0 / texture->matrix.xx,
+ 1.0 / -texture->matrix.yy,
+ 0.0f, 0.0f);
}
UNWRAP (bs, s, drawWindowTexture);