Removed previous change that introduced a bug
This commit is contained in:
parent
db4585b3e2
commit
95c1bf9544
1 changed files with 36 additions and 9 deletions
27
src/shapes.c
27
src/shapes.c
|
@ -179,6 +179,8 @@ void DrawRectangleGradient(int posX, int posY, int width, int height, Color colo
|
|||
|
||||
// Draw a color-filled rectangle (Vector version)
|
||||
void DrawRectangleV(Vector2 position, Vector2 size, Color color)
|
||||
{
|
||||
if (rlGetVersion() == OPENGL_11)
|
||||
{
|
||||
rlBegin(RL_TRIANGLES);
|
||||
rlColor4ub(color.r, color.g, color.b, color.a);
|
||||
|
@ -192,6 +194,31 @@ void DrawRectangleV(Vector2 position, Vector2 size, Color color)
|
|||
rlVertex2i(position.x + size.x, position.y);
|
||||
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
|
||||
void DrawRectangleLines(int posX, int posY, int width, int height, Color color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue