diff options
| author | Ray <[email protected]> | 2021-04-13 00:05:21 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-04-13 00:05:21 +0200 |
| commit | 06f16f199a7bb9248089401fc34f93fe7a288f75 (patch) | |
| tree | 95c50e6d11a66f6e227809576724503e018127ea | |
| parent | afb254b985919bf56f192e2473af8d652e470a61 (diff) | |
| download | raylib-06f16f199a7bb9248089401fc34f93fe7a288f75.tar.gz raylib-06f16f199a7bb9248089401fc34f93fe7a288f75.zip | |
REVIEWED: DrawLine3D() #1721
Increased batch limit check to compensate internal buffers alignment for lines drawing
| -rw-r--r-- | src/models.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/models.c b/src/models.c index 6c9a75ba..6860cc45 100644 --- a/src/models.c +++ b/src/models.c @@ -131,7 +131,10 @@ static void InitGLTFBones(Model* model, const cgltf_data* data); // Draw a line in 3D world space void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) { - rlCheckRenderBatchLimit(2); + // WARNING: Be careful with internal buffer vertex alignment + // when using RL_LINES or RL_TRIANGLES, data is aligned to fit + // lines-triangles-quads in the same indexed buffers!!! + rlCheckRenderBatchLimit(4); rlBegin(RL_LINES); rlColor4ub(color.r, color.g, color.b, color.a); @@ -143,7 +146,7 @@ void DrawLine3D(Vector3 startPos, Vector3 endPos, Color color) // Draw a point in 3D space, actually a small line void DrawPoint3D(Vector3 position, Color color) { - rlCheckRenderBatchLimit(2); + rlCheckRenderBatchLimit(4); rlPushMatrix(); rlTranslatef(position.x, position.y, position.z); |
