Removed previous change that introduced a bug

This commit is contained in:
Ray 2016-03-16 19:10:19 +01:00
parent db4585b3e2
commit 95c1bf9544

View file

@ -180,17 +180,44 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo
// Draw a color-filled rectangle (Vector version) // Draw a color-filled rectangle (Vector version)
void DrawRectangleV(Vector2 position, Vector2 size, Color color) void DrawRectangleV(Vector2 position, Vector2 size, Color color)
{ {
rlBegin(RL_TRIANGLES); if (rlGetVersion() == OPENGL_11)
rlColor4ub(color.r, color.g, color.b, color.a); {
rlBegin(RL_TRIANGLES);
rlColor4ub(color.r, color.g, color.b, color.a);
rlVertex2i(position.x, position.y); rlVertex2i(position.x, position.y);
rlVertex2i(position.x, position.y + size.y); rlVertex2i(position.x, position.y + size.y);
rlVertex2i(position.x + size.x, position.y + size.y); rlVertex2i(position.x + size.x, position.y + size.y);
rlVertex2i(position.x, position.y); rlVertex2i(position.x, position.y);
rlVertex2i(position.x + size.x, position.y + size.y); rlVertex2i(position.x + size.x, position.y + size.y);
rlVertex2i(position.x + size.x, position.y); rlVertex2i(position.x + size.x, position.y);
rlEnd(); rlEnd();
}
else if ((rlGetVersion() == OPENGL_33) || (rlGetVersion() == OPENGL_ES_20))
{
// NOTE: This shape uses QUADS to avoid drawing order issues (view rlglDraw)
rlEnableTexture(whiteTexture); // Default white texture
rlBegin(RL_QUADS);
rlColor4ub(color.r, color.g, color.b, color.a);
rlNormal3f(0.0f, 0.0f, 1.0f);
rlTexCoord2f(0.0f, 0.0f);
rlVertex2f(position.x, position.y);
rlTexCoord2f(0.0f, 1.0f);
rlVertex2f(position.x, position.y + size.y);
rlTexCoord2f(1.0f, 1.0f);
rlVertex2f(position.x + size.x, position.y + size.y);
rlTexCoord2f(1.0f, 0.0f);
rlVertex2f(position.x + size.x, position.y);
rlEnd();
rlDisableTexture();
}
} }
// Draw rectangle outline // Draw rectangle outline