Fixing all other macros by adding RL_ prefix.

This commit is contained in:
Marco Lizza 2018-12-20 16:15:55 +01:00
commit b6cb51e3e8
14 changed files with 1821 additions and 1821 deletions

View file

@ -48,13 +48,13 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawGrid(10, 1.0f); // Draw a grid
DrawBillboard(camera, bill, billPosition, 2.0f, WHITE);
DrawBillboard(camera, bill, billPosition, 2.0f, RL_WHITE);
EndMode3D();

View file

@ -25,7 +25,7 @@ int main()
Vector3 playerPosition = { 0.0f, 1.0f, 2.0f };
Vector3 playerSize = { 1.0f, 2.0f, 1.0f };
Color playerColor = GREEN;
Color playerColor = RL_GREEN;
Vector3 enemyBoxPos = { -4.0f, 1.0f, 0.0f };
Vector3 enemyBoxSize = { 2.0f, 2.0f, 2.0f };
@ -77,25 +77,25 @@ int main()
playerPosition.z + playerSize.z/2 }},
enemySpherePos, enemySphereSize)) collision = true;
if (collision) playerColor = RED;
else playerColor = GREEN;
if (collision) playerColor = RL_RED;
else playerColor = RL_GREEN;
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
// Draw enemy-box
DrawCube(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, GRAY);
DrawCubeWires(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, DARKGRAY);
DrawCube(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, RL_GRAY);
DrawCubeWires(enemyBoxPos, enemyBoxSize.x, enemyBoxSize.y, enemyBoxSize.z, RL_DARKGRAY);
// Draw enemy-sphere
DrawSphere(enemySpherePos, enemySphereSize, GRAY);
DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, DARKGRAY);
DrawSphere(enemySpherePos, enemySphereSize, RL_GRAY);
DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, RL_DARKGRAY);
// Draw player
DrawCubeV(playerPosition, playerSize, playerColor);
@ -104,7 +104,7 @@ int main()
EndMode3D();
DrawText("Move player with cursors to collide", 220, 40, 20, GRAY);
DrawText("Move player with cursors to collide", 220, 40, 20, RL_GRAY);
DrawFPS(10, 10);

View file

@ -54,19 +54,19 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(model, mapPosition, 1.0f, WHITE);
DrawModel(model, mapPosition, 1.0f, RL_WHITE);
EndMode3D();
DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, WHITE);
DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, GREEN);
DrawTextureEx(cubicmap, (Vector2){ screenWidth - cubicmap.width*4 - 20, 20 }, 0.0f, 4.0f, RL_WHITE);
DrawRectangleLines(screenWidth - cubicmap.width*4 - 20, 20, cubicmap.width*4, cubicmap.height*4, RL_GREEN);
DrawText("cubicmap image used to", 658, 90, 10, GRAY);
DrawText("generate map 3d model", 658, 104, 10, GRAY);
DrawText("cubicmap image used to", 658, 90, 10, RL_GRAY);
DrawText("generate map 3d model", 658, 104, 10, RL_GRAY);
DrawFPS(10, 10);

View file

@ -43,23 +43,23 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RED);
DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, GOLD);
DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, MAROON);
DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_RED);
DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_GOLD);
DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, RL_MAROON);
DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, GREEN);
DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, LIME);
DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, RL_GREEN);
DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, RL_LIME);
DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, SKYBLUE);
DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, DARKBLUE);
DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, BROWN);
DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_SKYBLUE);
DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_DARKBLUE);
DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, RL_BROWN);
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD);
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK);
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_GOLD);
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_PINK);
DrawGrid(10, 1.0f); // Draw a grid

View file

@ -51,18 +51,18 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(model, mapPosition, 1.0f, RED);
DrawModel(model, mapPosition, 1.0f, RL_RED);
DrawGrid(20, 1.0f);
EndMode3D();
DrawTexture(texture, screenWidth - texture.width - 20, 20, WHITE);
DrawRectangleLines(screenWidth - texture.width - 20, 20, texture.width, texture.height, GREEN);
DrawTexture(texture, screenWidth - texture.width - 20, 20, RL_WHITE);
DrawRectangleLines(screenWidth - texture.width - 20, 20, texture.width, texture.height, RL_GREEN);
DrawFPS(10, 10);

View file

@ -71,11 +71,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(model, Vector3Zero(), 1.0f, WHITE);
DrawModel(model, Vector3Zero(), 1.0f, RL_WHITE);
DrawGrid(10, 1.0f);

View file

@ -23,7 +23,7 @@ int main()
InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh generation");
// We generate a checked image for texturing
Image checked = GenImageChecked(2, 2, 1, 1, RED, GREEN);
Image checked = GenImageChecked(2, 2, 1, 1, RL_RED, RL_GREEN);
Texture2D texture = LoadTextureFromImage(checked);
UnloadImage(checked);
@ -71,30 +71,30 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(models[currentModel], position, 1.0f, WHITE);
DrawModel(models[currentModel], position, 1.0f, RL_WHITE);
DrawGrid(10, 1.0);
EndMode3D();
DrawRectangle(30, 400, 310, 30, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(30, 400, 310, 30, Fade(DARKBLUE, 0.5f));
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, BLUE);
DrawRectangle(30, 400, 310, 30, Fade(RL_SKYBLUE, 0.5f));
DrawRectangleLines(30, 400, 310, 30, Fade(RL_DARKBLUE, 0.5f));
DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, RL_BLUE);
switch(currentModel)
{
case 0: DrawText("PLANE", 680, 10, 20, DARKBLUE); break;
case 1: DrawText("CUBE", 680, 10, 20, DARKBLUE); break;
case 2: DrawText("SPHERE", 680, 10, 20, DARKBLUE); break;
case 3: DrawText("HEMISPHERE", 640, 10, 20, DARKBLUE); break;
case 4: DrawText("CYLINDER", 680, 10, 20, DARKBLUE); break;
case 5: DrawText("TORUS", 680, 10, 20, DARKBLUE); break;
case 6: DrawText("KNOT", 680, 10, 20, DARKBLUE); break;
case 7: DrawText("POLY", 680, 10, 20, DARKBLUE); break;
case 0: DrawText("PLANE", 680, 10, 20, RL_DARKBLUE); break;
case 1: DrawText("CUBE", 680, 10, 20, RL_DARKBLUE); break;
case 2: DrawText("SPHERE", 680, 10, 20, RL_DARKBLUE); break;
case 3: DrawText("HEMISPHERE", 640, 10, 20, RL_DARKBLUE); break;
case 4: DrawText("CYLINDER", 680, 10, 20, RL_DARKBLUE); break;
case 5: DrawText("TORUS", 680, 10, 20, RL_DARKBLUE); break;
case 6: DrawText("KNOT", 680, 10, 20, RL_DARKBLUE); break;
case 7: DrawText("POLY", 680, 10, 20, RL_DARKBLUE); break;
default: break;
}

View file

