Fixing all other macros by adding RL_ prefix.
This commit is contained in:
parent
8579d1386d
commit
b6cb51e3e8
4 changed files with 1821 additions and 1821 deletions
|
|
@ -70,7 +70,7 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
for (int i = 0; i < bunniesCount; i++)
|
||||
{
|
||||
|
|
@ -78,12 +78,12 @@ int main()
|
|||
// batching buffer starts being filled again; before launching the draw call,
|
||||
// updated vertex data from internal buffer is send to GPU... it seems it generates
|
||||
// a stall and consequently a frame drop, limiting number of bunnies drawn at 60 fps
|
||||
DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, RAYWHITE);
|
||||
DrawTexture(texBunny, bunnies[i].position.x, bunnies[i].position.y, RL_RAYWHITE);
|
||||
}
|
||||
|
||||
DrawRectangle(0, 0, screenWidth, 40, LIGHTGRAY);
|
||||
DrawText("raylib bunnymark", 10, 10, 20, DARKGRAY);
|
||||
DrawText(FormatText("bunnies: %i", bunniesCount), 400, 10, 20, RED);
|
||||
DrawRectangle(0, 0, screenWidth, 40, RL_LIGHTGRAY);
|
||||
DrawText("raylib bunnymark", 10, 10, 20, RL_DARKGRAY);
|
||||
DrawText(FormatText("bunnies: %i", bunniesCount), 400, 10, 20, RL_RED);
|
||||
DrawFPS(260, 10);
|
||||
|
||||
EndDrawing();
|
||||
|
|
|
|||
|
|
@ -68,19 +68,19 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawAnimatedModel(model, Vector3Zero(), 1.0f, WHITE); // Draw animated model
|
||||
DrawAnimatedModel(model, Vector3Zero(), 1.0f, RL_WHITE); // Draw animated model
|
||||
|
||||
DrawGrid(10, 1.0f); // Draw a grid
|
||||
|
||||
EndMode3D();
|
||||
|
||||
DrawText("PRESS SPACE to PLAY IQM MODEL ANIMATION", 10, 10, 20, MAROON);
|
||||
DrawText("PRESS SPACE to PLAY IQM MODEL ANIMATION", 10, 10, 20, RL_MAROON);
|
||||
|
||||
DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, GRAY);
|
||||
DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, RL_GRAY);
|
||||
|
||||
EndDrawing();
|
||||
//----------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -53,9 +53,9 @@
|
|||
|
||||
#include <GLFW/glfw3.h> // Windows/Context and inputs management
|
||||
|
||||
#define RED (Color){ 230, 41, 55, 255 } // Red
|
||||
#define RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo)
|
||||
#define DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray
|
||||
#define RL_RED (Color){ 230, 41, 55, 255 } // Red
|
||||
#define RL_RAYWHITE (Color){ 245, 245, 245, 255 } // My own White (raylib logo)
|
||||
#define RL_DARKGRAY (Color){ 80, 80, 80, 255 } // Dark Gray
|
||||
|
||||
//----------------------------------------------------------------------------------
|
||||
// Module specific Functions Declaration
|
||||
|
|
@ -161,8 +161,8 @@ int main(void)
|
|||
SetMatrixModelview(matView); // Set internal modelview matrix (default shader)
|
||||
SetMatrixProjection(matProj); // Set internal projection matrix (default shader)
|
||||
|
||||
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RED);
|
||||
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RAYWHITE);
|
||||
DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, RL_RED);
|
||||
DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, RL_RAYWHITE);
|
||||
DrawGrid(10, 1.0f);
|
||||
|
||||
// NOTE: Internal buffers drawing (3D data)
|
||||
|
|
@ -187,7 +187,7 @@ int main(void)
|
|||
rlMatrixMode(RL_MODELVIEW); // Enable internal modelview matrix
|
||||
rlLoadIdentity(); // Reset internal modelview matrix
|
||||
#endif
|
||||
DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, DARKGRAY);
|
||||
DrawRectangleV((Vector2){ 10.0f, 10.0f }, (Vector2){ 780.0f, 20.0f }, RL_DARKGRAY);
|
||||
|
||||
// NOTE: Internal buffers drawing (2D data)
|
||||
rlglDraw();
|
||||
|
|
|
|||
|
|
@ -110,8 +110,8 @@ int main()
|
|||
material.maps[MAP_DIFFUSE].texture = LoadTexture("../models/resources/pbr/trooper_albedo.png"); // Load model diffuse texture
|
||||
material.maps[MAP_NORMAL].texture = LoadTexture("../models/resources/pbr/trooper_normals.png"); // Load model normal texture
|
||||
material.maps[MAP_SPECULAR].texture = LoadTexture("../models/resources/pbr/trooper_roughness.png"); // Load model specular texture
|
||||
material.maps[MAP_DIFFUSE].color = WHITE;
|
||||
material.maps[MAP_SPECULAR].color = WHITE;
|
||||
material.maps[MAP_DIFFUSE].color = RL_WHITE;
|
||||
material.maps[MAP_SPECULAR].color = RL_WHITE;
|
||||
|
||||
model.material = material; // Apply material to model
|
||||
|
||||
|
|
@ -153,11 +153,11 @@ int main()
|
|||
//----------------------------------------------------------------------------------
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(RAYWHITE);
|
||||
ClearBackground(RL_RAYWHITE);
|
||||
|
||||
BeginMode3D(camera);
|
||||
|
||||
DrawModel(model, position, 2.0f, WHITE); // Draw 3d model with texture
|
||||
DrawModel(model, position, 2.0f, RL_WHITE); // Draw 3d model with texture
|
||||
|
||||
DrawLight(spotLight); // Draw spot light
|
||||
DrawLight(dirLight); // Draw directional light
|
||||
|
|
@ -268,30 +268,30 @@ void DrawLight(Light light)
|
|||
{
|
||||
case LIGHT_POINT:
|
||||
{
|
||||
DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 0, 0, 0 }, 0.0f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 1, 0, 0 }, 90.0f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
DrawCircle3D(light->position, light->radius, (Vector3){ 0, 1, 0 },90.0f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
} break;
|
||||
case LIGHT_DIRECTIONAL:
|
||||
{
|
||||
DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
|
||||
DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawSphereWires(light->position, 0.3f*light->intensity, 8, 8, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
} break;
|
||||
case LIGHT_SPOT:
|
||||
{
|
||||
DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawLine3D(light->position, light->target, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
|
||||
Vector3 dir = VectorSubtract(light->target, light->position);
|
||||
VectorNormalize(&dir);
|
||||
|
||||
DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCircle3D(light->position, 0.5f, dir, 0.0f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
|
||||
//DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : GRAY));
|
||||
DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : GRAY));
|
||||
//DrawCylinderWires(light->position, 0.0f, 0.3f*light->coneAngle/50, 0.6f, 5, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
DrawCubeWires(light->target, 0.3f, 0.3f, 0.3f, (light->enabled ? light->diffuse : RL_GRAY));
|
||||
} break;
|
||||
default: break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue