From b1b5adfcbed66691aa6d1775d20c6aec6d1a4696 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 19 Nov 2018 08:09:17 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9graphic=20position=20type?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libjin/graphics/je_graphic.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/libjin/graphics/je_graphic.cpp') diff --git a/src/libjin/graphics/je_graphic.cpp b/src/libjin/graphics/je_graphic.cpp index 552eac6..6cd05a1 100644 --- a/src/libjin/graphics/je_graphic.cpp +++ b/src/libjin/graphics/je_graphic.cpp @@ -45,7 +45,15 @@ namespace JinEngine glDeleteTextures(1, &mTexture); } - void Graphic::render(int x, int y, float sx, float sy, float r, float ox, float oy) const + void Graphic::setFilter(GLint min_filter, GLint max_filter) + { + gl.bindTexture(mTexture); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, min_filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, max_filter); + gl.bindTexture(0); + } + + void Graphic::render(float x, float y, float sx, float sy, float r, float ox, float oy) const { Math::Matrix modelMatrix = gl.getModelViewMatrix(x, y, sx, sy, r, ox, oy); int w = getWidth(), h = getHeight(); @@ -73,7 +81,7 @@ namespace JinEngine gl.bindTexture(0); } - void Graphic::render(const Math::Quad& slice, int x, int y, float sx, float sy, float r, float ax, float ay) const + void Graphic::render(const Math::Quad& slice, float x, float y, float sx, float sy, float r, float ax, float ay) const { static float vertexCoords[8]; static float textureCoords[8]; -- cgit v1.1-26-g67d0