@ -66,7 +66,7 @@ int main()
char *hitObjectName = "None";
nearestHit.distance = FLT_MAX;
nearestHit.hit = false;
Color cursorColor = WHITE;
Color cursorColor = RL_WHITE;
// Get ray and test against ground, triangle, and mesh
ray = GetMouseRay(GetMousePosition(), camera);
@ -77,7 +77,7 @@ int main()
if ((groundHitInfo.hit) && (groundHitInfo.distance < nearestHit.distance))
{
nearestHit = groundHitInfo;
cursorColor = GREEN;
cursorColor = RL_GREEN;
hitObjectName = "Ground";
}
@ -87,7 +87,7 @@ int main()
if ((triHitInfo.hit) && (triHitInfo.distance < nearestHit.distance))
{
nearestHit = triHitInfo;
cursorColor = PURPLE;
cursorColor = RL_PURPLE;
hitObjectName = "Triangle";
bary = Vector3Barycenter(nearestHit.position, ta, tb, tc);
@ -109,7 +109,7 @@ int main()
if ((meshHitInfo.hit) && (meshHitInfo.distance < nearestHit.distance))
{
nearestHit = meshHitInfo;
cursorColor = ORANGE;
cursorColor = RL_ORANGE;
hitObjectName = "Mesh";
}
@ -122,68 +122,68 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
// Draw the tower
// WARNING: If scale is different than 1.0f,
// not considered by GetCollisionRayModel()
DrawModel(tower, towerPos, 1.0f, WHITE);
DrawModel(tower, towerPos, 1.0f, RL_WHITE);
// Draw the test triangle
DrawLine3D(ta, tb, PURPLE);
DrawLine3D(tb, tc, PURPLE);
DrawLine3D(tc, ta, PURPLE);
DrawLine3D(ta, tb, RL_PURPLE);
DrawLine3D(tb, tc, RL_PURPLE);
DrawLine3D(tc, ta, RL_PURPLE);
// Draw the mesh bbox if we hit it
if (hitMeshBBox) DrawBoundingBox(towerBBox, LIME);
if (hitMeshBBox) DrawBoundingBox(towerBBox, RL_LIME);
// If we hit something, draw the cursor at the hit point
if (nearestHit.hit)
{
DrawCube(nearestHit.position, 0.3, 0.3, 0.3, cursorColor);
DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RED);
DrawCubeWires(nearestHit.position, 0.3, 0.3, 0.3, RL_RED);
Vector3 normalEnd;
normalEnd.x = nearestHit.position.x + nearestHit.normal.x;
normalEnd.y = nearestHit.position.y + nearestHit.normal.y;
normalEnd.z = nearestHit.position.z + nearestHit.normal.z;
DrawLine3D(nearestHit.position, normalEnd, RED);
DrawLine3D(nearestHit.position, normalEnd, RL_RED);
}
DrawRay(ray, MAROON);
DrawRay(ray, RL_MAROON);
DrawGrid(10, 10.0f);
EndMode3D();
// Draw some debug GUI text
DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, BLACK);
DrawText(FormatText("Hit Object: %s", hitObjectName), 10, 50, 10, RL_BLACK);
if (nearestHit.hit)
{
int ypos = 70;
DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, BLACK);
DrawText(FormatText("Distance: %3.2f", nearestHit.distance), 10, ypos, 10, RL_BLACK);
DrawText(FormatText("Hit Pos: %3.2f %3.2f %3.2f",
nearestHit.position.x,
nearestHit.position.y,
nearestHit.position.z), 10, ypos + 15, 10, BLACK);
nearestHit.position.z), 10, ypos + 15, 10, RL_BLACK);
DrawText(FormatText("Hit Norm: %3.2f %3.2f %3.2f",
nearestHit.normal.x,
nearestHit.normal.y,
nearestHit.normal.z), 10, ypos + 30, 10, BLACK);
nearestHit.normal.z), 10, ypos + 30, 10, RL_BLACK);
if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, BLACK);
if (hitTriangle) DrawText(FormatText("Barycenter: %3.2f %3.2f %3.2f", bary.x, bary.y, bary.z), 10, ypos + 45, 10, RL_BLACK);
}
DrawText("Use Mouse to Move Camera", 10, 430, 10, GRAY);
DrawText("Use Mouse to Move Camera", 10, 430, 10, RL_GRAY);
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
DrawFPS(10, 10);

View file

@ -48,11 +48,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(model, position, 0.2f, WHITE); // Draw 3d model with texture
DrawModel(model, position, 0.2f, RL_WHITE); // Draw 3d model with texture
DrawGrid(10, 1.0f); // Draw a grid
@ -60,7 +60,7 @@ int main()
EndMode3D();
DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
DrawFPS(10, 10);

View file

@ -86,29 +86,29 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(model, position, 1.0f, WHITE); // Draw 3d model with texture
DrawModel(model, position, 1.0f, RL_WHITE); // Draw 3d model with texture
DrawGrid(20.0, 10.0); // Draw a grid
if (selected) DrawBoundingBox(bounds, GREEN);
if (selected) DrawBoundingBox(bounds, RL_GREEN);
EndMode3D();
DrawText("Free camera default controls:", 10, 20, 10, DARKGRAY);
DrawText("- Mouse Wheel to Zoom in-out", 20, 40, 10, GRAY);
DrawText("- Mouse Wheel Pressed to Pan", 20, 60, 10, GRAY);
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 20, 80, 10, GRAY);
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 20, 100, 10, GRAY);
DrawText("Free camera default controls:", 10, 20, 10, RL_DARKGRAY);
DrawText("- Mouse Wheel to Zoom in-out", 20, 40, 10, RL_GRAY);
DrawText("- Mouse Wheel Pressed to Pan", 20, 60, 10, RL_GRAY);
DrawText("- Alt + Mouse Wheel Pressed to Rotate", 20, 80, 10, RL_GRAY);
DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 20, 100, 10, RL_GRAY);
DrawText("Drag & drop .obj/.png to load mesh/texture.", 10, GetScreenHeight() - 20, 10, DARKGRAY);
DrawText(FormatText("Current file: %s", objFilename), 250, GetScreenHeight() - 20, 10, GRAY);
if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, GREEN);
DrawText("Drag & drop .obj/.png to load mesh/texture.", 10, GetScreenHeight() - 20, 10, RL_DARKGRAY);
DrawText(FormatText("Current file: %s", objFilename), 250, GetScreenHeight() - 20, 10, RL_GRAY);
if (selected) DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, RL_GREEN);
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, GRAY);
DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
EndDrawing();
//----------------------------------------------------------------------------------

View file

@ -55,32 +55,32 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RED);
DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, GOLD);
DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, MAROON);
DrawCube((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_RED);
DrawCubeWires((Vector3){-4.0f, 0.0f, 2.0f}, 2.0f, 5.0f, 2.0f, RL_GOLD);
DrawCubeWires((Vector3){-4.0f, 0.0f, -2.0f}, 3.0f, 6.0f, 2.0f, RL_MAROON);
DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, GREEN);
DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, LIME);
DrawSphere((Vector3){-1.0f, 0.0f, -2.0f}, 1.0f, RL_GREEN);
DrawSphereWires((Vector3){1.0f, 0.0f, 2.0f}, 2.0f, 16, 16, RL_LIME);
DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, SKYBLUE);
DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, DARKBLUE);
DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, BROWN);
DrawCylinder((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_SKYBLUE);
DrawCylinderWires((Vector3){4.0f, 0.0f, -2.0f}, 1.0f, 2.0f, 3.0f, 4, RL_DARKBLUE);
DrawCylinderWires((Vector3){4.5f, -1.0f, 2.0f}, 1.0f, 1.0f, 2.0f, 6, RL_BROWN);
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, GOLD);
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, PINK);
DrawCylinder((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_GOLD);
DrawCylinderWires((Vector3){1.0f, 0.0f, -4.0f}, 0.0f, 1.5f, 3.0f, 8, RL_PINK);
DrawGrid(10, 1.0f); // Draw a grid
EndMode3D();
DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, DARKGRAY);
DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, RL_DARKGRAY);
if (camera.type == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, BLACK);
else if (camera.type == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, BLACK);
if (camera.type == CAMERA_ORTHOGRAPHIC) DrawText("ORTHOGRAPHIC", 10, 40, 20, RL_BLACK);
else if (camera.type == CAMERA_PERSPECTIVE) DrawText("PERSPECTIVE", 10, 40, 20, RL_BLACK);
DrawFPS(10, 10);

View file

@ -74,13 +74,13 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
rlPushMatrix();
rlScalef(sunRadius, sunRadius, sunRadius); // Scale Sun
DrawSphereBasic(GOLD); // Draw the Sun
DrawSphereBasic(RL_GOLD); // Draw the Sun
rlPopMatrix();
rlPushMatrix();
@ -92,7 +92,7 @@ int main()
rlRotatef(earthRotation, 0.25, 1.0, 0.0); // Rotation for Earth itself
rlScalef(earthRadius, earthRadius, earthRadius);// Scale Earth
DrawSphereBasic(BLUE); // Draw the Earth
DrawSphereBasic(RL_BLUE); // Draw the Earth
rlPopMatrix();
rlRotatef(moonOrbitRotation, 0.0f, 1.0f, 0.0f); // Rotation for Moon orbit around Earth
@ -101,16 +101,16 @@ int main()
rlRotatef(moonRotation, 0.0f, 1.0f, 0.0f); // Rotation for Moon itself
rlScalef(moonRadius, moonRadius, moonRadius); // Scale Moon
DrawSphereBasic(LIGHTGRAY); // Draw the Moon
DrawSphereBasic(RL_LIGHTGRAY); // Draw the Moon
rlPopMatrix();
// Some reference elements (not affected by previous matrix transformations)
DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RED, 0.5f));
DrawCircle3D((Vector3){ 0.0f, 0.0f, 0.0f }, earthOrbitRadius, (Vector3){ 1, 0, 0 }, 90.0f, Fade(RL_RED, 0.5f));
DrawGrid(20, 1.0f);
EndMode3D();
DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, MAROON);
DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, RL_MAROON);
DrawFPS(10, 10);
EndDrawing();

View file

@ -63,11 +63,11 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
BeginMode3D(camera);
DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, WHITE);
DrawModel(skybox, (Vector3){0, 0, 0}, 1.0f, RL_WHITE);
DrawGrid(10, 1.0f);

View file

