|
16 | 16 | ********************************************************************************************/ |
17 | 17 |
|
18 | 18 | #include "raylib.h" |
| 19 | +#include "rlgl.h" |
19 | 20 |
|
20 | 21 | #include <stdlib.h> // Required for: rand() |
21 | 22 | #include <math.h> // Required for: cosf(), sinf() |
|
26 | 27 | //------------------------------------------------------------------------------------ |
27 | 28 | // Module Functions Declaration |
28 | 29 | //------------------------------------------------------------------------------------ |
29 | | -// Generate mesh using points |
30 | | -static Mesh GenMeshPoints(int numPoints); |
| 30 | +static Mesh GenMeshPoints(int numPoints); // Generate mesh using points |
| 31 | +void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points |
| 32 | +void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters |
31 | 33 |
|
32 | 34 | //------------------------------------------------------------------------------------ |
33 | 35 | // Program main entry point |
@@ -184,3 +186,30 @@ static Mesh GenMeshPoints(int numPoints) |
184 | 186 |
|
185 | 187 | return mesh; |
186 | 188 | } |
| 189 | + |
| 190 | + |
| 191 | +// Draw a model points |
| 192 | +// WARNING: OpenGL ES 2.0 does not support point mode drawing |
| 193 | +void DrawModelPoints(Model model, Vector3 position, float scale, Color tint) |
| 194 | +{ |
| 195 | + rlEnablePointMode(); |
| 196 | + rlDisableBackfaceCulling(); |
| 197 | + |
| 198 | + DrawModel(model, position, scale, tint); |
| 199 | + |
| 200 | + rlEnableBackfaceCulling(); |
| 201 | + rlDisablePointMode(); |
| 202 | +} |
| 203 | + |
| 204 | +// Draw a model points |
| 205 | +// WARNING: OpenGL ES 2.0 does not support point mode drawing |
| 206 | +void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint) |
| 207 | +{ |
| 208 | + rlEnablePointMode(); |
| 209 | + rlDisableBackfaceCulling(); |
| 210 | + |
| 211 | + DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint); |
| 212 | + |
| 213 | + rlEnableBackfaceCulling(); |
| 214 | + rlDisablePointMode(); |
| 215 | +} |
0 commit comments