Skip to content

Commit a693365

Browse files
Move DrawModelPoints methods to example - point rendering (#5697)
1 parent bd3a35c commit a693365

9 files changed

Lines changed: 141 additions & 270 deletions

File tree

examples/models/models_point_rendering.c

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
********************************************************************************************/
1717

1818
#include "raylib.h"
19+
#include "rlgl.h"
1920

2021
#include <stdlib.h> // Required for: rand()
2122
#include <math.h> // Required for: cosf(), sinf()
@@ -26,8 +27,9 @@
2627
//------------------------------------------------------------------------------------
2728
// Module Functions Declaration
2829
//------------------------------------------------------------------------------------
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
3133

3234
//------------------------------------------------------------------------------------
3335
// Program main entry point
@@ -184,3 +186,30 @@ static Mesh GenMeshPoints(int numPoints)
184186

185187
return mesh;
186188
}
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+
}

projects/Notepad++/raylib_npp_parser/raylib_npp.xml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,24 +2960,6 @@
29602960
<Param name="Color tint" />
29612961
</Overload>
29622962
</KeyWord>
2963-
<KeyWord name="DrawModelPoints" func="yes">
2964-
<Overload retVal="void" descr="Draw a model as points">
2965-
<Param name="Model model" />
2966-
<Param name="Vector3 position" />
2967-
<Param name="float scale" />
2968-
<Param name="Color tint" />
2969-
</Overload>
2970-
</KeyWord>
2971-
<KeyWord name="DrawModelPointsEx" func="yes">
2972-
<Overload retVal="void" descr="Draw a model as points with extended parameters">
2973-
<Param name="Model model" />
2974-
<Param name="Vector3 position" />
2975-
<Param name="Vector3 rotationAxis" />
2976-
<Param name="float rotationAngle" />
2977-
<Param name="Vector3 scale" />
2978-
<Param name="Color tint" />
2979-
</Overload>
2980-
</KeyWord>
29812963
<KeyWord name="DrawBoundingBox" func="yes">
29822964
<Overload retVal="void" descr="Draw bounding box (wires)">
29832965
<Param name="BoundingBox box" />
@@ -3013,7 +2995,7 @@
30132995
<Param name="Vector2 size" />
30142996
<Param name="Vector2 origin" />
30152997
<Param name="float rotation" />
3016-
<Param name="°ñ_)% " />
2998+
<Param name="��_)% " />
30172999
</Overload>
30183000
</KeyWord>
30193001

projects/Notepad++/raylib_npp_parser/raylib_to_parse.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,6 @@ RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);
600600
RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
601601
RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
602602
RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
603-
RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points
604-
RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters
605603
RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
606604
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
607605
RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source

src/raylib.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,8 +1596,6 @@ RLAPI void DrawModel(Model model, Vector3 position, float scale, Color tint);
15961596
RLAPI void DrawModelEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model with extended parameters
15971597
RLAPI void DrawModelWires(Model model, Vector3 position, float scale, Color tint); // Draw a model wires (with texture if set)
15981598
RLAPI void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model wires (with texture if set) with extended parameters
1599-
RLAPI void DrawModelPoints(Model model, Vector3 position, float scale, Color tint); // Draw a model as points
1600-
RLAPI void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint); // Draw a model as points with extended parameters
16011599
RLAPI void DrawBoundingBox(BoundingBox box, Color color); // Draw bounding box (wires)
16021600
RLAPI void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint); // Draw a billboard texture
16031601
RLAPI void DrawBillboardRec(Camera camera, Texture2D texture, Rectangle source, Vector3 position, Vector2 size, Color tint); // Draw a billboard texture defined by source

src/rmodels.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3961,32 +3961,6 @@ void DrawModelWiresEx(Model model, Vector3 position, Vector3 rotationAxis, float
39613961
rlDisableWireMode();
39623962
}
39633963

