[examples] Fix examples to work in MSVC (#5267)

* Fix warnings in many examples
Add examples to MSVC solution correctly

* fix CI error

---------

Co-authored-by: Ray <raysan5@gmail.com>
This commit is contained in:
Jeffery Myers
2025-10-15 10:02:52 -07:00
committed by GitHub
parent e3a562ab57
commit 7191749d66
34 changed files with 1550 additions and 405 deletions

View File

@ -88,7 +88,7 @@ int main(void)
if (!voxels[x][y][z]) continue; // Skip empty voxels
// Build a bounding box for this voxel
Vector3 position = { x, y, z };
Vector3 position = { (float)x, (float)y, (float)z };
BoundingBox box = {
(Vector3){ position.x - 0.5f, position.y - 0.5f, position.z - 0.5f },
(Vector3){ position.x + 0.5f, position.y + 0.5f, position.z + 0.5f }
@ -126,7 +126,7 @@ int main(void)
{
if (!voxels[x][y][z]) continue;
Vector3 position = { x, y, z };
Vector3 position = { (float)x, (float)y, (float)z };
DrawModel(cubeModel, position, 1.0f, BEIGE);
DrawCubeWires(position, 1.0f, 1.0f, 1.0f, BLACK);
}

View File

@ -40,7 +40,7 @@ int main(void)
// Load image to create texture for the cube
Model model = LoadModelFromMesh(GenMeshCube(1.0f, 1.0f, 1.0f));
Image img = LoadImage("resources/cubicmap_atlas.png");
Image crop = ImageFromImage(img, (Rectangle){0, img.height/2, img.width/2, img.height/2});
Image crop = ImageFromImage(img, (Rectangle){0, img.height/2.0f, img.width/2.0f, img.height/2.0f});
Texture2D texture = LoadTextureFromImage(crop);
UnloadImage(img);
UnloadImage(crop);

View File

@ -65,7 +65,7 @@ int main(void)
{
// Update
//----------------------------------------------------------------------------------
rotation = DEG2RAD*45.0f*GetTime();
rotation = DEG2RAD*45.0f*(float)GetTime();
for (int i = 0; i < 16; i++)
{