OPENGL: Allow backends to draw textures clipped

This commit is contained in:
Le Philousophe 2021-12-25 23:25:32 +01:00
parent 7b36b56925
commit b60c99ce98
7 changed files with 41 additions and 11 deletions

View file

@ -45,10 +45,10 @@ void FixedPipeline::setColor(GLfloat r, GLfloat g, GLfloat b, GLfloat a) {
GL_CALL(glColor4f(r, g, b, a));
}
void FixedPipeline::drawTexture(const GLTexture &texture, const GLfloat *coordinates) {
void FixedPipeline::drawTexture(const GLTexture &texture, const GLfloat *coordinates, const GLfloat *texcoords) {
texture.bind();
GL_CALL(glTexCoordPointer(2, GL_FLOAT, 0, texture.getTexCoords()));
GL_CALL(glTexCoordPointer(2, GL_FLOAT, 0, texcoords));
GL_CALL(glVertexPointer(2, GL_FLOAT, 0, coordinates));
GL_CALL(glDrawArrays(GL_TRIANGLE_STRIP, 0, 4));
}