Fixed artifacts exposed (not really caused) by a0d18b527fb1. GL_CLAMP is deprecated in OpenGL ES. Image::Filter and Image::Wrap did not have reasonable default.

This commit is contained in:
rude
2010-09-14 20:41:14 +02:00
parent 712bab2b34
commit 1eca14ed9e
3 changed files with 14 additions and 4 deletions
+8
View File
@@ -24,6 +24,14 @@ namespace love
{ {
namespace graphics namespace graphics
{ {
Image::Filter::Filter() : min(FILTER_LINEAR), mag(FILTER_LINEAR)
{
}
Image::Wrap::Wrap() : s(WRAP_CLAMP), t(WRAP_CLAMP)
{
}
Image::~Image() Image::~Image()
{ {
} }
+2
View File
@@ -51,12 +51,14 @@ namespace graphics
struct Filter struct Filter
{ {
Filter();
FilterMode min; FilterMode min;
FilterMode mag; FilterMode mag;
}; };
struct Wrap struct Wrap
{ {
Wrap();
WrapMode s; WrapMode s;
WrapMode t; WrapMode t;
}; };
+4 -4
View File
@@ -198,7 +198,7 @@ namespace opengl
switch(w.s) switch(w.s)
{ {
case WRAP_CLAMP: case WRAP_CLAMP:
gs = GL_CLAMP; gs = GL_CLAMP_TO_EDGE;
break; break;
case WRAP_REPEAT: case WRAP_REPEAT:
default: default:
@@ -209,7 +209,7 @@ namespace opengl
switch(w.t) switch(w.t)
{ {
case WRAP_CLAMP: case WRAP_CLAMP:
gt = GL_CLAMP; gt = GL_CLAMP_TO_EDGE;
break; break;
case WRAP_REPEAT: case WRAP_REPEAT:
default: default:
@@ -236,7 +236,7 @@ namespace opengl
switch(gs) switch(gs)
{ {
case GL_CLAMP: case GL_CLAMP_TO_EDGE:
w.s = WRAP_CLAMP; w.s = WRAP_CLAMP;
break; break;
case GL_REPEAT: case GL_REPEAT:
@@ -247,7 +247,7 @@ namespace opengl
switch(gt) switch(gt)
{ {
case GL_CLAMP: case GL_CLAMP_TO_EDGE:
w.t = WRAP_CLAMP; w.t = WRAP_CLAMP;
break; break;
case GL_REPEAT: case GL_REPEAT: