@dayme/bunraylib 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/c/model.c ADDED
@@ -0,0 +1,243 @@
1
+ #include "common.h"
2
+
3
+ int LoadModelW(const char* fileName) {
4
+ int slot = modelAlloc();
5
+ if (slot < 0) return -1;
6
+ modelRegistry[slot] = LoadModel(fileName);
7
+ return slot;
8
+ }
9
+
10
+ void UnloadModelW(int id) {
11
+ if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return;
12
+ UnloadModel(modelRegistry[id]);
13
+ modelUsed[id] = false;
14
+ }
15
+
16
+ bool IsModelValidW(int id) {
17
+ if (id < 0 || id >= MAX_MODELS || !modelUsed[id]) return false;
18
+ return IsModelValid(modelRegistry[id]);
19
+ }
20
+
21
+ void GetModelBoundingBoxW(float* outMin, float* outMax, int id) {
22
+ BoundingBox bb = {0};
23
+ if (id >= 0 && id < MAX_MODELS && modelUsed[id]) {
24
+ bb = GetModelBoundingBox(modelRegistry[id]);
25
+ }
26
+ outMin[0] = bb.min.x; outMin[1] = bb.min.y; outMin[2] = bb.min.z;
27
+ outMax[0] = bb.max.x; outMax[1] = bb.max.y; outMax[2] = bb.max.z;
28
+ }
29
+
30
+ int LoadModelFromMeshW(int meshId) {
31
+ if (meshId < 0 || meshId >= MAX_MESHES || !meshUsed[meshId]) return -1;
32
+ int slot = modelAlloc();
33
+ if (slot < 0) return -1;
34
+ modelRegistry[slot] = LoadModelFromMesh(meshRegistry[meshId]);
35
+ return slot;
36
+ }
37
+
38
+ void UnloadMeshW(int id) {
39
+ if (id < 0 || id >= MAX_MESHES || !meshUsed[id]) return;
40
+ UnloadMesh(meshRegistry[id]);
41
+ meshUsed[id] = false;
42
+ }
43
+
44
+ void UploadMeshW(int id, bool dynamic) {
45
+ if (id < 0 || id >= MAX_MESHES || !meshUsed[id]) return;
46
+ UploadMesh(&meshRegistry[id], dynamic);
47
+ }
48
+
49
+ void GetMeshBoundingBoxW(float* outMin, float* outMax, int id) {
50
+ BoundingBox bb = {0};
51
+ if (id >= 0 && id < MAX_MESHES && meshUsed[id]) {
52
+ bb = GetMeshBoundingBox(meshRegistry[id]);
53
+ }
54
+ outMin[0] = bb.min.x; outMin[1] = bb.min.y; outMin[2] = bb.min.z;
55
+ outMax[0] = bb.max.x; outMax[1] = bb.max.y; outMax[2] = bb.max.z;
56
+ }
57
+
58
+ void GenMeshTangentsW(int id) {
59
+ if (id < 0 || id >= MAX_MESHES || !meshUsed[id]) return;
60
+ GenMeshTangents(&meshRegistry[id]);
61
+ }
62
+
63
+ bool ExportMeshW(int id, const char* fileName) {
64
+ if (id < 0 || id >= MAX_MESHES || !meshUsed[id]) return false;
65
+ return ExportMesh(meshRegistry[id], fileName);
66
+ }
67
+
68
+ bool ExportMeshAsCodeW(int id, const char* fileName) {
69
+ if (id < 0 || id >= MAX_MESHES || !meshUsed[id]) return false;
70
+ return ExportMeshAsCode(meshRegistry[id], fileName);
71
+ }
72
+
73
+ int GenMeshPolyW(int sides, int radius) {
74
+ int slot = meshAlloc();
75
+ if (slot < 0) return -1;
76
+ meshRegistry[slot] = GenMeshPoly(sides, i2f(radius));
77
+ return slot;
78
+ }
79
+
80
+ int GenMeshPlaneW(int width, int length, int resX, int resZ) {
81
+ int slot = meshAlloc();
82
+ if (slot < 0) return -1;
83
+ meshRegistry[slot] = GenMeshPlane(i2f(width), i2f(length), resX, resZ);
84
+ return slot;
85
+ }
86
+
87
+ int GenMeshCubeW(int width, int height, int length) {
88
+ int slot = meshAlloc();
89
+ if (slot < 0) return -1;
90
+ meshRegistry[slot] = GenMeshCube(i2f(width), i2f(height), i2f(length));
91
+ return slot;
92
+ }
93
+
94
+ int GenMeshSphereW(int radius, int rings, int slices) {
95
+ int slot = meshAlloc();
96
+ if (slot < 0) return -1;
97
+ meshRegistry[slot] = GenMeshSphere(i2f(radius), rings, slices);
98
+ return slot;
99
+ }
100
+
101
+ int GenMeshHemiSphereW(int radius, int rings, int slices) {
102
+ int slot = meshAlloc();
103
+ if (slot < 0) return -1;
104
+ meshRegistry[slot] = GenMeshHemiSphere(i2f(radius), rings, slices);
105
+ return slot;
106
+ }
107
+
108
+ int GenMeshCylinderW(int radius, int height, int slices) {
109
+ int slot = meshAlloc();
110
+ if (slot < 0) return -1;
111
+ meshRegistry[slot] = GenMeshCylinder(i2f(radius), i2f(height), slices);
112
+ return slot;
113
+ }
114
+
115
+ int GenMeshConeW(int radius, int height, int slices) {
116
+ int slot = meshAlloc();
117
+ if (slot < 0) return -1;
118
+ meshRegistry[slot] = GenMeshCone(i2f(radius), i2f(height), slices);
119
+ return slot;
120
+ }
121
+
122
+ int GenMeshTorusW(int radius, int size, int radSeg, int sides) {
123
+ int slot = meshAlloc();
124
+ if (slot < 0) return -1;
125
+ meshRegistry[slot] = GenMeshTorus(i2f(radius), i2f(size), radSeg, sides);
126
+ return slot;
127
+ }
128
+
129
+ int GenMeshKnotW(int radius, int size, int radSeg, int sides) {
130
+ int slot = meshAlloc();
131
+ if (slot < 0) return -1;
132
+ meshRegistry[slot] = GenMeshKnot(i2f(radius), i2f(size), radSeg, sides);
133
+ return slot;
134
+ }
135
+
136
+ int GenMeshHeightmapW(int imageId, int sizeX, int sizeY, int sizeZ) {
137
+ if (imageId < 0 || imageId >= MAX_IMAGES || !imageUsed[imageId]) return -1;
138
+ int slot = meshAlloc();
139
+ if (slot < 0) return -1;
140
+ meshRegistry[slot] = GenMeshHeightmap(imageRegistry[imageId],
141
+ (Vector3){i2f(sizeX), i2f(sizeY), i2f(sizeZ)});
142
+ return slot;
143
+ }
144
+
145
+ int GenMeshCubicmapW(int imageId, int sizeX, int sizeY, int sizeZ) {
146
+ if (imageId < 0 || imageId >= MAX_IMAGES || !imageUsed[imageId]) return -1;
147
+ int slot = meshAlloc();
148
+ if (slot < 0) return -1;
149
+ meshRegistry[slot] = GenMeshCubicmap(imageRegistry[imageId],
150
+ (Vector3){i2f(sizeX), i2f(sizeY), i2f(sizeZ)});
151
+ return slot;
152
+ }
153
+
154
+ void UpdateMeshBufferW(int meshId, int index, const void* data, int dataSize, int offset) {
155
+ if (meshId < 0 || meshId >= MAX_MESHES || !meshUsed[meshId]) return;
156
+ UpdateMeshBuffer(meshRegistry[meshId], index, data, dataSize, offset);
157
+ }
158
+
159
+ int LoadMaterialDefaultW() {
160
+ int slot = materialAlloc();
161
+ if (slot < 0) return -1;
162
+ materialRegistry[slot] = LoadMaterialDefault();
163
+ return slot;
164
+ }
165
+
166
+ bool IsMaterialValidW(int id) {
167
+ if (id < 0 || id >= MAX_MATERIALS || !materialUsed[id]) return false;
168
+ return IsMaterialValid(materialRegistry[id]);
169
+ }
170
+
171
+ void UnloadMaterialW(int id) {
172
+ if (id < 0 || id >= MAX_MATERIALS || !materialUsed[id]) return;
173
+ UnloadMaterial(materialRegistry[id]);
174
+ materialUsed[id] = false;
175
+ }
176
+
177
+ void SetMaterialTextureW(int id, int mapType, unsigned int texId, int texW, int texH) {
178
+ if (id < 0 || id >= MAX_MATERIALS || !materialUsed[id]) return;
179
+ Texture2D tex = { texId, texW, texH, 1, 7 };
180
+ SetMaterialTexture(&materialRegistry[id], mapType, tex);
181
+ }
182
+
183
+ void SetModelMeshMaterialW(int modelId, int meshId, int materialId) {
184
+ if (modelId < 0 || modelId >= MAX_MODELS || !modelUsed[modelId]) return;
185
+ if (materialId < 0 || materialId >= MAX_MATERIALS || !materialUsed[materialId]) return;
186
+ SetModelMeshMaterial(&modelRegistry[modelId], meshId, materialId);
187
+ }
188
+
189
+ void LoadModelAnimationsW(int* outSlotStart, int* outAnimCount, const char* fileName) {
190
+ int count = 0;
191
+ ModelAnimation* anims = LoadModelAnimations(fileName, &count);
192
+ int startSlot = -1;
193
+ int allocated = 0;
194
+ for (int i = 0; i < count; i++) {
195
+ int slot = animAlloc();
196
+ if (slot < 0) break;
197
+ if (startSlot < 0) startSlot = slot;
198
+ animRegistry[slot] = anims[i];
199
+ allocated++;
200
+ }
201
+ if (allocated < count && startSlot >= 0) {
202
+ for (int i = 0; i < allocated; i++) {
203
+ animUsed[startSlot + i] = false;
204
+ }
205
+ startSlot = -1;
206
+ allocated = 0;
207
+ }
208
+ *outSlotStart = startSlot;
209
+ *outAnimCount = allocated;
210
+ if (anims && count > 0) UnloadModelAnimations(anims, count);
211
+ }
212
+
213
+ void UpdateModelAnimationW(int modelId, int animId, int frame) {
214
+ if (modelId < 0 || modelId >= MAX_MODELS || !modelUsed[modelId]) return;
215
+ if (animId < 0 || animId >= MAX_ANIMATIONS || !animUsed[animId]) return;
216
+ UpdateModelAnimation(modelRegistry[modelId], animRegistry[animId], i2f(frame));
217
+ }
218
+
219
+ void UpdateModelAnimationExW(int modelId, int animAId, int frameA, int animBId, int frameB, int blend) {
220
+ if (modelId < 0 || modelId >= MAX_MODELS || !modelUsed[modelId]) return;
221
+ if (animAId < 0 || animAId >= MAX_ANIMATIONS || !animUsed[animAId]) return;
222
+ if (animBId < 0 || animBId >= MAX_ANIMATIONS || !animUsed[animBId]) return;
223
+ UpdateModelAnimationEx(
224
+ modelRegistry[modelId],
225
+ animRegistry[animAId], i2f(frameA),
226
+ animRegistry[animBId], i2f(frameB),
227
+ i2f(blend));
228
+ }
229
+
230
+ void UnloadModelAnimationsW(int startSlot, int count) {
231
+ for (int i = 0; i < count; i++) {
232
+ int id = startSlot + i;
233
+ if (id < 0 || id >= MAX_ANIMATIONS || !animUsed[id]) continue;
234
+ UnloadModelAnimations(&animRegistry[id], 1);
235
+ animUsed[id] = false;
236
+ }
237
+ }
238
+
239
+ bool IsModelAnimationValidW(int modelId, int animId) {
240
+ if (modelId < 0 || modelId >= MAX_MODELS || !modelUsed[modelId]) return false;
241
+ if (animId < 0 || animId >= MAX_ANIMATIONS || !animUsed[animId]) return false;
242
+ return IsModelAnimationValid(modelRegistry[modelId], animRegistry[animId]);
243
+ }
@@ -0,0 +1,111 @@
1
+ #include "common.h"
2
+
3
+ Model modelRegistry[MAX_MODELS] = {0};
4
+ bool modelUsed[MAX_MODELS] = {0};
5
+
6
+ int modelAlloc(void) {
7
+ for (int i = 0; i < MAX_MODELS; i++) {
8
+ if (!modelUsed[i]) { modelUsed[i] = true; return i; }
9
+ }
10
+ return -1;
11
+ }
12
+
13
+ Font fontRegistry[MAX_FONTS] = {0};
14
+ bool fontUsed[MAX_FONTS] = {0};
15
+
16
+ int fontAlloc(void) {
17
+ for (int i = 0; i < MAX_FONTS; i++) {
18
+ if (!fontUsed[i]) { fontUsed[i] = true; return i; }
19
+ }
20
+ return -1;
21
+ }
22
+
23
+ Image imageRegistry[MAX_IMAGES];
24
+ bool imageUsed[MAX_IMAGES] = {0};
25
+
26
+ int imageAlloc(void) {
27
+ for (int i = 0; i < MAX_IMAGES; i++) {
28
+ if (!imageUsed[i]) { imageUsed[i] = true; return i; }
29
+ }
30
+ return -1;
31
+ }
32
+
33
+ Mesh meshRegistry[MAX_MESHES];
34
+ bool meshUsed[MAX_MESHES] = {0};
35
+
36
+ int meshAlloc(void) {
37
+ for (int i = 0; i < MAX_MESHES; i++) {
38
+ if (!meshUsed[i]) { meshUsed[i] = true; return i; }
39
+ }
40
+ return -1;
41
+ }
42
+
43
+ Material materialRegistry[MAX_MATERIALS];
44
+ bool materialUsed[MAX_MATERIALS] = {0};
45
+
46
+ int materialAlloc(void) {
47
+ for (int i = 0; i < MAX_MATERIALS; i++) {
48
+ if (!materialUsed[i]) { materialUsed[i] = true; return i; }
49
+ }
50
+ return -1;
51
+ }
52
+
53
+ ModelAnimation animRegistry[MAX_ANIMATIONS];
54
+ bool animUsed[MAX_ANIMATIONS] = {0};
55
+
56
+ int animAlloc(void) {
57
+ for (int i = 0; i < MAX_ANIMATIONS; i++) {
58
+ if (!animUsed[i]) { animUsed[i] = true; return i; }
59
+ }
60
+ return -1;
61
+ }
62
+
63
+ Shader shaderRegistry[MAX_SHADERS];
64
+ bool shaderUsed[MAX_SHADERS] = {0};
65
+
66
+ int shaderAlloc(void) {
67
+ for (int i = 0; i < MAX_SHADERS; i++) {
68
+ if (!shaderUsed[i]) { shaderUsed[i] = true; return i; }
69
+ }
70
+ return -1;
71
+ }
72
+
73
+ Wave waveRegistry[MAX_WAVES] = {0};
74
+ bool waveUsed[MAX_WAVES] = {0};
75
+
76
+ int waveAlloc(void) {
77
+ for (int i = 0; i < MAX_WAVES; i++) {
78
+ if (!waveUsed[i]) { waveUsed[i] = true; return i; }
79
+ }
80
+ return -1;
81
+ }
82
+
83
+ Sound soundRegistry[MAX_SOUNDS] = {0};
84
+ bool soundUsed[MAX_SOUNDS] = {0};
85
+
86
+ int soundAlloc(void) {
87
+ for (int i = 0; i < MAX_SOUNDS; i++) {
88
+ if (!soundUsed[i]) { soundUsed[i] = true; return i; }
89
+ }
90
+ return -1;
91
+ }
92
+
93
+ Music musicRegistry[MAX_MUSIC] = {0};
94
+ bool musicUsed[MAX_MUSIC] = {0};
95
+
96
+ int musicAlloc(void) {
97
+ for (int i = 0; i < MAX_MUSIC; i++) {
98
+ if (!musicUsed[i]) { musicUsed[i] = true; return i; }
99
+ }
100
+ return -1;
101
+ }
102
+
103
+ AudioStream audioStreamRegistry[MAX_AUDIOSTREAMS] = {0};
104
+ bool audioStreamUsed[MAX_AUDIOSTREAMS] = {0};
105
+
106
+ int audioStreamAlloc(void) {
107
+ for (int i = 0; i < MAX_AUDIOSTREAMS; i++) {
108
+ if (!audioStreamUsed[i]) { audioStreamUsed[i] = true; return i; }
109
+ }
110
+ return -1;
111
+ }
package/src/c/shader.c ADDED
@@ -0,0 +1,56 @@
1
+ #include "common.h"
2
+
3
+ int LoadShaderW(const char* vsFileName, const char* fsFileName) {
4
+ int slot = shaderAlloc();
5
+ if (slot < 0) return -1;
6
+ shaderRegistry[slot] = LoadShader(vsFileName, fsFileName);
7
+ return slot;
8
+ }
9
+
10
+ int LoadShaderFromMemoryW(const char* vsCode, const char* fsCode) {
11
+ int slot = shaderAlloc();
12
+ if (slot < 0) return -1;
13
+ shaderRegistry[slot] = LoadShaderFromMemory(vsCode, fsCode);
14
+ return slot;
15
+ }
16
+
17
+ bool IsShaderValidW(int id) {
18
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return false;
19
+ return IsShaderValid(shaderRegistry[id]);
20
+ }
21
+
22
+ int GetShaderLocationW(int id, const char* uniformName) {
23
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return -1;
24
+ return GetShaderLocation(shaderRegistry[id], uniformName);
25
+ }
26
+
27
+ int GetShaderLocationAttribW(int id, const char* attribName) {
28
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return -1;
29
+ return GetShaderLocationAttrib(shaderRegistry[id], attribName);
30
+ }
31
+
32
+ void SetShaderValueMatrixW(int id, int locIndex, const float* mat) {
33
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return;
34
+ Matrix m;
35
+ memcpy(&m, mat, sizeof(Matrix));
36
+ SetShaderValueMatrix(shaderRegistry[id], locIndex, m);
37
+ }
38
+
39
+ void SetShaderValueTextureW(int id, int locIndex, unsigned int texId, int texW, int texH) {
40
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return;
41
+ Texture2D tex = { texId, texW, texH, 1, 7 };
42
+ SetShaderValueTexture(shaderRegistry[id], locIndex, tex);
43
+ }
44
+
45
+ void UnloadShaderW(int id) {
46
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return;
47
+ UnloadShader(shaderRegistry[id]);
48
+ shaderUsed[id] = false;
49
+ }
50
+
51
+ void BeginShaderModeW(int id) {
52
+ if (id < 0 || id >= MAX_SHADERS || !shaderUsed[id]) return;
53
+ BeginShaderMode(shaderRegistry[id]);
54
+ }
55
+
56
+ void EndShaderModeW() { EndShaderMode(); }
package/src/c/shapes.c ADDED
@@ -0,0 +1,283 @@
1
+ #include <raylib.h>
2
+ #include <string.h>
3
+
4
+ void DrawRectangleW(int posX, int posY, int width, int height, Color color) {
5
+ DrawRectangle(posX, posY, width, height, color);
6
+ }
7
+
8
+ void DrawTextW(const char* text, int posX, int posY, int fontSize, Color color) {
9
+ DrawText(text, posX, posY, fontSize, color);
10
+ }
11
+
12
+ void DrawPixelW(int posX, int posY, Color color) {
13
+ DrawPixel(posX, posY, color);
14
+ }
15
+
16
+ void DrawLineW(int startPosX, int startPosY, int endPosX, int endPosY, Color color) {
17
+ DrawLine(startPosX, startPosY, endPosX, endPosY, color);
18
+ }
19
+
20
+ void DrawLineExW(int startX, int startY, int endX, int endY, int thick, Color color) {
21
+ DrawLineEx((Vector2){startX, startY}, (Vector2){endX, endY}, thick, color);
22
+ }
23
+
24
+ void DrawLineStripW(const float* points, int pointCount, Color color) {
25
+ DrawLineStrip((const Vector2*)points, pointCount, color);
26
+ }
27
+
28
+ void DrawLineBezierW(int startX, int startY, int endX, int endY, int thick, Color color) {
29
+ DrawLineBezier((Vector2){startX, startY}, (Vector2){endX, endY}, thick, color);
30
+ }
31
+
32
+ void DrawCircleW(int centerX, int centerY, int radius, Color color) {
33
+ DrawCircle(centerX, centerY, radius, color);
34
+ }
35
+
36
+ void DrawCircleSectorW(int centerX, int centerY, int radius, int startAngle, int endAngle, int segments, Color color) {
37
+ float sa, ea;
38
+ memcpy(&sa, &startAngle, sizeof(float));
39
+ memcpy(&ea, &endAngle, sizeof(float));
40
+ DrawCircleSector((Vector2){centerX, centerY}, radius, sa, ea, segments, color);
41
+ }
42
+
43
+ void DrawCircleSectorLinesW(int centerX, int centerY, int radius, int startAngle, int endAngle, int segments, Color color) {
44
+ float sa, ea;
45
+ memcpy(&sa, &startAngle, sizeof(float));
46
+ memcpy(&ea, &endAngle, sizeof(float));
47
+ DrawCircleSectorLines((Vector2){centerX, centerY}, radius, sa, ea, segments, color);
48
+ }
49
+
50
+ void DrawCircleGradientW(int centerX, int centerY, int radius, Color inner, Color outer) {
51
+ float r;
52
+ memcpy(&r, &radius, sizeof(float));
53
+ DrawCircleGradient((Vector2){centerX, centerY}, r, inner, outer);
54
+ }
55
+
56
+ void DrawCircleLinesW(int centerX, int centerY, int radius, Color color) {
57
+ DrawCircleLines(centerX, centerY, radius, color);
58
+ }
59
+
60
+ void DrawEllipseW(int centerX, int centerY, int radiusH, int radiusV, Color color) {
61
+ DrawEllipse(centerX, centerY, radiusH, radiusV, color);
62
+ }
63
+
64
+ void DrawEllipseLinesW(int centerX, int centerY, int radiusH, int radiusV, Color color) {
65
+ DrawEllipseLines(centerX, centerY, radiusH, radiusV, color);
66
+ }
67
+
68
+ void DrawRingW(int centerX, int centerY, int innerRadius, int outerRadius, int startAngle, int endAngle, int segments, Color color) {
69
+ float sa, ea;
70
+ memcpy(&sa, &startAngle, sizeof(float));
71
+ memcpy(&ea, &endAngle, sizeof(float));
72
+ DrawRing((Vector2){centerX, centerY}, innerRadius, outerRadius, sa, ea, segments, color);
73
+ }
74
+
75
+ void DrawRingLinesW(int centerX, int centerY, int innerRadius, int outerRadius, int startAngle, int endAngle, int segments, Color color) {
76
+ float sa, ea;
77
+ memcpy(&sa, &startAngle, sizeof(float));
78
+ memcpy(&ea, &endAngle, sizeof(float));
79
+ DrawRingLines((Vector2){centerX, centerY}, innerRadius, outerRadius, sa, ea, segments, color);
80
+ }
81
+
82
+ void DrawRectangleProW(int x, int y, int width, int height, int originX, int originY, int rotation, Color color) {
83
+ Rectangle rec = { x, y, width, height };
84
+ DrawRectanglePro(rec, (Vector2){originX, originY}, rotation, color);
85
+ }
86
+
87
+ void DrawRectangleGradientVW(int posX, int posY, int width, int height, Color top, Color bottom) {
88
+ DrawRectangleGradientV(posX, posY, width, height, top, bottom);
89
+ }
90
+
91
+ void DrawRectangleGradientHW(int posX, int posY, int width, int height, Color left, Color right) {
92
+ DrawRectangleGradientH(posX, posY, width, height, left, right);
93
+ }
94
+
95
+ void DrawRectangleGradientExW(int x, int y, int width, int height, Color topLeft, Color bottomLeft, Color topRight, Color bottomRight) {
96
+ Rectangle rec = { x, y, width, height };
97
+ DrawRectangleGradientEx(rec, topLeft, bottomLeft, topRight, bottomRight);
98
+ }
99
+
100
+ void DrawRectangleLinesW(int posX, int posY, int width, int height, Color color) {
101
+ DrawRectangleLines(posX, posY, width, height, color);
102
+ }
103
+
104
+ void DrawRectangleLinesExW(int x, int y, int width, int height, int lineThick, Color color) {
105
+ Rectangle rec = { x, y, width, height };
106
+ DrawRectangleLinesEx(rec, lineThick, color);
107
+ }
108
+
109
+ void DrawRectangleRoundedW(int x, int y, int width, int height, int roundness, int segments, Color color) {
110
+ Rectangle rec = { x, y, width, height };
111
+ DrawRectangleRounded(rec, roundness, segments, color);
112
+ }
113
+
114
+ void DrawRectangleRoundedLinesW(int x, int y, int width, int height, int roundness, int segments, Color color) {
115
+ Rectangle rec = { x, y, width, height };
116
+ DrawRectangleRoundedLines(rec, roundness, segments, color);
117
+ }
118
+
119
+ void DrawRectangleRoundedLinesExW(int x, int y, int width, int height, int roundness, int segments, int lineThick, Color color) {
120
+ Rectangle rec = { x, y, width, height };
121
+ DrawRectangleRoundedLinesEx(rec, roundness, segments, lineThick, color);
122
+ }
123
+
124
+ void DrawTriangleW(int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
125
+ DrawTriangle((Vector2){x1, y1}, (Vector2){x2, y2}, (Vector2){x3, y3}, color);
126
+ }
127
+
128
+ void DrawTriangleLinesW(int x1, int y1, int x2, int y2, int x3, int y3, Color color) {
129
+ DrawTriangleLines((Vector2){x1, y1}, (Vector2){x2, y2}, (Vector2){x3, y3}, color);
130
+ }
131
+
132
+ void DrawTriangleFanW(const float* points, int pointCount, Color color) {
133
+ DrawTriangleFan((const Vector2*)points, pointCount, color);
134
+ }
135
+
136
+ void DrawTriangleStripW(const float* points, int pointCount, Color color) {
137
+ DrawTriangleStrip((const Vector2*)points, pointCount, color);
138
+ }
139
+
140
+ void DrawPolyW(int centerX, int centerY, int sides, int radius, int rotation, Color color) {
141
+ DrawPoly((Vector2){centerX, centerY}, sides, radius, rotation, color);
142
+ }
143
+
144
+ void DrawPolyLinesW(int centerX, int centerY, int sides, int radius, int rotation, Color color) {
145
+ DrawPolyLines((Vector2){centerX, centerY}, sides, radius, rotation, color);
146
+ }
147
+
148
+ void DrawPolyLinesExW(int centerX, int centerY, int sides, int radius, int rotation, int lineThick, Color color) {
149
+ DrawPolyLinesEx((Vector2){centerX, centerY}, sides, radius, rotation, lineThick, color);
150
+ }
151
+
152
+ void DrawSplineLinearW(const float* points, int pointCount, int thick, Color color) {
153
+ float t; memcpy(&t, &thick, sizeof(float));
154
+ DrawSplineLinear((const Vector2*)points, pointCount, t, color);
155
+ }
156
+
157
+ void DrawSplineBasisW(const float* points, int pointCount, int thick, Color color) {
158
+ float t; memcpy(&t, &thick, sizeof(float));
159
+ DrawSplineBasis((const Vector2*)points, pointCount, t, color);
160
+ }
161
+
162
+ void DrawSplineCatmullRomW(const float* points, int pointCount, int thick, Color color) {
163
+ float t; memcpy(&t, &thick, sizeof(float));
164
+ DrawSplineCatmullRom((const Vector2*)points, pointCount, t, color);
165
+ }
166
+
167
+ void DrawSplineBezierQuadraticW(const float* points, int pointCount, int thick, Color color) {
168
+ float t; memcpy(&t, &thick, sizeof(float));
169
+ DrawSplineBezierQuadratic((const Vector2*)points, pointCount, t, color);
170
+ }
171
+
172
+ void DrawSplineBezierCubicW(const float* points, int pointCount, int thick, Color color) {
173
+ float t; memcpy(&t, &thick, sizeof(float));
174
+ DrawSplineBezierCubic((const Vector2*)points, pointCount, t, color);
175
+ }
176
+
177
+ void DrawSplineSegmentLinearW(int p1x, int p1y, int p2x, int p2y, int thick, Color color) {
178
+ float t; memcpy(&t, &thick, sizeof(float));
179
+ DrawSplineSegmentLinear((Vector2){p1x, p1y}, (Vector2){p2x, p2y}, t, color);
180
+ }
181
+
182
+ void DrawSplineSegmentBasisW(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y, int thick, Color color) {
183
+ float t; memcpy(&t, &thick, sizeof(float));
184
+ DrawSplineSegmentBasis((Vector2){p1x, p1y}, (Vector2){p2x, p2y}, (Vector2){p3x, p3y}, (Vector2){p4x, p4y}, t, color);
185
+ }
186
+
187
+ void DrawSplineSegmentCatmullRomW(int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y, int thick, Color color) {
188
+ float t; memcpy(&t, &thick, sizeof(float));
189
+ DrawSplineSegmentCatmullRom((Vector2){p1x, p1y}, (Vector2){p2x, p2y}, (Vector2){p3x, p3y}, (Vector2){p4x, p4y}, t, color);
190
+ }
191
+
192
+ void DrawSplineSegmentBezierQuadraticW(int p1x, int p1y, int c2x, int c2y, int p3x, int p3y, int thick, Color color) {
193
+ float t; memcpy(&t, &thick, sizeof(float));
194
+ DrawSplineSegmentBezierQuadratic((Vector2){p1x, p1y}, (Vector2){c2x, c2y}, (Vector2){p3x, p3y}, t, color);
195
+ }
196
+
197
+ void DrawSplineSegmentBezierCubicW(int p1x, int p1y, int c2x, int c2y, int c3x, int c3y, int p4x, int p4y, int thick, Color color) {
198
+ float t; memcpy(&t, &thick, sizeof(float));
199
+ DrawSplineSegmentBezierCubic((Vector2){p1x, p1y}, (Vector2){c2x, c2y}, (Vector2){c3x, c3y}, (Vector2){p4x, p4y}, t, color);
200
+ }
201
+
202
+ void GetSplinePointLinearW(float* out, int startPx, int startPy, int endPx, int endPy, int t) {
203
+ float tf; memcpy(&tf, &t, sizeof(float));
204
+ Vector2 result = GetSplinePointLinear((Vector2){startPx, startPy}, (Vector2){endPx, endPy}, tf);
205
+ out[0] = result.x;
206
+ out[1] = result.y;
207
+ }
208
+
209
+ void GetSplinePointBasisW(float* out, int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y, int t) {
210
+ float tf; memcpy(&tf, &t, sizeof(float));
211
+ Vector2 result = GetSplinePointBasis((Vector2){p1x, p1y}, (Vector2){p2x, p2y}, (Vector2){p3x, p3y}, (Vector2){p4x, p4y}, tf);
212
+ out[0] = result.x;
213
+ out[1] = result.y;
214
+ }
215
+
216
+ void GetSplinePointCatmullRomW(float* out, int p1x, int p1y, int p2x, int p2y, int p3x, int p3y, int p4x, int p4y, int t) {
217
+ float tf; memcpy(&tf, &t, sizeof(float));
218
+ Vector2 result = GetSplinePointCatmullRom((Vector2){p1x, p1y}, (Vector2){p2x, p2y}, (Vector2){p3x, p3y}, (Vector2){p4x, p4y}, tf);
219
+ out[0] = result.x;
220
+ out[1] = result.y;
221
+ }
222
+
223
+ void GetSplinePointBezierQuadW(float* out, int p1x, int p1y, int c2x, int c2y, int p3x, int p3y, int t) {
224
+ float tf; memcpy(&tf, &t, sizeof(float));
225
+ Vector2 result = GetSplinePointBezierQuad((Vector2){p1x, p1y}, (Vector2){c2x, c2y}, (Vector2){p3x, p3y}, tf);
226
+ out[0] = result.x;
227
+ out[1] = result.y;
228
+ }
229
+
230
+ void GetSplinePointBezierCubicW(float* out, int p1x, int p1y, int c2x, int c2y, int c3x, int c3y, int p4x, int p4y, int t) {
231
+ float tf; memcpy(&tf, &t, sizeof(float));
232
+ Vector2 result = GetSplinePointBezierCubic((Vector2){p1x, p1y}, (Vector2){c2x, c2y}, (Vector2){c3x, c3y}, (Vector2){p4x, p4y}, tf);
233
+ out[0] = result.x;
234
+ out[1] = result.y;
235
+ }
236
+
237
+ void DrawPixelVW(int x, int y, Color color) {
238
+ DrawPixelV((Vector2){x, y}, color);
239
+ }
240
+
241
+ void DrawLineVW(int startX, int startY, int endX, int endY, Color color) {
242
+ DrawLineV((Vector2){startX, startY}, (Vector2){endX, endY}, color);
243
+ }
244
+
245
+ void DrawCircleVW(int x, int y, int radius, Color color) {
246
+ float r;
247
+ memcpy(&r, &radius, sizeof(float));
248
+ DrawCircleV((Vector2){x, y}, r, color);
249
+ }
250
+
251
+ void DrawCircleLinesVW(int x, int y, int radius, Color color) {
252
+ float r;
253
+ memcpy(&r, &radius, sizeof(float));
254
+ DrawCircleLinesV((Vector2){x, y}, r, color);
255
+ }
256
+
257
+ void DrawRectangleVW(int posX, int posY, int sizeX, int sizeY, Color color) {
258
+ DrawRectangleV((Vector2){posX, posY}, (Vector2){sizeX, sizeY}, color);
259
+ }
260
+
261
+ void DrawRectangleRecW(int x, int y, int w, int h, Color color) {
262
+ DrawRectangleRec((Rectangle){x, y, w, h}, color);
263
+ }
264
+
265
+ void SetShapesTextureW(unsigned int texId, int texW, int texH, int recX, int recY, int recW, int recH) {
266
+ Texture2D tex = { texId, texW, texH, 1, 7 };
267
+ Rectangle rec = { recX, recY, recW, recH };
268
+ SetShapesTexture(tex, rec);
269
+ }
270
+
271
+ void GetShapesTextureW(unsigned int* outId, int* outW, int* outH) {
272
+ Texture2D tex = GetShapesTexture();
273
+ *outId = tex.id;
274
+ *outW = tex.width;
275
+ *outH = tex.height;
276
+ }
277
+
278
+ void GetShapesTextureRectangleW(float* out) {
279
+ Rectangle rec = GetShapesTextureRectangle();
280
+ out[0] = rec.x; out[1] = rec.y; out[2] = rec.width; out[3] = rec.height;
281
+ }
282
+
283
+ void DrawFPSW(int posX, int posY) { DrawFPS(posX, posY); }