Correctly flip textures in DrawActiveTexture().
We want to flip the origin of UV (top to bottom), not the pixels within the specified range.
This commit is contained in:
parent
78fe138df1
commit
b4ceedfc43
1 changed files with 3 additions and 1 deletions
|
@ -511,7 +511,9 @@ void FramebufferManager::DrawPlainColor(u32 color) {
|
|||
// x, y, w, h are relative coordinates against destW/destH, which is not very intuitive.
|
||||
void FramebufferManager::DrawActiveTexture(GLuint texture, float x, float y, float w, float h, float destW, float destH, bool flip, float u0, float v0, float u1, float v1, GLSLProgram *program) {
|
||||
if (flip) {
|
||||
std::swap(v0, v1);
|
||||
// We're flipping, so 0 is downward. Reverse everything from 1.0f.
|
||||
v0 = 1.0f - v0;
|
||||
v1 = 1.0f - v1;
|
||||
}
|
||||
const float texCoords[8] = {u0,v0, u1,v0, u1,v1, u0,v1};
|
||||
static const GLushort indices[4] = {0,1,3,2};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue