[grits] Switch to explicit GL_CLAMP_TO_EDGE
- From: Andy Spencer <andys src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grits] Switch to explicit GL_CLAMP_TO_EDGE
- Date: Thu, 16 Feb 2012 23:19:55 +0000 (UTC)
commit 635c7663ce770cc2e1c873183b668bc341764ad4
Author: Andy Spencer <andy753421 gmail com>
Date: Thu Feb 16 22:59:40 2012 +0000
Switch to explicit GL_CLAMP_TO_EDGE
GL_CLAMP will sample the black edge color whereas GL_CLAMP_TO_EDGE does
not. However, some graphics cards/drivers treat GL_CLAMP like
GL_CLAMP_TO_EDGE. This forces the desired behavior.
src/plugins/elev.c | 4 ++--
src/plugins/map.c | 4 ++--
src/plugins/sat.c | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/elev.c b/src/plugins/elev.c
index 342bc4b..765e970 100644
--- a/src/plugins/elev.c
+++ b/src/plugins/elev.c
@@ -161,8 +161,8 @@ static guint _load_opengl(GdkPixbuf *pixbuf)
(alpha ? GL_RGBA : GL_RGB), GL_UNSIGNED_BYTE, pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
g_debug("GritsPluginElev: load_opengl %d", opengl);
return opengl;
diff --git a/src/plugins/map.c b/src/plugins/map.c
index 4f15a94..72fb320 100644
--- a/src/plugins/map.c
+++ b/src/plugins/map.c
@@ -68,8 +68,8 @@ static gboolean _load_tile_cb(gpointer _data)
(data->alpha ? GL_RGBA : GL_RGB), GL_UNSIGNED_BYTE, data->pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glFlush();
data->tile->data = tex;
diff --git a/src/plugins/sat.c b/src/plugins/sat.c
index 0d4f0cb..c96ecc4 100644
--- a/src/plugins/sat.c
+++ b/src/plugins/sat.c
@@ -57,8 +57,8 @@ static gboolean _load_tile_cb(gpointer _data)
(data->alpha ? GL_RGBA : GL_RGB), GL_UNSIGNED_BYTE, data->pixels);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glFlush();
data->tile->data = tex;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]