Skip to content

Commit

Permalink
fix filter mode calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
inolen committed Apr 23, 2016
1 parent 7c2cdfb commit 18232d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/renderer/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum PixelFormat {
enum FilterMode {
FILTER_NEAREST,
FILTER_BILINEAR,
NUM_FILTER_MODES,
};

enum WrapMode {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/gl_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ TextureHandle GLBackend::RegisterTexture(PixelFormat format, FilterMode filter,
glGenTextures(1, &gltex);
glBindTexture(GL_TEXTURE_2D, gltex);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
filter_funcs[filter * mipmaps]);
filter_funcs[mipmaps * NUM_FILTER_MODES + filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter_funcs[filter]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wrap_modes[wrap_u]);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrap_modes[wrap_v]);
Expand Down

0 comments on commit 18232d8

Please sign in to comment.