Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Renderer::renderImagePart(float x, float y, float width, float height, float pX, float pY, float pX2, float pY2) {
- this->vertexCoords2[2] = (pX / 32);
- this->vertexCoords2[3] = (pY / 32);
- this->vertexCoords2[6] = (pX / 32);
- this->vertexCoords2[7] = (pY2 / 32);
- this->vertexCoords2[10] = (pX2 / 32);
- this->vertexCoords2[11] = (pY2 / 32);
- this->vertexCoords2[14] = (pX / 32);
- this->vertexCoords2[15] = (pY / 32);
- this->vertexCoords2[18] = (pX2 / 32);
- this->vertexCoords2[19] = (pY2 / 32);
- this->vertexCoords2[22] = (pX2 / 32);
- this->vertexCoords2[23] = (pY / 32);
- glBufferData(GL_ARRAY_BUFFER, sizeof(this->vertexCoords2), this->vertexCoords2, GL_DYNAMIC_DRAW);
- this->model = glm::mat4(1.0f);
- this->model = glm::translate(this->model, glm::vec3(x, y, 0.0f));
- this->model = glm::scale(this->model, glm::vec3(width, height, 0.0f));
- glUniformMatrix4fv(glGetUniformLocation(this->shader, "model"), 1, GL_FALSE, &this->model[0][0]);
- glDrawArrays(GL_TRIANGLES, 0, 6);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement