diff --git a/src/SFML/Graphics/Drawable.cpp b/src/SFML/Graphics/Drawable.cpp index ecf571829..02ae9bd5a 100644 --- a/src/SFML/Graphics/Drawable.cpp +++ b/src/SFML/Graphics/Drawable.cpp @@ -388,7 +388,7 @@ void Drawable::Draw(RenderTarget& target) const } // Set color - GLCheck(glColor4f(myColor.r / 255.f, myColor.g / 255.f, myColor.b / 255.f, myColor.a / 255.f)); + GLCheck(glColor4ub(myColor.r, myColor.g, myColor.b, myColor.a)); // Let the derived class render the object geometry Render(target); diff --git a/src/SFML/Graphics/PostFX.cpp b/src/SFML/Graphics/PostFX.cpp index 41193a2f6..8317ce5e9 100644 --- a/src/SFML/Graphics/PostFX.cpp +++ b/src/SFML/Graphics/PostFX.cpp @@ -299,7 +299,7 @@ void PostFX::Render(RenderTarget& target) const it++; } - // Compute the texture coordinates (in case the texture is larger than the screen, or flipped) + // Compute the texture coordinates (it may not be (0, 0, 1, 1) if the texture is padded or flipped) IntRect frameBufferRect(0, 0, myFrameBuffer.GetWidth(), myFrameBuffer.GetHeight()); FloatRect texCoords = myFrameBuffer.GetTexCoords(frameBufferRect); diff --git a/src/SFML/Graphics/Shape.cpp b/src/SFML/Graphics/Shape.cpp index dc21f977f..866f0316a 100644 --- a/src/SFML/Graphics/Shape.cpp +++ b/src/SFML/Graphics/Shape.cpp @@ -302,13 +302,13 @@ void Shape::Render(RenderTarget&) const for (std::vector::const_iterator i = myPoints.begin(); i != myPoints.end(); ++i) { Color color = i->Col * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(i->Position.x, i->Position.y); } // Close the shape by duplicating the first point at the end Color color = myPoints[1].Col * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x, myPoints[1].Position.y); } glEnd(); @@ -322,17 +322,17 @@ void Shape::Render(RenderTarget&) const for (std::size_t i = 1; i < myPoints.size(); ++i) { Color color = myPoints[i].OutlineCol * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[i].Position.x, myPoints[i].Position.y); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[i].Position.x + myPoints[i].Normal.x * myOutline, myPoints[i].Position.y + myPoints[i].Normal.y * myOutline); } // Close the shape by duplicating the first point at the end Color color = myPoints[1].OutlineCol * GetColor(); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x, myPoints[1].Position.y); - glColor4f(color.r / 255.f, color.g / 255.f, color.b / 255.f, color.a / 255.f); + glColor4ub(color.r, color.g, color.b, color.a); glVertex2f(myPoints[1].Position.x + myPoints[1].Normal.x * myOutline, myPoints[1].Position.y + myPoints[1].Normal.y * myOutline); } glEnd();