aboutsummaryrefslogtreecommitdiff
path: root/src/libjin/graphics/je_graphic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libjin/graphics/je_graphic.cpp')
-rw-r--r--src/libjin/graphics/je_graphic.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libjin/graphics/je_graphic.cpp b/src/libjin/graphics/je_graphic.cpp
index ef56ef0..a0c2257 100644
--- a/src/libjin/graphics/je_graphic.cpp
+++ b/src/libjin/graphics/je_graphic.cpp
@@ -55,7 +55,7 @@ namespace JinEngine
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);
+ Math::Matrix modelViewMatrix = gl.getModelViewMatrix(x, y, sx, sy, r, ox, oy);
int w = getWidth(), h = getHeight();
static float vertexCoords[8];
static float textureCoords[8];
@@ -71,10 +71,10 @@ namespace JinEngine
textureCoords[6] = 1; textureCoords[7] = 0;
// Set shader.
Shader* shader = gl.getShader();
- shader->sendMatrix4(SHADER_MODELVIEW_MATRIX, &modelMatrix);
+ shader->sendMatrix4(SHADER_MODELVIEW_MATRIX, &modelViewMatrix);
shader->sendMatrix4(SHADER_PROJECTION_MATRIX, &gl.getProjectionMatrix());
- shader->setVertexPointer(2, GL_FLOAT, 0, vertexCoords);
- shader->setUVPointer(2, GL_FLOAT, 0, textureCoords);
+ shader->uploadVertices(2, GL_FLOAT, 0, vertexCoords);
+ shader->uploadUV(2, GL_FLOAT, 0, textureCoords);
gl.bindTexture(getGLTexture());
gl.drawArrays(GL_QUADS, 0, 4);
@@ -101,13 +101,13 @@ namespace JinEngine
textureCoords[4] = slx + slw; textureCoords[5] = sly + slh;
textureCoords[6] = slx + slw; textureCoords[7] = sly;
- Math::Matrix modelMatrix = gl.getModelViewMatrix(x, y, sx, sy, r, ax, ay);
+ Math::Matrix modelViewMatrix = gl.getModelViewMatrix(x, y, sx, sy, r, ax, ay);
Shader* shader = gl.getShader();
- shader->sendMatrix4(SHADER_MODELVIEW_MATRIX, &modelMatrix);
+ shader->sendMatrix4(SHADER_MODELVIEW_MATRIX, &modelViewMatrix);
shader->sendMatrix4(SHADER_PROJECTION_MATRIX, &gl.getProjectionMatrix());
- shader->setVertexPointer(2, GL_FLOAT, 0, vertexCoords);
- shader->setUVPointer(2, GL_FLOAT, 0, textureCoords);
+ shader->uploadVertices(2, GL_FLOAT, 0, vertexCoords);
+ shader->uploadUV(2, GL_FLOAT, 0, textureCoords);
gl.bindTexture(getGLTexture());
gl.drawArrays(GL_QUADS, 0, 4);