fbo: cleaned up
shader: added filter (mandatory)
This commit is contained in:
parent
17002c9a43
commit
b5e2118407
2 changed files with 4 additions and 2 deletions
2
J/fbo.h
2
J/fbo.h
|
@ -23,7 +23,6 @@
|
|||
// TODO: more error checking in debug build.
|
||||
// TODO: make texture class? for easier switching between linear/nearest interpolation for example
|
||||
// NOTE: stencil attachment is not supported
|
||||
// NOTE: in end() we don't set a viewport, because it will be always set (the 'main' fbo is also an J::fbo)
|
||||
|
||||
namespace J {
|
||||
|
||||
|
@ -84,6 +83,7 @@ public:
|
|||
|
||||
void end(){
|
||||
unbind();
|
||||
// NOTE: we don't set a viewport, because it will be always set (the 'main' fbo is also an J::fbo)
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
@ -181,9 +181,11 @@ public:
|
|||
}
|
||||
|
||||
// textures (see todo above)
|
||||
void set_texture(const char* name, GLenum target, GLuint tex, int textureLocation) const {
|
||||
void set_texture(const char* name, GLenum target, GLuint tex, int textureLocation, GLenum filter = GL_LINEAR) const {
|
||||
glActiveTexture(GL_TEXTURE0 + textureLocation);
|
||||
glBindTexture(target, tex);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
|
||||
set_uniform(name, textureLocation);
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue