Skip to content

Instantly share code, notes, and snippets.

@bgK
Created January 2, 2013 17:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgK/4436210 to your computer and use it in GitHub Desktop.
Save bgK/4436210 to your computer and use it in GitHub Desktop.
diff --git a/engines/myst3/gfx.cpp b/engines/myst3/gfx.cpp
index 9c5b4f7..66a1ce1 100644
--- a/engines/myst3/gfx.cpp
+++ b/engines/myst3/gfx.cpp
@@ -77,8 +77,10 @@ OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface) {
height = surface->h;
format = surface->format;
- internalHeight = upperPowerOfTwo(height);
- internalWidth = upperPowerOfTwo(width);
+// internalHeight = upperPowerOfTwo(height);
+// internalWidth = upperPowerOfTwo(width);
+ internalHeight = height;
+ internalWidth = width;
if (format.bytesPerPixel == 4) {
internalFormat = GL_RGBA;
@@ -92,8 +94,10 @@ OpenGLTexture::OpenGLTexture(const Graphics::Surface *surface) {
glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id);
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, internalWidth, internalHeight, 0, internalFormat, sourceFormat, 0);
- 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);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
update(surface);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment