diff options
| author | raysan5 <[email protected]> | 2016-03-01 19:00:12 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2016-03-01 19:00:12 +0100 |
| commit | 1674465bdc17f522013c5552bd154f04254d8e74 (patch) | |
| tree | 0557f4ee9a88a307b88bb2aeace458d79470ee70 /src/shapes.c | |
| parent | 8ca6f8c6ec0630c27ce5df646ca12859b74ad980 (diff) | |
| download | raylib-1674465bdc17f522013c5552bd154f04254d8e74.tar.gz raylib-1674465bdc17f522013c5552bd154f04254d8e74.zip | |
Adjust buffers usage
- Removed DrawQuad() function
- DrawBillboard() uses DrawBillboardRec()
- DrawPlane() uses RL_TRIANGLES
- DrawRectangleV() uses RL_TRIANGLES, that way, [shapes] module uses
only TRIANGLES buffers.
Diffstat (limited to 'src/shapes.c')
| -rw-r--r-- | src/shapes.c | 45 |
1 files changed, 9 insertions, 36 deletions
diff --git a/src/shapes.c b/src/shapes.c index 65e3621b..51730a05 100644 --- a/src/shapes.c +++ b/src/shapes.c @@ -180,44 +180,17 @@ 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); - - rlVertex2i(position.x, position.y); - rlVertex2i(position.x, position.y + size.y); - rlVertex2i(position.x + size.x, position.y + size.y); - - rlVertex2i(position.x, position.y); - rlVertex2i(position.x + size.x, position.y + size.y); - 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); + rlBegin(RL_TRIANGLES); + rlColor4ub(color.r, color.g, color.b, color.a); - rlTexCoord2f(1.0f, 0.0f); - rlVertex2f(position.x + size.x, position.y); - rlEnd(); + rlVertex2i(position.x, position.y); + rlVertex2i(position.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y + size.y); - rlDisableTexture(); - } + rlVertex2i(position.x, position.y); + rlVertex2i(position.x + size.x, position.y + size.y); + rlVertex2i(position.x + size.x, position.y); + rlEnd(); } // Draw rectangle outline |