3964-
// Draw a model points
3965-
// WARNING: OpenGL ES 2.0 does not support point mode drawing
3966-
void DrawModelPoints(Model model, Vector3 position, float scale, Color tint)
3967-
{
3968-
rlEnablePointMode();
3969-
rlDisableBackfaceCulling();
3970-
3971-
DrawModel(model, position, scale, tint);
3972-
3973-
rlEnableBackfaceCulling();
3974-
rlDisablePointMode();
3975-
}
3976-
3977-
// Draw a model points
3978-
// WARNING: OpenGL ES 2.0 does not support point mode drawing
3979-
void DrawModelPointsEx(Model model, Vector3 position, Vector3 rotationAxis, float rotationAngle, Vector3 scale, Color tint)
3980-
{
3981-
rlEnablePointMode();
3982-
rlDisableBackfaceCulling();
3983-
3984-
DrawModelEx(model, position, rotationAxis, rotationAngle, scale, tint);
3985-
3986-
rlEnableBackfaceCulling();
3987-
rlDisablePointMode();
3988-
}
3989-
39903964
// Draw a billboard
39913965
void DrawBillboard(Camera camera, Texture2D texture, Vector3 position, float scale, Color tint)
39923966
{

tools/rlparser/output/raylib_api.json

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -10820,60 +10820,6 @@
1082010820
}
1082110821
]
1082210822
},
10823-
{
10824-
"name": "DrawModelPoints",
10825-
"description": "Draw a model as points",
10826-
"returnType": "void",
10827-
"params": [
10828-
{
10829-
"type": "Model",
10830-
"name": "model"
10831-
},
10832-
{
10833-
"type": "Vector3",
10834-
"name": "position"
10835-
},
10836-
{
10837-
"type": "float",
10838-
"name": "scale"
10839-
},
10840-
{
10841-
"type": "Color",
10842-
"name": "tint"
10843-
}
10844-
]
10845-
},
10846-
{
10847-
"name": "DrawModelPointsEx",
10848-
"description": "Draw a model as points with extended parameters",
10849-
"returnType": "void",
10850-
"params": [
10851-
{
10852-
"type": "Model",
10853-
"name": "model"
10854-
},
10855-
{
10856-
"type": "Vector3",
10857-
"name": "position"
10858-
},
10859-
{
10860-
"type": "Vector3",
10861-
"name": "rotationAxis"
10862-
},
10863-
{
10864-
"type": "float",
10865-
"name": "rotationAngle"
10866-
},
10867-
{
10868-
"type": "Vector3",
10869-
"name": "scale"
10870-
},
10871-
{
10872-
"type": "Color",
10873-
"name": "tint"
10874-
}
10875-
]
10876-
},
1087710823
{
1087810824
"name": "DrawBoundingBox",
1087910825
"description": "Draw bounding box (wires)",

tools/rlparser/output/raylib_api.lua

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7493,30 +7493,6 @@ return {
74937493
{type = "Color", name = "tint"}
74947494
}
74957495
},
7496-
{
7497-
name = "DrawModelPoints",
7498-
description = "Draw a model as points",
7499-
returnType = "void",
7500-
params = {
7501-
{type = "Model", name = "model"},
7502-
{type = "Vector3", name = "position"},
7503-
{type = "float", name = "scale"},
7504-
{type = "Color", name = "tint"}
7505-
}
7506-
},
7507-
{
7508-
name = "DrawModelPointsEx",
7509-
description = "Draw a model as points with extended parameters",
7510-
returnType = "void",
7511-
params = {
7512-
{type = "Model", name = "model"},
7513-
{type = "Vector3", name = "position"},
7514-
{type = "Vector3", name = "rotationAxis"},
7515-
{type = "float", name = "rotationAngle"},
7516-
{type = "Vector3", name = "scale"},
7517-
{type = "Color", name = "tint"}
7518-
}
7519-
},
75207496
{
75217497
name = "DrawBoundingBox",
75227498
description = "Draw bounding box (wires)",

0 commit comments

Comments
 (0)