diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libjin/graphics/je_graphic.cpp | 12 | ||||
-rw-r--r-- | src/libjin/graphics/je_graphic.h | 4 | ||||
-rw-r--r-- | src/libjin/math/je_transform.h | 2 |
3 files changed, 13 insertions, 5 deletions
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]; diff --git a/src/libjin/graphics/je_graphic.h b/src/libjin/graphics/je_graphic.h index 51c8e3d..b113891 100644 --- a/src/libjin/graphics/je_graphic.h +++ b/src/libjin/graphics/je_graphic.h @@ -61,12 +61,12 @@ namespace JinEngine /// /// Render graphic single with given coordinates. /// - void render(int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; + void render(float x, float y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; /// /// Render part of graphic single with given coordinates. /// - void render(const Math::Quad& slice, int x, int y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; + void render(const Math::Quad& slice, float x, float y, float sx = 1, float sy = 1, float r = 0, float ox = 0, float oy = 0) const; /// /// Render with transform. diff --git a/src/libjin/math/je_transform.h b/src/libjin/math/je_transform.h index cb1f0ee..95328f9 100644 --- a/src/libjin/math/je_transform.h +++ b/src/libjin/math/je_transform.h @@ -36,9 +36,9 @@ namespace JinEngine Matrix getMatrix() const; private: - Vector2<float> mScale; Vector2<float> mPosition; Vector2<float> mOrigin; + Vector2<float> mScale; float mRotation; }; |