@ -108,7 +108,7 @@ int main()
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
ClearBackground(RL_RAYWHITE);
// Draw framebuffer texture (Ahrs Display)
int centerX = framebuffer.texture.width/2;
@ -121,15 +121,15 @@ int main()
DrawTexturePro(texBackground, (Rectangle){ 0, 0, texBackground.width, texBackground.height },
(Rectangle){ centerX, centerY, texBackground.width*scaleFactor, texBackground.height*scaleFactor},
(Vector2){ texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE);
(Vector2){ texBackground.width/2*scaleFactor, texBackground.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, RL_WHITE);
DrawTexturePro(texPitch, (Rectangle){ 0, 0, texPitch.width, texPitch.height },
(Rectangle){ centerX, centerY, texPitch.width*scaleFactor, texPitch.height*scaleFactor },
(Vector2){ texPitch.width/2*scaleFactor, texPitch.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, WHITE);
(Vector2){ texPitch.width/2*scaleFactor, texPitch.height/2*scaleFactor + pitchOffset*scaleFactor }, roll, RL_WHITE);
DrawTexturePro(texPlane, (Rectangle){ 0, 0, texPlane.width, texPlane.height },
(Rectangle){ centerX, centerY, texPlane.width*scaleFactor, texPlane.height*scaleFactor },
(Vector2){ texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, WHITE);
(Vector2){ texPlane.width/2*scaleFactor, texPlane.height/2*scaleFactor }, 0, RL_WHITE);
EndBlendMode();
@ -138,27 +138,27 @@ int main()
// Draw 3D model (recomended to draw 3D always before 2D)
BeginMode3D(camera);
DrawModel(model, (Vector3){ 0, 6.0f, 0 }, 1.0f, WHITE); // Draw 3d model with texture
DrawModel(model, (Vector3){ 0, 6.0f, 0 }, 1.0f, RL_WHITE); // Draw 3d model with texture
DrawGrid(10, 10.0f);
EndMode3D();
// Draw 2D GUI stuff
DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RED);
DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", GREEN);
DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", SKYBLUE);
DrawAngleGauge(texAngleGauge, 80, 70, roll, "roll", RL_RED);
DrawAngleGauge(texAngleGauge, 190, 70, pitch, "pitch", RL_GREEN);
DrawAngleGauge(texAngleGauge, 300, 70, yaw, "yaw", RL_SKYBLUE);
DrawRectangle(30, 360, 260, 70, Fade(SKYBLUE, 0.5f));
DrawRectangleLines(30, 360, 260, 70, Fade(DARKBLUE, 0.5f));
DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 370, 10, DARKGRAY);
DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 390, 10, DARKGRAY);
DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 410, 10, DARKGRAY);
DrawRectangle(30, 360, 260, 70, Fade(RL_SKYBLUE, 0.5f));
DrawRectangleLines(30, 360, 260, 70, Fade(RL_DARKBLUE, 0.5f));
DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 370, 10, RL_DARKGRAY);
DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 390, 10, RL_DARKGRAY);
DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 410, 10, RL_DARKGRAY);
// Draw framebuffer texture
DrawTextureRec(framebuffer.texture, (Rectangle){ 0, 0, framebuffer.texture.width, -framebuffer.texture.height },
(Vector2){ screenWidth - framebuffer.texture.width - 20, 20 }, Fade(WHITE, 0.8f));
(Vector2){ screenWidth - framebuffer.texture.width - 20, 20 }, Fade(RL_WHITE, 0.8f));
DrawRectangleLines(screenWidth - framebuffer.texture.width - 20, 20, framebuffer.texture.width, framebuffer.texture.height, DARKGRAY);
DrawRectangleLines(screenWidth - framebuffer.texture.width - 20, 20, framebuffer.texture.width, framebuffer.texture.height, RL_DARKGRAY);
EndDrawing();
//----------------------------------------------------------------------------------
@ -193,6 +193,6 @@ void DrawAngleGauge(Texture2D angleGauge, int x, int y, float angle, char title[
DrawTexturePro(angleGauge, srcRec, dstRec, origin, angle, color);
DrawText(FormatText("%5.1f", angle), x - MeasureText(FormatText("%5.1f", angle), textSize) / 2, y + 10, textSize, DARKGRAY);
DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, DARKGRAY);
DrawText(FormatText("%5.1f", angle), x - MeasureText(FormatText("%5.1f", angle), textSize) / 2, y + 10, textSize, RL_DARKGRAY);
DrawText(title, x - MeasureText(title, textSize) / 2, y + 60, textSize, RL_DARKGRAY);
}