diff --git a/Examples/Audio/ModulePlaying.cs b/Examples/Audio/ModulePlaying.cs
index 1b26b2f..be9ab92 100644
--- a/Examples/Audio/ModulePlaying.cs
+++ b/Examples/Audio/ModulePlaying.cs
@@ -36,27 +36,27 @@ public class ModulePlaying
const int screenWidth = 800;
const int screenHeight = 450;
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT); // NOTE: Try to enable MSAA 4X
+ SetConfigFlags(ConfigFlags.Msaa4xHint); // NOTE: Try to enable MSAA 4X
InitWindow(screenWidth, screenHeight, "raylib [audio] example - module playing (streaming)");
InitAudioDevice();
Color[] colors = new Color[14] {
- Color.ORANGE,
- Color.RED,
- Color.GOLD,
- Color.LIME,
- Color.BLUE,
- Color.VIOLET,
- Color.BROWN,
- Color.LIGHTGRAY,
- Color.PINK,
- Color.YELLOW,
- Color.GREEN,
- Color.SKYBLUE,
- Color.PURPLE,
- Color.BEIGE
+ Color.Orange,
+ Color.Red,
+ Color.Gold,
+ Color.Lime,
+ Color.Blue,
+ Color.Violet,
+ Color.Brown,
+ Color.LightGray,
+ Color.Pink,
+ Color.Yellow,
+ Color.Green,
+ Color.SkyBlue,
+ Color.Purple,
+ Color.Beige
};
// Creates ome circles for visual effect
@@ -92,14 +92,14 @@ public class ModulePlaying
UpdateMusicStream(music); // Update music buffer with new stream data
// Restart music playing (stop and play)
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
StopMusicStream(music);
PlayMusicStream(music);
}
// Pause/Resume music playing
- if (IsKeyPressed(KeyboardKey.KEY_P))
+ if (IsKeyPressed(KeyboardKey.P))
{
pause = !pause;
@@ -113,11 +113,11 @@ public class ModulePlaying
}
}
- if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ if (IsKeyDown(KeyboardKey.Down))
{
pitch -= 0.01f;
}
- else if (IsKeyDown(KeyboardKey.KEY_UP))
+ else if (IsKeyDown(KeyboardKey.Up))
{
pitch += 0.01f;
}
@@ -159,7 +159,7 @@ public class ModulePlaying
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
for (int i = MaxCircles - 1; i >= 0; i--)
{
@@ -171,9 +171,9 @@ public class ModulePlaying
}
// Draw time bar
- DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.LIGHTGRAY);
- DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, Color.MAROON);
- DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.GRAY);
+ DrawRectangle(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.LightGray);
+ DrawRectangle(20, screenHeight - 20 - 12, (int)timePlayed, 12, Color.Maroon);
+ DrawRectangleLines(20, screenHeight - 20 - 12, screenWidth - 40, 12, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Audio/MusicStreamDemo.cs b/Examples/Audio/MusicStreamDemo.cs
index fb2165b..bf8ed9e 100644
--- a/Examples/Audio/MusicStreamDemo.cs
+++ b/Examples/Audio/MusicStreamDemo.cs
@@ -44,14 +44,14 @@ public class MusicStreamDemo
UpdateMusicStream(music); // Update music buffer with new stream data
// Restart music playing (stop and play)
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
StopMusicStream(music);
PlayMusicStream(music);
}
// Pause/Resume music playing
- if (IsKeyPressed(KeyboardKey.KEY_P))
+ if (IsKeyPressed(KeyboardKey.P))
{
pause = !pause;
@@ -77,16 +77,16 @@ public class MusicStreamDemo
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, Color.LIGHTGRAY);
+ DrawText("MUSIC SHOULD BE PLAYING!", 255, 150, 20, Color.LightGray);
- DrawRectangle(200, 200, 400, 12, Color.LIGHTGRAY);
- DrawRectangle(200, 200, (int)timePlayed, 12, Color.MAROON);
- DrawRectangleLines(200, 200, 400, 12, Color.GRAY);
+ DrawRectangle(200, 200, 400, 12, Color.LightGray);
+ DrawRectangle(200, 200, (int)timePlayed, 12, Color.Maroon);
+ DrawRectangleLines(200, 200, 400, 12, Color.Gray);
- DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, Color.LIGHTGRAY);
- DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, Color.LIGHTGRAY);
+ DrawText("PRESS SPACE TO RESTART MUSIC", 215, 250, 20, Color.LightGray);
+ DrawText("PRESS P TO PAUSE/RESUME MUSIC", 208, 280, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Audio/SoundLoading.cs b/Examples/Audio/SoundLoading.cs
index 88c3cda..1aed2bb 100644
--- a/Examples/Audio/SoundLoading.cs
+++ b/Examples/Audio/SoundLoading.cs
@@ -38,12 +38,12 @@ public class SoundLoading
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
PlaySound(fxWav);
}
- if (IsKeyPressed(KeyboardKey.KEY_ENTER))
+ if (IsKeyPressed(KeyboardKey.Enter))
{
PlaySound(fxOgg);
}
@@ -52,10 +52,10 @@ public class SoundLoading
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, Color.LIGHTGRAY);
- DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, Color.LIGHTGRAY);
+ DrawText("Press SPACE to PLAY the WAV sound!", 200, 180, 20, Color.LightGray);
+ DrawText("Press ENTER to PLAY the OGG sound!", 200, 220, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/BasicScreenManager.cs b/Examples/Core/BasicScreenManager.cs
index 035538d..62de113 100644
--- a/Examples/Core/BasicScreenManager.cs
+++ b/Examples/Core/BasicScreenManager.cs
@@ -78,7 +78,7 @@ public class BasicScreenManager
// TODO: Update TITLE screen variables here!
// Press enter to change to GAMEPLAY screen
- if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
+ if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Gameplay;
}
@@ -89,7 +89,7 @@ public class BasicScreenManager
// TODO: Update GAMEPLAY screen variables here!
// Press enter to change to ENDING screen
- if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
+ if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Ending;
}
@@ -100,7 +100,7 @@ public class BasicScreenManager
// TODO: Update ENDING screen variables here!
// Press enter to return to TITLE screen
- if (IsKeyPressed(KeyboardKey.KEY_ENTER) || IsGestureDetected(Gesture.GESTURE_TAP))
+ if (IsKeyPressed(KeyboardKey.Enter) || IsGestureDetected(Gesture.Tap))
{
currentScreen = GameScreen.Title;
}
@@ -115,42 +115,42 @@ public class BasicScreenManager
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
switch (currentScreen)
{
case GameScreen.Logo:
{
// TODO: Draw LOGO screen here!
- DrawText("LOGO SCREEN", 20, 20, 40, Color.LIGHTGRAY);
- DrawText("WAIT for 2 SECONDS...", 290, 220, 20, Color.GRAY);
+ DrawText("LOGO SCREEN", 20, 20, 40, Color.LightGray);
+ DrawText("WAIT for 2 SECONDS...", 290, 220, 20, Color.Gray);
}
break;
case GameScreen.Title:
{
// TODO: Draw TITLE screen here!
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.GREEN);
- DrawText("TITLE SCREEN", 20, 20, 40, Color.DARKGREEN);
- DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, Color.DARKGREEN);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.Green);
+ DrawText("TITLE SCREEN", 20, 20, 40, Color.DarkGreen);
+ DrawText("PRESS ENTER or TAP to JUMP to GAMEPLAY SCREEN", 120, 220, 20, Color.DarkGreen);
}
break;
case GameScreen.Gameplay:
{
// TODO: Draw GAMEPLAY screen here!
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.PURPLE);
- DrawText("GAMEPLAY SCREEN", 20, 20, 40, Color.MAROON);
- DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, Color.MAROON);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.Purple);
+ DrawText("GAMEPLAY SCREEN", 20, 20, 40, Color.Maroon);
+ DrawText("PRESS ENTER or TAP to JUMP to ENDING SCREEN", 130, 220, 20, Color.Maroon);
}
break;
case GameScreen.Ending:
{
// TODO: Draw ENDING screen here!
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.BLUE);
- DrawText("ENDING SCREEN", 20, 20, 40, Color.DARKBLUE);
- DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, Color.DARKBLUE);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.Blue);
+ DrawText("ENDING SCREEN", 20, 20, 40, Color.DarkBlue);
+ DrawText("PRESS ENTER or TAP to RETURN to TITLE SCREEN", 120, 220, 20, Color.DarkBlue);
}
break;
diff --git a/Examples/Core/BasicWindow.cs b/Examples/Core/BasicWindow.cs
index be7c65d..51f8d76 100644
--- a/Examples/Core/BasicWindow.cs
+++ b/Examples/Core/BasicWindow.cs
@@ -51,9 +51,9 @@ public class BasicWindow
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Congrats! You created your first window!", 190, 200, 20, Color.MAROON);
+ DrawText("Congrats! You created your first window!", 190, 200, 20, Color.Maroon);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/Camera2dDemo.cs b/Examples/Core/Camera2dDemo.cs
index afa7a9e..2c2568e 100644
--- a/Examples/Core/Camera2dDemo.cs
+++ b/Examples/Core/Camera2dDemo.cs
@@ -66,11 +66,11 @@ public class Camera2dDemo
//----------------------------------------------------------------------------------
// Player movement
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
player.X += 2;
}
- else if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ else if (IsKeyDown(KeyboardKey.Left))
{
player.X -= 2;
}
@@ -79,11 +79,11 @@ public class Camera2dDemo
camera.Target = new Vector2(player.X + 20, player.Y + 20);
// Camera3D rotation controls
- if (IsKeyDown(KeyboardKey.KEY_A))
+ if (IsKeyDown(KeyboardKey.A))
{
camera.Rotation--;
}
- else if (IsKeyDown(KeyboardKey.KEY_S))
+ else if (IsKeyDown(KeyboardKey.S))
{
camera.Rotation++;
}
@@ -111,7 +111,7 @@ public class Camera2dDemo
}
// Camera3D reset (zoom and rotation)
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
camera.Zoom = 1.0f;
camera.Rotation = 0.0f;
@@ -121,45 +121,45 @@ public class Camera2dDemo
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode2D(camera);
- DrawRectangle(-6000, 320, 13000, 8000, Color.DARKGRAY);
+ DrawRectangle(-6000, 320, 13000, 8000, Color.DarkGray);
for (int i = 0; i < MaxBuildings; i++)
{
DrawRectangleRec(buildings[i], buildColors[i]);
}
- DrawRectangleRec(player, Color.RED);
+ DrawRectangleRec(player, Color.Red);
- DrawRectangle((int)camera.Target.X, -500, 1, (int)(screenHeight * 4), Color.GREEN);
+ DrawRectangle((int)camera.Target.X, -500, 1, (int)(screenHeight * 4), Color.Green);
DrawLine(
(int)(-screenWidth * 10),
(int)camera.Target.Y,
(int)(screenWidth * 10),
(int)camera.Target.Y,
- Color.GREEN
+ Color.Green
);
EndMode2D();
- DrawText("SCREEN AREA", 640, 10, 20, Color.RED);
+ DrawText("SCREEN AREA", 640, 10, 20, Color.Red);
- DrawRectangle(0, 0, (int)screenWidth, 5, Color.RED);
- DrawRectangle(0, 5, 5, (int)screenHeight - 10, Color.RED);
- DrawRectangle((int)screenWidth - 5, 5, 5, (int)screenHeight - 10, Color.RED);
- DrawRectangle(0, (int)screenHeight - 5, (int)screenWidth, 5, Color.RED);
+ DrawRectangle(0, 0, (int)screenWidth, 5, Color.Red);
+ DrawRectangle(0, 5, 5, (int)screenHeight - 10, Color.Red);
+ DrawRectangle((int)screenWidth - 5, 5, 5, (int)screenHeight - 10, Color.Red);
+ DrawRectangle(0, (int)screenHeight - 5, (int)screenWidth, 5, Color.Red);
- DrawRectangle(10, 10, 250, 113, ColorAlpha(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(10, 10, 250, 113, Color.BLUE);
+ DrawRectangle(10, 10, 250, 113, ColorAlpha(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(10, 10, 250, 113, Color.Blue);
- DrawText("Free 2d camera controls:", 20, 20, 10, Color.BLACK);
- DrawText("- Right/Left to move Offset", 40, 40, 10, Color.DARKGRAY);
- DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color.DARKGRAY);
- DrawText("- A / S to Rotate", 40, 80, 10, Color.DARKGRAY);
- DrawText("- R to reset Zoom and Rotation", 40, 100, 10, Color.DARKGRAY);
+ DrawText("Free 2d camera controls:", 20, 20, 10, Color.Black);
+ DrawText("- Right/Left to move Offset", 40, 40, 10, Color.DarkGray);
+ DrawText("- Mouse Wheel to Zoom in-out", 40, 60, 10, Color.DarkGray);
+ DrawText("- A / S to Rotate", 40, 80, 10, Color.DarkGray);
+ DrawText("- R to reset Zoom and Rotation", 40, 100, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/Camera2dPlatformer.cs b/Examples/Core/Camera2dPlatformer.cs
index 2f351ba..c86d820 100644
--- a/Examples/Core/Camera2dPlatformer.cs
+++ b/Examples/Core/Camera2dPlatformer.cs
@@ -70,11 +70,11 @@ public class Camera2dPlatformer
EnvItem[] envItems = new EnvItem[]
{
- new EnvItem(new Rectangle(0, 0, 1000, 400), 0, Color.LIGHTGRAY),
- new EnvItem(new Rectangle(0, 400, 1000, 200), 1, Color.GRAY),
- new EnvItem(new Rectangle(300, 200, 400, 10), 1, Color.GRAY),
- new EnvItem(new Rectangle(250, 300, 100, 10), 1, Color.GRAY),
- new EnvItem(new Rectangle(650, 300, 100, 10), 1, Color.GRAY)
+ new EnvItem(new Rectangle(0, 0, 1000, 400), 0, Color.LightGray),
+ new EnvItem(new Rectangle(0, 400, 1000, 200), 1, Color.Gray),
+ new EnvItem(new Rectangle(300, 200, 400, 10), 1, Color.Gray),
+ new EnvItem(new Rectangle(250, 300, 100, 10), 1, Color.Gray),
+ new EnvItem(new Rectangle(650, 300, 100, 10), 1, Color.Gray)
};
Camera2D camera = new();
@@ -127,13 +127,13 @@ public class Camera2dPlatformer
camera.Zoom = 0.25f;
}
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
camera.Zoom = 1.0f;
player.Position = new Vector2(400, 280);
}
- if (IsKeyPressed(KeyboardKey.KEY_C))
+ if (IsKeyPressed(KeyboardKey.C))
{
cameraOption = (cameraOption + 1) % cameraUpdatersLength;
}
@@ -145,7 +145,7 @@ public class Camera2dPlatformer
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.LIGHTGRAY);
+ ClearBackground(Color.LightGray);
BeginMode2D(camera);
@@ -155,17 +155,17 @@ public class Camera2dPlatformer
}
Rectangle playerRect = new(player.Position.X - 20, player.Position.Y - 40, 40, 40);
- DrawRectangleRec(playerRect, Color.RED);
+ DrawRectangleRec(playerRect, Color.Red);
EndMode2D();
- DrawText("Controls:", 20, 20, 10, Color.BLACK);
- DrawText("- Right/Left to move", 40, 40, 10, Color.DARKGRAY);
- DrawText("- Space to jump", 40, 60, 10, Color.DARKGRAY);
- DrawText("- Mouse Wheel to Zoom in-out, R to reset zoom", 40, 80, 10, Color.DARKGRAY);
- DrawText("- C to change camera mode", 40, 100, 10, Color.DARKGRAY);
- DrawText("Current camera mode:", 20, 120, 10, Color.BLACK);
- DrawText(cameraDescriptions[cameraOption], 40, 140, 10, Color.DARKGRAY);
+ DrawText("Controls:", 20, 20, 10, Color.Black);
+ DrawText("- Right/Left to move", 40, 40, 10, Color.DarkGray);
+ DrawText("- Space to jump", 40, 60, 10, Color.DarkGray);
+ DrawText("- Mouse Wheel to Zoom in-out, R to reset zoom", 40, 80, 10, Color.DarkGray);
+ DrawText("- C to change camera mode", 40, 100, 10, Color.DarkGray);
+ DrawText("Current camera mode:", 20, 120, 10, Color.Black);
+ DrawText(cameraDescriptions[cameraOption], 40, 140, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -181,17 +181,17 @@ public class Camera2dPlatformer
static void UpdatePlayer(ref Player player, EnvItem[] envItems, float delta)
{
- if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ if (IsKeyDown(KeyboardKey.Left))
{
player.Position.X -= PlayerHorSpeed * delta;
}
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
player.Position.X += PlayerHorSpeed * delta;
}
- if (IsKeyDown(KeyboardKey.KEY_SPACE) && player.CanJump)
+ if (IsKeyDown(KeyboardKey.Space) && player.CanJump)
{
player.Speed = -PlayerJumpSpeed;
player.CanJump = false;
diff --git a/Examples/Core/Camera3dFirstPerson.cs b/Examples/Core/Camera3dFirstPerson.cs
index fe5a778..022cd07 100644
--- a/Examples/Core/Camera3dFirstPerson.cs
+++ b/Examples/Core/Camera3dFirstPerson.cs
@@ -33,7 +33,7 @@ public class Camera3dFirstPerson
camera.Target = new Vector3(0.0f, 1.8f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 60.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Generates some random columns
float[] heights = new float[MaxColumns];
@@ -47,7 +47,7 @@ public class Camera3dFirstPerson
colors[i] = new Color(GetRandomValue(20, 255), GetRandomValue(10, 55), 30, 255);
}
- CameraMode cameraMode = CameraMode.CAMERA_FIRST_PERSON;
+ CameraMode cameraMode = CameraMode.FirstPerson;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -58,54 +58,54 @@ public class Camera3dFirstPerson
// Update
//----------------------------------------------------------------------------------
// Switch camera mode
- if (IsKeyPressed(KeyboardKey.KEY_ONE))
+ if (IsKeyPressed(KeyboardKey.One))
{
- cameraMode = CameraMode.CAMERA_FREE;
+ cameraMode = CameraMode.Free;
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
}
- if (IsKeyPressed(KeyboardKey.KEY_TWO))
+ if (IsKeyPressed(KeyboardKey.Two))
{
- cameraMode = CameraMode.CAMERA_FIRST_PERSON;
+ cameraMode = CameraMode.FirstPerson;
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
}
- if (IsKeyPressed(KeyboardKey.KEY_THREE))
+ if (IsKeyPressed(KeyboardKey.Three))
{
- cameraMode = CameraMode.CAMERA_THIRD_PERSON;
+ cameraMode = CameraMode.ThirdPerson;
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
}
- if (IsKeyPressed(KeyboardKey.KEY_FOUR))
+ if (IsKeyPressed(KeyboardKey.Four))
{
- cameraMode = CameraMode.CAMERA_ORBITAL;
+ cameraMode = CameraMode.Orbital;
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
}
// Switch camera projection
- if (IsKeyPressed(KeyboardKey.KEY_P))
+ if (IsKeyPressed(KeyboardKey.P))
{
- if (camera.Projection == CameraProjection.CAMERA_PERSPECTIVE)
+ if (camera.Projection == CameraProjection.Perspective)
{
// Create isometric view
- cameraMode = CameraMode.CAMERA_THIRD_PERSON;
+ cameraMode = CameraMode.ThirdPerson;
// Note: The target distance is related to the render distance in the orthographic projection
camera.Position = new Vector3(0.0f, 2.0f, -100.0f);
camera.Target = new Vector3(0.0f, 2.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
- camera.Projection = CameraProjection.CAMERA_ORTHOGRAPHIC;
+ camera.Projection = CameraProjection.Orthographic;
camera.FovY = 20.0f; // near plane width in CAMERA_ORTHOGRAPHIC
// CameraYaw(&camera, -135 * DEG2RAD, true);
// CameraPitch(&camera, -45 * DEG2RAD, true, true, false);
}
- else if (camera.Projection == CameraProjection.CAMERA_ORTHOGRAPHIC)
+ else if (camera.Projection == CameraProjection.Orthographic)
{
// Reset to default view
- cameraMode = CameraMode.CAMERA_THIRD_PERSON;
+ cameraMode = CameraMode.ThirdPerson;
camera.Position = new Vector3(0.0f, 2.0f, 10.0f);
camera.Target = new Vector3(0.0f, 2.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
camera.FovY = 60.0f;
}
}
@@ -113,64 +113,64 @@ public class Camera3dFirstPerson
// Update camera computes movement internally depending on the camera mode
// Some default standard keyboard/mouse inputs are hardcoded to simplify use
// For advance camera controls, it's reecommended to compute camera movement manually
- UpdateCamera(ref camera, CameraMode.CAMERA_CUSTOM);
+ UpdateCamera(ref camera, CameraMode.Custom);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
// Draw ground
- DrawPlane(new Vector3(0.0f, 0.0f, 0.0f), new Vector2(32.0f, 32.0f), Color.LIGHTGRAY);
+ DrawPlane(new Vector3(0.0f, 0.0f, 0.0f), new Vector2(32.0f, 32.0f), Color.LightGray);
// Draw a blue wall
- DrawCube(new Vector3(-16.0f, 2.5f, 0.0f), 1.0f, 5.0f, 32.0f, Color.BLUE);
+ DrawCube(new Vector3(-16.0f, 2.5f, 0.0f), 1.0f, 5.0f, 32.0f, Color.Blue);
// Draw a green wall
- DrawCube(new Vector3(16.0f, 2.5f, 0.0f), 1.0f, 5.0f, 32.0f, Color.LIME);
+ DrawCube(new Vector3(16.0f, 2.5f, 0.0f), 1.0f, 5.0f, 32.0f, Color.Lime);
// Draw a yellow wall
- DrawCube(new Vector3(0.0f, 2.5f, 16.0f), 32.0f, 5.0f, 1.0f, Color.GOLD);
+ DrawCube(new Vector3(0.0f, 2.5f, 16.0f), 32.0f, 5.0f, 1.0f, Color.Gold);
// Draw some cubes around
for (int i = 0; i < MaxColumns; i++)
{
DrawCube(positions[i], 2.0f, heights[i], 2.0f, colors[i]);
- DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, Color.MAROON);
+ DrawCubeWires(positions[i], 2.0f, heights[i], 2.0f, Color.Maroon);
}
// Draw player cube
- if (cameraMode == CameraMode.CAMERA_THIRD_PERSON)
+ if (cameraMode == CameraMode.ThirdPerson)
{
- DrawCube(camera.Target, 0.5f, 0.5f, 0.5f, Color.PURPLE);
- DrawCubeWires(camera.Target, 0.5f, 0.5f, 0.5f, Color.DARKPURPLE);
+ DrawCube(camera.Target, 0.5f, 0.5f, 0.5f, Color.Purple);
+ DrawCubeWires(camera.Target, 0.5f, 0.5f, 0.5f, Color.DarkPurple);
}
EndMode3D();
// Draw info boxes
- DrawRectangle(5, 5, 330, 100, ColorAlpha(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(10, 10, 330, 100, Color.BLUE);
+ DrawRectangle(5, 5, 330, 100, ColorAlpha(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(10, 10, 330, 100, Color.Blue);
- DrawText("Camera controls:", 15, 15, 10, Color.BLACK);
- DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, Color.BLACK);
- DrawText("- Look around: arrow keys or mouse", 15, 45, 10, Color.BLACK);
- DrawText("- Camera mode keys: 1, 2, 3, 4", 15, 60, 10, Color.BLACK);
- DrawText("- Zoom keys: num-plus, num-minus or mouse scroll", 15, 75, 10, Color.BLACK);
- DrawText("- Camera projection key: P", 15, 90, 10, Color.BLACK);
+ DrawText("Camera controls:", 15, 15, 10, Color.Black);
+ DrawText("- Move keys: W, A, S, D, Space, Left-Ctrl", 15, 30, 10, Color.Black);
+ DrawText("- Look around: arrow keys or mouse", 15, 45, 10, Color.Black);
+ DrawText("- Camera mode keys: 1, 2, 3, 4", 15, 60, 10, Color.Black);
+ DrawText("- Zoom keys: num-plus, num-minus or mouse scroll", 15, 75, 10, Color.Black);
+ DrawText("- Camera projection key: P", 15, 90, 10, Color.Black);
- DrawRectangle(600, 5, 195, 100, Fade(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(600, 5, 195, 100, Color.BLUE);
+ DrawRectangle(600, 5, 195, 100, Fade(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(600, 5, 195, 100, Color.Blue);
- DrawText("Camera status:", 610, 15, 10, Color.BLACK);
- DrawText($"- Mode: {cameraMode}", 610, 30, 10, Color.BLACK);
- DrawText($"- Projection: {camera.Projection}", 610, 45, 10, Color.BLACK);
- DrawText($"- Position: {camera.Position}", 610, 60, 10, Color.BLACK);
- DrawText($"- Target: {camera.Target}", 610, 75, 10, Color.BLACK);
- DrawText($"- Up: {camera.Up}", 610, 90, 10, Color.BLACK);
+ DrawText("Camera status:", 610, 15, 10, Color.Black);
+ DrawText($"- Mode: {cameraMode}", 610, 30, 10, Color.Black);
+ DrawText($"- Projection: {camera.Projection}", 610, 45, 10, Color.Black);
+ DrawText($"- Position: {camera.Position}", 610, 60, 10, Color.Black);
+ DrawText($"- Target: {camera.Target}", 610, 75, 10, Color.Black);
+ DrawText($"- Up: {camera.Up}", 610, 90, 10, Color.Black);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/Camera3dFree.cs b/Examples/Core/Camera3dFree.cs
index dde82b9..cea2e8f 100644
--- a/Examples/Core/Camera3dFree.cs
+++ b/Examples/Core/Camera3dFree.cs
@@ -31,7 +31,7 @@ public class Camera3dFree
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 cubePosition = new(0.0f, 0.0f, 0.0f);
@@ -43,9 +43,9 @@ public class Camera3dFree
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
- if (IsKeyDown(KeyboardKey.KEY_Z))
+ if (IsKeyDown(KeyboardKey.Z))
{
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
}
@@ -54,26 +54,26 @@ public class Camera3dFree
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.RED);
- DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.MAROON);
+ DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.Red);
+ DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.Maroon);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawRectangle(10, 10, 320, 133, ColorAlpha(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(10, 10, 320, 133, Color.BLUE);
+ DrawRectangle(10, 10, 320, 133, ColorAlpha(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(10, 10, 320, 133, Color.Blue);
- DrawText("Free camera default controls:", 20, 20, 10, Color.BLACK);
- DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, Color.DARKGRAY);
- DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, Color.DARKGRAY);
- DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, Color.DARKGRAY);
- DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, Color.DARKGRAY);
- DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, Color.DARKGRAY);
+ DrawText("Free camera default controls:", 20, 20, 10, Color.Black);
+ DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, Color.DarkGray);
+ DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, Color.DarkGray);
+ DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, Color.DarkGray);
+ DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, Color.DarkGray);
+ DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/Camera3dMode.cs b/Examples/Core/Camera3dMode.cs
index 9a3a8e8..61510a2 100644
--- a/Examples/Core/Camera3dMode.cs
+++ b/Examples/Core/Camera3dMode.cs
@@ -31,7 +31,7 @@ public class Camera3dMode
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 cubePosition = new(0.0f, 0.0f, 0.0f);
@@ -49,18 +49,18 @@ public class Camera3dMode
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.RED);
- DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.MAROON);
+ DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.Red);
+ DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.Maroon);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawText("Welcome to the third dimension!", 10, 40, 20, Color.DARKGRAY);
+ DrawText("Welcome to the third dimension!", 10, 40, 20, Color.DarkGray);
DrawFPS(10, 10);
diff --git a/Examples/Core/Customlogging.cs b/Examples/Core/Customlogging.cs
index d98991a..bf0efe7 100644
--- a/Examples/Core/Customlogging.cs
+++ b/Examples/Core/Customlogging.cs
@@ -68,9 +68,9 @@ public unsafe class CustomLogging
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Check out the console output to see the custom logger in action!", 60, 200, 20, Color.LIGHTGRAY);
+ DrawText("Check out the console output to see the custom logger in action!", 60, 200, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/DropFiles.cs b/Examples/Core/DropFiles.cs
index 4104c40..0d236e8 100644
--- a/Examples/Core/DropFiles.cs
+++ b/Examples/Core/DropFiles.cs
@@ -45,30 +45,30 @@ public class DropFiles
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (files.Length == 0)
{
- DrawText("Drop your files to this window!", 100, 40, 20, Color.DARKGRAY);
+ DrawText("Drop your files to this window!", 100, 40, 20, Color.DarkGray);
}
else
{
- DrawText("Dropped files:", 100, 40, 20, Color.DARKGRAY);
+ DrawText("Dropped files:", 100, 40, 20, Color.DarkGray);
for (int i = 0; i < files.Length; i++)
{
if (i % 2 == 0)
{
- DrawRectangle(0, 85 + 40 * i, screenWidth, 40, ColorAlpha(Color.LIGHTGRAY, 0.5f));
+ DrawRectangle(0, 85 + 40 * i, screenWidth, 40, ColorAlpha(Color.LightGray, 0.5f));
}
else
{
- DrawRectangle(0, 85 + 40 * i, screenWidth, 40, ColorAlpha(Color.LIGHTGRAY, 0.3f));
+ DrawRectangle(0, 85 + 40 * i, screenWidth, 40, ColorAlpha(Color.LightGray, 0.3f));
}
- DrawText(files[i], 120, 100 + 40 * i, 10, Color.GRAY);
+ DrawText(files[i], 120, 100 + 40 * i, 10, Color.Gray);
}
- DrawText("Drop new files...", 100, 110 + 40 * files.Length, 20, Color.DARKGRAY);
+ DrawText("Drop new files...", 100, 110 + 40 * files.Length, 20, Color.DarkGray);
}
EndDrawing();
diff --git a/Examples/Core/InputGamepad.cs b/Examples/Core/InputGamepad.cs
index 4d0e984..39fe911 100644
--- a/Examples/Core/InputGamepad.cs
+++ b/Examples/Core/InputGamepad.cs
@@ -38,7 +38,7 @@ public class InputGamepad
const int screenHeight = 450;
// Set MSAA 4X hint before windows creation
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad input");
Texture2D texPs3Pad = LoadTexture("resources/ps3.png");
@@ -58,232 +58,232 @@ public class InputGamepad
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (IsGamepadAvailable(0))
{
string gamepadName = GetGamepadName_(0);
- DrawText($"GP1: {gamepadName}", 10, 10, 10, Color.BLACK);
+ DrawText($"GP1: {gamepadName}", 10, 10, 10, Color.Black);
if (gamepadName == XBOX360_LEGACY_NAME_ID ||
gamepadName == XBOX360_NAME_ID ||
gamepadName == XBOX360_NAME_ID_RPI)
{
- DrawTexture(texXboxPad, 0, 0, Color.DARKGRAY);
+ DrawTexture(texXboxPad, 0, 0, Color.DarkGray);
// Draw buttons: xbox home
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE))
+ if (IsGamepadButtonDown(0, GamepadButton.Middle))
{
- DrawCircle(394, 89, 19, Color.RED);
+ DrawCircle(394, 89, 19, Color.Red);
}
// Draw buttons: basic
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.MiddleRight))
{
- DrawCircle(436, 150, 9, Color.RED);
+ DrawCircle(436, 150, 9, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.MiddleLeft))
{
- DrawCircle(352, 150, 9, Color.RED);
+ DrawCircle(352, 150, 9, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceLeft))
{
- DrawCircle(501, 151, 15, Color.BLUE);
+ DrawCircle(501, 151, 15, Color.Blue);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_DOWN))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceDown))
{
- DrawCircle(536, 187, 15, Color.LIME);
+ DrawCircle(536, 187, 15, Color.Lime);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceRight))
{
- DrawCircle(572, 151, 15, Color.MAROON);
+ DrawCircle(572, 151, 15, Color.Maroon);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_UP))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceUp))
{
- DrawCircle(536, 115, 15, Color.GOLD);
+ DrawCircle(536, 115, 15, Color.Gold);
}
// Draw buttons: d-pad
- DrawRectangle(317, 202, 19, 71, Color.BLACK);
- DrawRectangle(293, 228, 69, 19, Color.BLACK);
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_UP))
+ DrawRectangle(317, 202, 19, 71, Color.Black);
+ DrawRectangle(293, 228, 69, 19, Color.Black);
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceUp))
{
- DrawRectangle(317, 202, 19, 26, Color.RED);
+ DrawRectangle(317, 202, 19, 26, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_DOWN))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceDown))
{
- DrawRectangle(317, 202 + 45, 19, 26, Color.RED);
+ DrawRectangle(317, 202 + 45, 19, 26, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceLeft))
{
- DrawRectangle(292, 228, 25, 19, Color.RED);
+ DrawRectangle(292, 228, 25, 19, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceRight))
{
- DrawRectangle(292 + 44, 228, 26, 19, Color.RED);
+ DrawRectangle(292 + 44, 228, 26, 19, Color.Red);
}
// Draw buttons: left-right back
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_TRIGGER_1))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftTrigger1))
{
- DrawCircle(259, 61, 20, Color.RED);
+ DrawCircle(259, 61, 20, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_TRIGGER_1))
+ if (IsGamepadButtonDown(0, GamepadButton.RightTrigger1))
{
- DrawCircle(536, 61, 20, Color.RED);
+ DrawCircle(536, 61, 20, Color.Red);
}
// Draw axis: left joystick
- DrawCircle(259, 152, 39, Color.BLACK);
- DrawCircle(259, 152, 34, Color.LIGHTGRAY);
+ DrawCircle(259, 152, 39, Color.Black);
+ DrawCircle(259, 152, 34, Color.LightGray);
DrawCircle(
- 259 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_X) * 20),
- 152 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_Y) * 20),
+ 259 + (int)(GetGamepadAxisMovement(0, GamepadAxis.LeftX) * 20),
+ 152 + (int)(GetGamepadAxisMovement(0, GamepadAxis.LeftY) * 20),
25,
- Color.BLACK
+ Color.Black
);
// Draw axis: right joystick
- DrawCircle(461, 237, 38, Color.BLACK);
- DrawCircle(461, 237, 33, Color.LIGHTGRAY);
+ DrawCircle(461, 237, 38, Color.Black);
+ DrawCircle(461, 237, 33, Color.LightGray);
DrawCircle(
- 461 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_X) * 20),
- 237 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_Y) * 20),
- 25, Color.BLACK
+ 461 + (int)(GetGamepadAxisMovement(0, GamepadAxis.RightX) * 20),
+ 237 + (int)(GetGamepadAxisMovement(0, GamepadAxis.RightY) * 20),
+ 25, Color.Black
);
// Draw axis: left-right triggers
- float leftTriggerX = GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_TRIGGER);
- float rightTriggerX = GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_TRIGGER);
- DrawRectangle(170, 30, 15, 70, Color.GRAY);
- DrawRectangle(604, 30, 15, 70, Color.GRAY);
- DrawRectangle(170, 30, 15, (int)(((1.0f + leftTriggerX) / 2.0f) * 70), Color.RED);
- DrawRectangle(604, 30, 15, (int)(((1.0f + rightTriggerX) / 2.0f) * 70), Color.RED);
+ float leftTriggerX = GetGamepadAxisMovement(0, GamepadAxis.LeftTrigger);
+ float rightTriggerX = GetGamepadAxisMovement(0, GamepadAxis.RightTrigger);
+ DrawRectangle(170, 30, 15, 70, Color.Gray);
+ DrawRectangle(604, 30, 15, 70, Color.Gray);
+ DrawRectangle(170, 30, 15, (int)(((1.0f + leftTriggerX) / 2.0f) * 70), Color.Red);
+ DrawRectangle(604, 30, 15, (int)(((1.0f + rightTriggerX) / 2.0f) * 70), Color.Red);
}
else if (gamepadName == PS3_NAME_ID)
{
- DrawTexture(texPs3Pad, 0, 0, Color.DARKGRAY);
+ DrawTexture(texPs3Pad, 0, 0, Color.DarkGray);
// Draw buttons: ps
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE))
+ if (IsGamepadButtonDown(0, GamepadButton.Middle))
{
- DrawCircle(396, 222, 13, Color.RED);
+ DrawCircle(396, 222, 13, Color.Red);
}
// Draw buttons: basic
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.MiddleLeft))
{
- DrawRectangle(328, 170, 32, 13, Color.RED);
+ DrawRectangle(328, 170, 32, 13, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_MIDDLE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.MiddleRight))
{
DrawTriangle(
new Vector2(436, 168),
new Vector2(436, 185),
new Vector2(464, 177),
- Color.RED
+ Color.Red
);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_UP))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceUp))
{
- DrawCircle(557, 144, 13, Color.LIME);
+ DrawCircle(557, 144, 13, Color.Lime);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceRight))
{
- DrawCircle(586, 173, 13, Color.RED);
+ DrawCircle(586, 173, 13, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_DOWN))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceDown))
{
- DrawCircle(557, 203, 13, Color.VIOLET);
+ DrawCircle(557, 203, 13, Color.Violet);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_FACE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.RightFaceLeft))
{
- DrawCircle(527, 173, 13, Color.PINK);
+ DrawCircle(527, 173, 13, Color.Pink);
}
// Draw buttons: d-pad
- DrawRectangle(225, 132, 24, 84, Color.BLACK);
- DrawRectangle(195, 161, 84, 25, Color.BLACK);
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_UP))
+ DrawRectangle(225, 132, 24, 84, Color.Black);
+ DrawRectangle(195, 161, 84, 25, Color.Black);
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceUp))
{
- DrawRectangle(225, 132, 24, 29, Color.RED);
+ DrawRectangle(225, 132, 24, 29, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_DOWN))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceDown))
{
- DrawRectangle(225, 132 + 54, 24, 30, Color.RED);
+ DrawRectangle(225, 132 + 54, 24, 30, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_LEFT))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceLeft))
{
- DrawRectangle(195, 161, 30, 25, Color.RED);
+ DrawRectangle(195, 161, 30, 25, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_FACE_RIGHT))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftFaceRight))
{
- DrawRectangle(195 + 54, 161, 30, 25, Color.RED);
+ DrawRectangle(195 + 54, 161, 30, 25, Color.Red);
}
// Draw buttons: left-right back buttons
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_LEFT_TRIGGER_1))
+ if (IsGamepadButtonDown(0, GamepadButton.LeftTrigger1))
{
- DrawCircle(239, 82, 20, Color.RED);
+ DrawCircle(239, 82, 20, Color.Red);
}
- if (IsGamepadButtonDown(0, GamepadButton.GAMEPAD_BUTTON_RIGHT_TRIGGER_1))
+ if (IsGamepadButtonDown(0, GamepadButton.RightTrigger1))
{
- DrawCircle(557, 82, 20, Color.RED);
+ DrawCircle(557, 82, 20, Color.Red);
}
// Draw axis: left joystick
- DrawCircle(319, 255, 35, Color.BLACK);
- DrawCircle(319, 255, 31, Color.LIGHTGRAY);
+ DrawCircle(319, 255, 35, Color.Black);
+ DrawCircle(319, 255, 31, Color.LightGray);
DrawCircle(
- 319 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_X) * 20),
- 255 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_Y) * 20),
+ 319 + (int)(GetGamepadAxisMovement(0, GamepadAxis.LeftX) * 20),
+ 255 + (int)(GetGamepadAxisMovement(0, GamepadAxis.LeftY) * 20),
25,
- Color.BLACK
+ Color.Black
);
// Draw axis: right joystick
- DrawCircle(475, 255, 35, Color.BLACK);
- DrawCircle(475, 255, 31, Color.LIGHTGRAY);
+ DrawCircle(475, 255, 35, Color.Black);
+ DrawCircle(475, 255, 31, Color.LightGray);
DrawCircle(
- 475 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_X) * 20),
- 255 + (int)(GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_Y) * 20),
+ 475 + (int)(GetGamepadAxisMovement(0, GamepadAxis.RightX) * 20),
+ 255 + (int)(GetGamepadAxisMovement(0, GamepadAxis.RightY) * 20),
25,
- Color.BLACK
+ Color.Black
);
// Draw axis: left-right triggers
- float leftTriggerX = GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_LEFT_TRIGGER);
- float rightTriggerX = GetGamepadAxisMovement(0, GamepadAxis.GAMEPAD_AXIS_RIGHT_TRIGGER);
- DrawRectangle(169, 48, 15, 70, Color.GRAY);
- DrawRectangle(611, 48, 15, 70, Color.GRAY);
- DrawRectangle(169, 48, 15, (int)(((1.0f - leftTriggerX) / 2.0f) * 70), Color.RED);
- DrawRectangle(611, 48, 15, (int)(((1.0f - rightTriggerX) / 2.0f) * 70), Color.RED);
+ float leftTriggerX = GetGamepadAxisMovement(0, GamepadAxis.LeftTrigger);
+ float rightTriggerX = GetGamepadAxisMovement(0, GamepadAxis.RightTrigger);
+ DrawRectangle(169, 48, 15, 70, Color.Gray);
+ DrawRectangle(611, 48, 15, 70, Color.Gray);
+ DrawRectangle(169, 48, 15, (int)(((1.0f - leftTriggerX) / 2.0f) * 70), Color.Red);
+ DrawRectangle(611, 48, 15, (int)(((1.0f - rightTriggerX) / 2.0f) * 70), Color.Red);
}
else
{
- DrawText("- GENERIC GAMEPAD -", 280, 180, 20, Color.GRAY);
+ DrawText("- GENERIC GAMEPAD -", 280, 180, 20, Color.Gray);
// TODO: Draw generic gamepad
}
- DrawText($"DETECTED AXIS [{GetGamepadAxisCount(0)}]:", 10, 50, 10, Color.MAROON);
+ DrawText($"DETECTED AXIS [{GetGamepadAxisCount(0)}]:", 10, 50, 10, Color.Maroon);
for (int i = 0; i < GetGamepadAxisCount(0); i++)
{
@@ -292,23 +292,23 @@ public class InputGamepad
20,
70 + 20 * i,
10,
- Color.DARKGRAY
+ Color.DarkGray
);
}
- if (GetGamepadButtonPressed() != (int)GamepadButton.GAMEPAD_BUTTON_UNKNOWN)
+ if (GetGamepadButtonPressed() != (int)GamepadButton.Unknown)
{
- DrawText($"DETECTED BUTTON: {GetGamepadButtonPressed()}", 10, 430, 10, Color.RED);
+ DrawText($"DETECTED BUTTON: {GetGamepadButtonPressed()}", 10, 430, 10, Color.Red);
}
else
{
- DrawText("DETECTED BUTTON: NONE", 10, 430, 10, Color.GRAY);
+ DrawText("DETECTED BUTTON: NONE", 10, 430, 10, Color.Gray);
}
}
else
{
- DrawText("GP1: NOT DETECTED", 10, 10, 10, Color.GRAY);
- DrawTexture(texXboxPad, 0, 0, Color.LIGHTGRAY);
+ DrawText("GP1: NOT DETECTED", 10, 10, 10, Color.Gray);
+ DrawTexture(texXboxPad, 0, 0, Color.LightGray);
}
EndDrawing();
diff --git a/Examples/Core/InputGestures.cs b/Examples/Core/InputGestures.cs
index a8a6c88..8367e9e 100644
--- a/Examples/Core/InputGestures.cs
+++ b/Examples/Core/InputGestures.cs
@@ -33,8 +33,8 @@ public class InputGestures
int gesturesCount = 0;
string[] gestureStrings = new string[MaxGestureStrings];
- Gesture currentGesture = Gesture.GESTURE_NONE;
- Gesture lastGesture = Gesture.GESTURE_NONE;
+ Gesture currentGesture = Gesture.None;
+ Gesture lastGesture = Gesture.None;
// SetGesturesEnabled(0b0000000000001001); // Enable only some gestures to be detected
@@ -50,41 +50,41 @@ public class InputGestures
currentGesture = GetGestureDetected();
touchPosition = GetTouchPosition(0);
- if (CheckCollisionPointRec(touchPosition, touchArea) && (currentGesture != Gesture.GESTURE_NONE))
+ if (CheckCollisionPointRec(touchPosition, touchArea) && (currentGesture != Gesture.None))
{
if (currentGesture != lastGesture)
{
// Store gesture string
switch ((Gesture)currentGesture)
{
- case Gesture.GESTURE_TAP:
+ case Gesture.Tap:
gestureStrings[gesturesCount] = "GESTURE TAP";
break;
- case Gesture.GESTURE_DOUBLETAP:
+ case Gesture.DoubleTap:
gestureStrings[gesturesCount] = "GESTURE DOUBLETAP";
break;
- case Gesture.GESTURE_HOLD:
+ case Gesture.Hold:
gestureStrings[gesturesCount] = "GESTURE HOLD";
break;
- case Gesture.GESTURE_DRAG:
+ case Gesture.Drag:
gestureStrings[gesturesCount] = "GESTURE DRAG";
break;
- case Gesture.GESTURE_SWIPE_RIGHT:
+ case Gesture.SwipeRight:
gestureStrings[gesturesCount] = "GESTURE SWIPE RIGHT";
break;
- case Gesture.GESTURE_SWIPE_LEFT:
+ case Gesture.SwipeLeft:
gestureStrings[gesturesCount] = "GESTURE SWIPE LEFT";
break;
- case Gesture.GESTURE_SWIPE_UP:
+ case Gesture.SwipeUp:
gestureStrings[gesturesCount] = "GESTURE SWIPE UP";
break;
- case Gesture.GESTURE_SWIPE_DOWN:
+ case Gesture.SwipeDown:
gestureStrings[gesturesCount] = "GESTURE SWIPE DOWN";
break;
- case Gesture.GESTURE_PINCH_IN:
+ case Gesture.PinchIn:
gestureStrings[gesturesCount] = "GESTURE PINCH IN";
break;
- case Gesture.GESTURE_PINCH_OUT:
+ case Gesture.PinchOut:
gestureStrings[gesturesCount] = "GESTURE PINCH OUT";
break;
default:
@@ -109,40 +109,40 @@ public class InputGestures
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawRectangleRec(touchArea, Color.GRAY);
- DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, Color.RAYWHITE);
+ DrawRectangleRec(touchArea, Color.Gray);
+ DrawRectangle(225, 15, screenWidth - 240, screenHeight - 30, Color.RayWhite);
- DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, ColorAlpha(Color.GRAY, 0.5f));
+ DrawText("GESTURES TEST AREA", screenWidth - 270, screenHeight - 40, 20, ColorAlpha(Color.Gray, 0.5f));
for (int i = 0; i < gesturesCount; i++)
{
if (i % 2 == 0)
{
- DrawRectangle(10, 30 + 20 * i, 200, 20, ColorAlpha(Color.LIGHTGRAY, 0.5f));
+ DrawRectangle(10, 30 + 20 * i, 200, 20, ColorAlpha(Color.LightGray, 0.5f));
}
else
{
- DrawRectangle(10, 30 + 20 * i, 200, 20, ColorAlpha(Color.LIGHTGRAY, 0.3f));
+ DrawRectangle(10, 30 + 20 * i, 200, 20, ColorAlpha(Color.LightGray, 0.3f));
}
if (i < gesturesCount - 1)
{
- DrawText(gestureStrings[i], 35, 36 + 20 * i, 10, Color.DARKGRAY);
+ DrawText(gestureStrings[i], 35, 36 + 20 * i, 10, Color.DarkGray);
}
else
{
- DrawText(gestureStrings[i], 35, 36 + 20 * i, 10, Color.MAROON);
+ DrawText(gestureStrings[i], 35, 36 + 20 * i, 10, Color.Maroon);
}
}
- DrawRectangleLines(10, 29, 200, screenHeight - 50, Color.GRAY);
- DrawText("DETECTED GESTURES", 50, 15, 10, Color.GRAY);
+ DrawRectangleLines(10, 29, 200, screenHeight - 50, Color.Gray);
+ DrawText("DETECTED GESTURES", 50, 15, 10, Color.Gray);
- if (currentGesture != Gesture.GESTURE_NONE)
+ if (currentGesture != Gesture.None)
{
- DrawCircleV(touchPosition, 30, Color.MAROON);
+ DrawCircleV(touchPosition, 30, Color.Maroon);
}
EndDrawing();
diff --git a/Examples/Core/InputKeys.cs b/Examples/Core/InputKeys.cs
index a5b829e..252f09d 100644
--- a/Examples/Core/InputKeys.cs
+++ b/Examples/Core/InputKeys.cs
@@ -35,22 +35,22 @@ public class InputKeys
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
ballPosition.X += 2.0f;
}
- if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ if (IsKeyDown(KeyboardKey.Left))
{
ballPosition.X -= 2.0f;
}
- if (IsKeyDown(KeyboardKey.KEY_UP))
+ if (IsKeyDown(KeyboardKey.Up))
{
ballPosition.Y -= 2.0f;
}
- if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ if (IsKeyDown(KeyboardKey.Down))
{
ballPosition.Y += 2.0f;
}
@@ -59,11 +59,11 @@ public class InputKeys
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("move the ball with arrow keys", 10, 10, 20, Color.DARKGRAY);
+ DrawText("move the ball with arrow keys", 10, 10, 20, Color.DarkGray);
- DrawCircleV(ballPosition, 50, Color.MAROON);
+ DrawCircleV(ballPosition, 50, Color.Maroon);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/InputMouse.cs b/Examples/Core/InputMouse.cs
index a676e83..6d4ae15 100644
--- a/Examples/Core/InputMouse.cs
+++ b/Examples/Core/InputMouse.cs
@@ -26,7 +26,7 @@ public class InputMouse
InitWindow(screenWidth, screenHeight, "raylib [core] example - mouse input");
Vector2 ballPosition = new(-100.0f, -100.0f);
- Color ballColor = Color.DARKBLUE;
+ Color ballColor = Color.DarkBlue;
SetTargetFPS(60);
//---------------------------------------------------------------------------------------
@@ -38,28 +38,28 @@ public class InputMouse
//----------------------------------------------------------------------------------
ballPosition = GetMousePosition();
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
- ballColor = Color.MAROON;
+ ballColor = Color.Maroon;
}
- else if (IsMouseButtonPressed(MouseButton.MOUSE_MIDDLE_BUTTON))
+ else if (IsMouseButtonPressed(MouseButton.Middle))
{
- ballColor = Color.LIME;
+ ballColor = Color.Lime;
}
- else if (IsMouseButtonPressed(MouseButton.MOUSE_RIGHT_BUTTON))
+ else if (IsMouseButtonPressed(MouseButton.Right))
{
- ballColor = Color.DARKBLUE;
+ ballColor = Color.DarkBlue;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawCircleV(ballPosition, 40, ballColor);
- DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, Color.DARKGRAY);
+ DrawText("move ball with mouse and click mouse button to change color", 10, 10, 20, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/InputMouseWheel.cs b/Examples/Core/InputMouseWheel.cs
index f31fe9c..fe144ec 100644
--- a/Examples/Core/InputMouseWheel.cs
+++ b/Examples/Core/InputMouseWheel.cs
@@ -43,12 +43,12 @@ public class InputMouseWheel
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawRectangle(screenWidth / 2 - 40, boxPositionY, 80, 80, Color.MAROON);
+ DrawRectangle(screenWidth / 2 - 40, boxPositionY, 80, 80, Color.Maroon);
- DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, Color.GRAY);
- DrawText($"Box position Y: {boxPositionY}", 10, 40, 20, Color.LIGHTGRAY);
+ DrawText("Use mouse wheel to move the cube up and down!", 10, 10, 20, Color.Gray);
+ DrawText($"Box position Y: {boxPositionY}", 10, 40, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/InputMultitouch.cs b/Examples/Core/InputMultitouch.cs
index 446292f..1b62f76 100644
--- a/Examples/Core/InputMultitouch.cs
+++ b/Examples/Core/InputMultitouch.cs
@@ -57,7 +57,7 @@ public class InputMultitouch
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
for (int i = 0; i < tCount; i++)
{
@@ -65,17 +65,17 @@ public class InputMultitouch
if ((touchPositions[i].X > 0) && (touchPositions[i].Y > 0))
{
// Draw circle and touch index number
- DrawCircleV(touchPositions[i], 34, Color.ORANGE);
+ DrawCircleV(touchPositions[i], 34, Color.Orange);
DrawText(i.ToString(),
(int)touchPositions[i].X - 10,
(int)touchPositions[i].Y - 70,
40,
- Color.BLACK
+ Color.Black
);
}
}
- DrawText("touch the screen at multiple locations to get multiple balls", 10, 10, 20, Color.DARKGRAY);
+ DrawText("touch the screen at multiple locations to get multiple balls", 10, 10, 20, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/Picking3D.cs b/Examples/Core/Picking3D.cs
index 02470ff..afe8c10 100644
--- a/Examples/Core/Picking3D.cs
+++ b/Examples/Core/Picking3D.cs
@@ -31,7 +31,7 @@ public class Picking3d
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 cubePosition = new(0.0f, 1.0f, 0.0f);
Vector3 cubeSize = new(2.0f, 2.0f, 2.0f);
@@ -48,9 +48,9 @@ public class Picking3d
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
if (!collision.Hit)
{
@@ -75,34 +75,34 @@ public class Picking3d
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
if (collision.Hit)
{
- DrawCube(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.RED);
- DrawCubeWires(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.MAROON);
+ DrawCube(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.Red);
+ DrawCubeWires(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.Maroon);
- DrawCubeWires(cubePosition, cubeSize.X + 0.2f, cubeSize.Y + 0.2f, cubeSize.Z + 0.2f, Color.GREEN);
+ DrawCubeWires(cubePosition, cubeSize.X + 0.2f, cubeSize.Y + 0.2f, cubeSize.Z + 0.2f, Color.Green);
}
else
{
- DrawCube(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.GRAY);
- DrawCubeWires(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.DARKGRAY);
+ DrawCube(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.Gray);
+ DrawCubeWires(cubePosition, cubeSize.X, cubeSize.Y, cubeSize.Z, Color.DarkGray);
}
- DrawRay(ray, Color.MAROON);
+ DrawRay(ray, Color.Maroon);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawText("Try selecting the box with mouse!", 240, 10, 20, Color.DARKGRAY);
+ DrawText("Try selecting the box with mouse!", 240, 10, 20, Color.DarkGray);
if (collision.Hit)
{
int posX = (screenWidth - MeasureText("BOX SELECTED", 30)) / 2;
- DrawText("BOX SELECTED", posX, (int)(screenHeight * 0.1f), 30, Color.GREEN);
+ DrawText("BOX SELECTED", posX, (int)(screenHeight * 0.1f), 30, Color.Green);
}
DrawFPS(10, 10);
diff --git a/Examples/Core/RandomValues.cs b/Examples/Core/RandomValues.cs
index cd3aea2..234a8b5 100644
--- a/Examples/Core/RandomValues.cs
+++ b/Examples/Core/RandomValues.cs
@@ -51,11 +51,11 @@ public class RandomValues
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, Color.MAROON);
+ DrawText("Every 2 seconds a new random value is generated:", 130, 100, 20, Color.Maroon);
- DrawText($"{randValue}", 360, 180, 80, Color.LIGHTGRAY);
+ DrawText($"{randValue}", 360, 180, 80, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/ScissorTest.cs b/Examples/Core/ScissorTest.cs
index 3c05713..6a5074c 100644
--- a/Examples/Core/ScissorTest.cs
+++ b/Examples/Core/ScissorTest.cs
@@ -37,7 +37,7 @@ public class ScissorTest
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_S))
+ if (IsKeyPressed(KeyboardKey.S))
{
scissorMode = !scissorMode;
}
@@ -50,7 +50,7 @@ public class ScissorTest
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (scissorMode)
{
@@ -59,16 +59,16 @@ public class ScissorTest
// Draw full screen rectangle and some text
// NOTE: Only part defined by scissor area will be rendered
- DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.RED);
- DrawText("Move the mouse around to reveal this text!", 190, 200, 20, Color.LIGHTGRAY);
+ DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.Red);
+ DrawText("Move the mouse around to reveal this text!", 190, 200, 20, Color.LightGray);
if (scissorMode)
{
EndScissorMode();
}
- DrawRectangleLinesEx(scissorArea, 1, Color.BLACK);
- DrawText("Press S to toggle scissor test", 10, 10, 20, Color.BLACK);
+ DrawRectangleLinesEx(scissorArea, 1, Color.Black);
+ DrawText("Press S to toggle scissor test", 10, 10, 20, Color.Black);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/SmoothPixelperfect.cs b/Examples/Core/SmoothPixelperfect.cs
index 18e506c..80e5dae 100644
--- a/Examples/Core/SmoothPixelperfect.cs
+++ b/Examples/Core/SmoothPixelperfect.cs
@@ -100,25 +100,25 @@ public static class SmoothPixelPerfect
// Draw
//----------------------------------------------------------------------------------
BeginTextureMode(target);
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode2D(worldSpaceCamera);
- DrawRectanglePro(rec01, origin, rotation, Color.BLACK);
- DrawRectanglePro(rec02, origin, -rotation, Color.RED);
- DrawRectanglePro(rec03, origin, rotation + 45.0f, Color.BLUE);
+ DrawRectanglePro(rec01, origin, rotation, Color.Black);
+ DrawRectanglePro(rec02, origin, -rotation, Color.Red);
+ DrawRectanglePro(rec03, origin, rotation + 45.0f, Color.Blue);
EndMode2D();
EndTextureMode();
BeginDrawing();
- ClearBackground(Color.RED);
+ ClearBackground(Color.Red);
BeginMode2D(screenSpaceCamera);
- DrawTexturePro(target.Texture, sourceRec, destRec, origin, 0.0f, Color.WHITE);
+ DrawTexturePro(target.Texture, sourceRec, destRec, origin, 0.0f, Color.White);
EndMode2D();
- DrawText($"Screen resolution: {screenWidth}x{screenHeight}", 10, 10, 20, Color.DARKBLUE);
- DrawText($"World resolution: {virtualScreenWidth}x{virtualScreenHeight}", 10, 40, 20, Color.DARKGREEN);
+ DrawText($"Screen resolution: {screenWidth}x{screenHeight}", 10, 10, 20, Color.DarkBlue);
+ DrawText($"World resolution: {virtualScreenWidth}x{virtualScreenHeight}", 10, 40, 20, Color.DarkGreen);
DrawFPS(GetScreenWidth() - 95, 10);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Core/SplitScreen.cs b/Examples/Core/SplitScreen.cs
index d769300..c28c7b6 100644
--- a/Examples/Core/SplitScreen.cs
+++ b/Examples/Core/SplitScreen.cs
@@ -30,20 +30,20 @@ public unsafe class SplitScreen
// Grid of cube trees on a plane to make a "world"
// Simple world plane
- DrawPlane(new Vector3(0, 0, 0), new Vector2(50, 50), Color.BEIGE);
+ DrawPlane(new Vector3(0, 0, 0), new Vector2(50, 50), Color.Beige);
for (float x = -count * spacing; x <= count * spacing; x += spacing)
{
for (float z = -count * spacing; z <= count * spacing; z += spacing)
{
- DrawCube(new Vector3(x, 1.5f, z), 1, 1, 1, Color.LIME);
- DrawCube(new Vector3(x, 0.5f, z), 0.25f, 1, 0.25f, Color.BROWN);
+ DrawCube(new Vector3(x, 1.5f, z), 1, 1, 1, Color.Lime);
+ DrawCube(new Vector3(x, 0.5f, z), 0.25f, 1, 0.25f, Color.Brown);
}
}
// Draw a cube at each player's position
- DrawCube(CameraPlayer1.Position, 1, 1, 1, Color.RED);
- DrawCube(CameraPlayer2.Position, 1, 1, 1, Color.BLUE);
+ DrawCube(CameraPlayer1.Position, 1, 1, 1, Color.Red);
+ DrawCube(CameraPlayer2.Position, 1, 1, 1, Color.Blue);
}
public static int Main()
@@ -56,11 +56,11 @@ public unsafe class SplitScreen
InitWindow(screenWidth, screenHeight, "raylib [core] example - split screen");
// Generate a simple texture to use for trees
- Image img = GenImageChecked(256, 256, 32, 32, Color.DARKGRAY, Color.WHITE);
+ Image img = GenImageChecked(256, 256, 32, 32, Color.DarkGray, Color.White);
TextureGrid = LoadTextureFromImage(img);
UnloadImage(img);
- SetTextureFilter(TextureGrid, TextureFilter.TEXTURE_FILTER_ANISOTROPIC_16X);
- SetTextureWrap(TextureGrid, TextureWrap.TEXTURE_WRAP_CLAMP);
+ SetTextureFilter(TextureGrid, TextureFilter.Anisotropic16X);
+ SetTextureWrap(TextureGrid, TextureWrap.Clamp);
// Setup player 1 camera and screen
CameraPlayer1.FovY = 45.0f;
@@ -101,24 +101,24 @@ public unsafe class SplitScreen
float offsetThisFrame = 10.0f * GetFrameTime();
// Move Player1 forward and backwards (no turning)
- if (IsKeyDown(KeyboardKey.KEY_W))
+ if (IsKeyDown(KeyboardKey.W))
{
CameraPlayer1.Position.Z += offsetThisFrame;
CameraPlayer1.Target.Z += offsetThisFrame;
}
- else if (IsKeyDown(KeyboardKey.KEY_S))
+ else if (IsKeyDown(KeyboardKey.S))
{
CameraPlayer1.Position.Z -= offsetThisFrame;
CameraPlayer1.Target.Z -= offsetThisFrame;
}
// Move Player2 forward and backwards (no turning)
- if (IsKeyDown(KeyboardKey.KEY_UP))
+ if (IsKeyDown(KeyboardKey.Up))
{
CameraPlayer2.Position.X += offsetThisFrame;
CameraPlayer2.Target.X += offsetThisFrame;
}
- else if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ else if (IsKeyDown(KeyboardKey.Down))
{
CameraPlayer2.Position.X -= offsetThisFrame;
CameraPlayer2.Target.X -= offsetThisFrame;
@@ -129,32 +129,32 @@ public unsafe class SplitScreen
//----------------------------------------------------------------------------------
// Draw Player1 view to the render texture
BeginTextureMode(screenPlayer1);
- ClearBackground(Color.SKYBLUE);
+ ClearBackground(Color.SkyBlue);
BeginMode3D(CameraPlayer1);
DrawScene();
EndMode3D();
- DrawText("PLAYER 1 W/S to move", 10, 10, 20, Color.RED);
+ DrawText("PLAYER 1 W/S to move", 10, 10, 20, Color.Red);
EndTextureMode();
// Draw Player2 view to the render texture
BeginTextureMode(screenPlayer2);
- ClearBackground(Color.SKYBLUE);
+ ClearBackground(Color.SkyBlue);
BeginMode3D(CameraPlayer2);
DrawScene();
EndMode3D();
- DrawText("PLAYER 2 UP/DOWN to move", 10, 10, 20, Color.BLUE);
+ DrawText("PLAYER 2 UP/DOWN to move", 10, 10, 20, Color.Blue);
EndTextureMode();
// Draw both views render textures to the screen side by side
BeginDrawing();
- ClearBackground(Color.BLACK);
+ ClearBackground(Color.Black);
- DrawTextureRec(screenPlayer1.Texture, splitScreenRect, new Vector2(0, 0), Color.WHITE);
- DrawTextureRec(screenPlayer2.Texture, splitScreenRect, new Vector2(screenWidth / 2.0f, 0), Color.WHITE);
+ DrawTextureRec(screenPlayer1.Texture, splitScreenRect, new Vector2(0, 0), Color.White);
+ DrawTextureRec(screenPlayer2.Texture, splitScreenRect, new Vector2(screenWidth / 2.0f, 0), Color.White);
EndDrawing();
}
diff --git a/Examples/Core/StorageValues.cs b/Examples/Core/StorageValues.cs
index d1d2a24..554b01a 100644
--- a/Examples/Core/StorageValues.cs
+++ b/Examples/Core/StorageValues.cs
@@ -44,18 +44,18 @@ public class StorageValues
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
score = GetRandomValue(1000, 2000);
hiscore = GetRandomValue(2000, 4000);
}
- if (IsKeyPressed(KeyboardKey.KEY_ENTER))
+ if (IsKeyPressed(KeyboardKey.Enter))
{
SaveStorageValue(storageDataFile, (int)StorageData.Score, score);
SaveStorageValue(storageDataFile, (int)StorageData.HiScore, hiscore);
}
- else if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ else if (IsKeyPressed(KeyboardKey.Space))
{
// NOTE: If requested position could not be found, value 0 is returned
score = LoadStorageValue(storageDataFile, (int)StorageData.Score);
@@ -68,16 +68,16 @@ public class StorageValues
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText($"SCORE: {score}", 280, 130, 40, Color.MAROON);
- DrawText($"HI-SCORE: {hiscore}", 210, 200, 50, Color.BLACK);
+ DrawText($"SCORE: {score}", 280, 130, 40, Color.Maroon);
+ DrawText($"HI-SCORE: {hiscore}", 210, 200, 50, Color.Black);
- DrawText($"frames: {framesCounter}", 10, 10, 20, Color.LIME);
+ DrawText($"frames: {framesCounter}", 10, 10, 20, Color.Lime);
- DrawText("Press R to generate random numbers", 220, 40, 20, Color.LIGHTGRAY);
- DrawText("Press ENTER to SAVE values", 250, 310, 20, Color.LIGHTGRAY);
- DrawText("Press SPACE to LOAD values", 252, 350, 20, Color.LIGHTGRAY);
+ DrawText("Press R to generate random numbers", 220, 40, 20, Color.LightGray);
+ DrawText("Press ENTER to SAVE values", 250, 310, 20, Color.LightGray);
+ DrawText("Press SPACE to LOAD values", 252, 350, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -123,7 +123,7 @@ public class StorageValues
// RL_REALLOC failed
uint positionInBytes = position * sizeof(int);
TraceLog(
- TraceLogLevel.LOG_WARNING,
+ TraceLogLevel.Warning,
@$"FILEIO: [{fileName}] Failed to realloc data ({dataSize}),
position in bytes({positionInBytes}) bigger than actual file size"
);
@@ -147,11 +147,11 @@ public class StorageValues
success = SaveFileData(fileNameBuffer.AsPointer(), newFileData, newDataSize);
MemFree(newFileData);
- TraceLog(TraceLogLevel.LOG_INFO, $"FILEIO: [{fileName}] Saved storage value: {value}");
+ TraceLog(TraceLogLevel.Info, $"FILEIO: [{fileName}] Saved storage value: {value}");
}
else
{
- TraceLog(TraceLogLevel.LOG_INFO, $"FILEIO: [{fileName}] File created successfully");
+ TraceLog(TraceLogLevel.Info, $"FILEIO: [{fileName}] File created successfully");
dataSize = (position + 1) * sizeof(int);
fileData = (byte*)MemAlloc((int)dataSize);
@@ -161,7 +161,7 @@ public class StorageValues
success = SaveFileData(fileNameBuffer.AsPointer(), fileData, dataSize);
UnloadFileData(fileData);
- TraceLog(TraceLogLevel.LOG_INFO, $"FILEIO: [{fileName}] Saved storage value: {value}");
+ TraceLog(TraceLogLevel.Info, $"FILEIO: [{fileName}] Saved storage value: {value}");
}
return success;
@@ -182,7 +182,7 @@ public class StorageValues
if (dataSize < (position * 4))
{
TraceLog(
- TraceLogLevel.LOG_WARNING,
+ TraceLogLevel.Warning,
$"FILEIO: [{fileName}] Failed to find storage position: {value}"
);
}
@@ -194,7 +194,7 @@ public class StorageValues
UnloadFileData(fileData);
- TraceLog(TraceLogLevel.LOG_INFO, $"FILEIO: [{fileName}] Loaded storage value: {value}");
+ TraceLog(TraceLogLevel.Info, $"FILEIO: [{fileName}] Loaded storage value: {value}");
}
return value;
diff --git a/Examples/Core/VrSimulator.cs b/Examples/Core/VrSimulator.cs
index a46c4c9..3305588 100644
--- a/Examples/Core/VrSimulator.cs
+++ b/Examples/Core/VrSimulator.cs
@@ -24,7 +24,7 @@ public class VrSimulator
const int screenWidth = 1080;
const int screenHeight = 600;
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [core] example - vr simulator");
// VR device parameters definition
@@ -67,38 +67,38 @@ public class VrSimulator
distortion,
GetShaderLocation(distortion, "leftLensCenter"),
config.LeftLensCenter,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
distortion,
GetShaderLocation(distortion, "rightLensCenter"),
config.RightLensCenter,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
distortion,
GetShaderLocation(distortion, "leftScreenCenter"),
config.LeftScreenCenter,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
distortion,
GetShaderLocation(distortion, "rightScreenCenter"),
config.RightScreenCenter,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
distortion,
GetShaderLocation(distortion, "scale"),
config.Scale,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
distortion,
GetShaderLocation(distortion, "scaleIn"),
config.ScaleIn,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
unsafe
@@ -107,13 +107,13 @@ public class VrSimulator
distortion,
GetShaderLocation(distortion, "deviceWarpParam"),
device.LensDistortionValues,
- ShaderUniformDataType.SHADER_UNIFORM_VEC4
+ ShaderUniformDataType.Vec4
);
SetShaderValue(
distortion,
GetShaderLocation(distortion, "chromaAbParam"),
device.ChromaAbCorrection,
- ShaderUniformDataType.SHADER_UNIFORM_VEC4
+ ShaderUniformDataType.Vec4
);
}
@@ -127,7 +127,7 @@ public class VrSimulator
camera.Target = new Vector3(0.0f, 2.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 60.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 cubePosition = new(0.0f, 0.0f, 0.0f);
@@ -139,22 +139,22 @@ public class VrSimulator
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
+ UpdateCamera(ref camera, CameraMode.FirstPerson);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginTextureMode(target);
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginVrStereoMode(config);
BeginMode3D(camera);
- DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.RED);
- DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.MAROON);
+ DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.Red);
+ DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.Maroon);
DrawGrid(40, 1.0f);
EndMode3D();
@@ -166,7 +166,7 @@ public class VrSimulator
target.Texture,
new Rectangle(0, 0, (float)target.Texture.Width, (float)-target.Texture.Height),
new Vector2(0.0f, 0.0f),
- Color.WHITE
+ Color.White
);
EndShaderMode();
diff --git a/Examples/Core/WindowFlags.cs b/Examples/Core/WindowFlags.cs
index dbe5dc3..b963a17 100644
--- a/Examples/Core/WindowFlags.cs
+++ b/Examples/Core/WindowFlags.cs
@@ -42,7 +42,7 @@ public class WindowFlags
*/
// Set configuration flags for window creation
- SetConfigFlags(FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT);
+ SetConfigFlags(VSyncHint | Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [core] example - window flags");
Vector2 ballPosition = new(GetScreenWidth() / 2, GetScreenHeight() / 2);
@@ -57,59 +57,59 @@ public class WindowFlags
{
// Update
//-----------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_F))
+ if (IsKeyPressed(KeyboardKey.F))
{
// modifies window size when scaling!
ToggleFullscreen();
}
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
- if (IsWindowState(FLAG_WINDOW_RESIZABLE))
+ if (IsWindowState(ResizableWindow))
{
- ClearWindowState(FLAG_WINDOW_RESIZABLE);
+ ClearWindowState(ResizableWindow);
}
else
{
- SetWindowState(FLAG_WINDOW_RESIZABLE);
+ SetWindowState(ResizableWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_D))
+ if (IsKeyPressed(KeyboardKey.D))
{
- if (IsWindowState(FLAG_WINDOW_UNDECORATED))
+ if (IsWindowState(UndecoratedWindow))
{
- ClearWindowState(FLAG_WINDOW_UNDECORATED);
+ ClearWindowState(UndecoratedWindow);
}
else
{
- SetWindowState(FLAG_WINDOW_UNDECORATED);
+ SetWindowState(UndecoratedWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_H))
+ if (IsKeyPressed(KeyboardKey.H))
{
- if (!IsWindowState(FLAG_WINDOW_HIDDEN))
+ if (!IsWindowState(HiddenWindow))
{
- SetWindowState(FLAG_WINDOW_HIDDEN);
+ SetWindowState(HiddenWindow);
}
framesCounter = 0;
}
- if (IsWindowState(FLAG_WINDOW_HIDDEN))
+ if (IsWindowState(HiddenWindow))
{
framesCounter++;
if (framesCounter >= 240)
{
// Show window after 3 seconds
- ClearWindowState(FLAG_WINDOW_HIDDEN);
+ ClearWindowState(HiddenWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_N))
+ if (IsKeyPressed(KeyboardKey.N))
{
- if (!IsWindowState(FLAG_WINDOW_MINIMIZED))
+ if (!IsWindowState(MinimizedWindow))
{
MinimizeWindow();
}
@@ -117,7 +117,7 @@ public class WindowFlags
framesCounter = 0;
}
- if (IsWindowState(FLAG_WINDOW_MINIMIZED))
+ if (IsWindowState(MinimizedWindow))
{
framesCounter++;
if (framesCounter >= 240)
@@ -127,10 +127,10 @@ public class WindowFlags
}
}
- if (IsKeyPressed(KeyboardKey.KEY_M))
+ if (IsKeyPressed(KeyboardKey.M))
{
// NOTE: Requires FLAG_WINDOW_RESIZABLE enabled!
- if (IsWindowState(FLAG_WINDOW_MAXIMIZED))
+ if (IsWindowState(MaximizedWindow))
{
RestoreWindow();
}
@@ -140,51 +140,51 @@ public class WindowFlags
}
}
- if (IsKeyPressed(KeyboardKey.KEY_U))
+ if (IsKeyPressed(KeyboardKey.U))
{
- if (IsWindowState(FLAG_WINDOW_UNFOCUSED))
+ if (IsWindowState(UnfocusedWindow))
{
- ClearWindowState(FLAG_WINDOW_UNFOCUSED);
+ ClearWindowState(UnfocusedWindow);
}
else
{
- SetWindowState(FLAG_WINDOW_UNFOCUSED);
+ SetWindowState(UnfocusedWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_T))
+ if (IsKeyPressed(KeyboardKey.T))
{
- if (IsWindowState(FLAG_WINDOW_TOPMOST))
+ if (IsWindowState(TopmostWindow))
{
- ClearWindowState(FLAG_WINDOW_TOPMOST);
+ ClearWindowState(TopmostWindow);
}
else
{
- SetWindowState(FLAG_WINDOW_TOPMOST);
+ SetWindowState(TopmostWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_A))
+ if (IsKeyPressed(KeyboardKey.A))
{
- if (IsWindowState(FLAG_WINDOW_ALWAYS_RUN))
+ if (IsWindowState(AlwaysRunWindow))
{
- ClearWindowState(FLAG_WINDOW_ALWAYS_RUN);
+ ClearWindowState(AlwaysRunWindow);
}
else
{
- SetWindowState(FLAG_WINDOW_ALWAYS_RUN);
+ SetWindowState(AlwaysRunWindow);
}
}
- if (IsKeyPressed(KeyboardKey.KEY_V))
+ if (IsKeyPressed(KeyboardKey.V))
{
- if (IsWindowState(FLAG_VSYNC_HINT))
+ if (IsWindowState(VSyncHint))
{
- ClearWindowState(FLAG_VSYNC_HINT);
+ ClearWindowState(VSyncHint);
}
else
{
- SetWindowState(FLAG_VSYNC_HINT);
+ SetWindowState(VSyncHint);
}
}
@@ -205,46 +205,46 @@ public class WindowFlags
//-----------------------------------------------------
BeginDrawing();
- if (IsWindowState(FLAG_WINDOW_TRANSPARENT))
+ if (IsWindowState(TransparentWindow))
{
- ClearBackground(Color.BLANK);
+ ClearBackground(Color.Blank);
}
else
{
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
}
- DrawCircleV(ballPosition, ballRadius, Color.MAROON);
- DrawRectangleLinesEx(new Rectangle(0, 0, GetScreenWidth(), GetScreenHeight()), 4, Color.RAYWHITE);
+ DrawCircleV(ballPosition, ballRadius, Color.Maroon);
+ DrawRectangleLinesEx(new Rectangle(0, 0, GetScreenWidth(), GetScreenHeight()), 4, Color.RayWhite);
- DrawCircleV(GetMousePosition(), 10, Color.DARKBLUE);
+ DrawCircleV(GetMousePosition(), 10, Color.DarkBlue);
DrawFPS(10, 10);
- DrawText($"Screen Size: [{GetScreenWidth()}, {GetScreenHeight()}]", 10, 40, 10, Color.GREEN);
+ DrawText($"Screen Size: [{GetScreenWidth()}, {GetScreenHeight()}]", 10, 40, 10, Color.Green);
// Draw window state info
- Color on = Color.LIME;
- Color off = Color.MAROON;
+ Color on = Color.Lime;
+ Color off = Color.Maroon;
- DrawText("Following flags can be set after window creation:", 10, 60, 10, Color.GRAY);
+ DrawText("Following flags can be set after window creation:", 10, 60, 10, Color.Gray);
- DrawWindowState(FLAG_FULLSCREEN_MODE, "[F] FLAG_FULLSCREEN_MODE: ", 10, 80, 10);
- DrawWindowState(FLAG_WINDOW_RESIZABLE, "[R] FLAG_WINDOW_RESIZABLE: ", 10, 100, 10);
- DrawWindowState(FLAG_WINDOW_UNDECORATED, "[D] FLAG_WINDOW_UNDECORATED: ", 10, 120, 10);
- DrawWindowState(FLAG_WINDOW_HIDDEN, "[H] FLAG_WINDOW_HIDDEN: ", 10, 140, 10);
- DrawWindowState(FLAG_WINDOW_MINIMIZED, "[N] FLAG_WINDOW_MINIMIZED: ", 10, 160, 10);
- DrawWindowState(FLAG_WINDOW_MAXIMIZED, "[M] FLAG_WINDOW_MAXIMIZED: ", 10, 180, 10);
- DrawWindowState(FLAG_WINDOW_UNFOCUSED, "[G] FLAG_WINDOW_UNFOCUSED: ", 10, 200, 10);
- DrawWindowState(FLAG_WINDOW_TOPMOST, "[T] FLAG_WINDOW_TOPMOST: ", 10, 220, 10);
- DrawWindowState(FLAG_WINDOW_ALWAYS_RUN, "[A] FLAG_WINDOW_ALWAYS_RUN: ", 10, 240, 10);
- DrawWindowState(FLAG_VSYNC_HINT, "[V] FLAG_VSYNC_HINT: ", 10, 260, 10);
+ DrawWindowState(FullscreenMode, "[F] FLAG_FULLSCREEN_MODE: ", 10, 80, 10);
+ DrawWindowState(ResizableWindow, "[R] FLAG_WINDOW_RESIZABLE: ", 10, 100, 10);
+ DrawWindowState(UndecoratedWindow, "[D] FLAG_WINDOW_UNDECORATED: ", 10, 120, 10);
+ DrawWindowState(HiddenWindow, "[H] FLAG_WINDOW_HIDDEN: ", 10, 140, 10);
+ DrawWindowState(MinimizedWindow, "[N] FLAG_WINDOW_MINIMIZED: ", 10, 160, 10);
+ DrawWindowState(MaximizedWindow, "[M] FLAG_WINDOW_MAXIMIZED: ", 10, 180, 10);
+ DrawWindowState(UnfocusedWindow, "[G] FLAG_WINDOW_UNFOCUSED: ", 10, 200, 10);
+ DrawWindowState(TopmostWindow, "[T] FLAG_WINDOW_TOPMOST: ", 10, 220, 10);
+ DrawWindowState(AlwaysRunWindow, "[A] FLAG_WINDOW_ALWAYS_RUN: ", 10, 240, 10);
+ DrawWindowState(VSyncHint, "[V] FLAG_VSYNC_HINT: ", 10, 260, 10);
- DrawText("Following flags can only be set before window creation:", 10, 300, 10, Color.GRAY);
+ DrawText("Following flags can only be set before window creation:", 10, 300, 10, Color.Gray);
- DrawWindowState(FLAG_WINDOW_HIGHDPI, "[F] FLAG_WINDOW_HIGHDPI: ", 10, 320, 10);
- DrawWindowState(FLAG_WINDOW_TRANSPARENT, "[F] FLAG_WINDOW_TRANSPARENT: ", 10, 340, 10);
- DrawWindowState(FLAG_MSAA_4X_HINT, "[F] FLAG_MSAA_4X_HINT: ", 10, 360, 10);
+ DrawWindowState(HighDpiWindow, "[F] FLAG_WINDOW_HIGHDPI: ", 10, 320, 10);
+ DrawWindowState(TransparentWindow, "[F] FLAG_WINDOW_TRANSPARENT: ", 10, 340, 10);
+ DrawWindowState(Msaa4xHint, "[F] FLAG_MSAA_4X_HINT: ", 10, 360, 10);
EndDrawing();
//-----------------------------------------------------
@@ -260,8 +260,8 @@ public class WindowFlags
static void DrawWindowState(ConfigFlags flag, string text, int posX, int posY, int fontSize)
{
- Color onColor = Color.LIME;
- Color offColor = Color.MAROON;
+ Color onColor = Color.Lime;
+ Color offColor = Color.Maroon;
if (Raylib.IsWindowState(flag))
{
diff --git a/Examples/Core/WindowLetterbox.cs b/Examples/Core/WindowLetterbox.cs
index c4a063f..80b16f2 100644
--- a/Examples/Core/WindowLetterbox.cs
+++ b/Examples/Core/WindowLetterbox.cs
@@ -25,7 +25,7 @@ public class WindowLetterbox
const int windowHeight = 450;
// Enable config flags for resizable window and vertical synchro
- SetConfigFlags(ConfigFlags.FLAG_WINDOW_RESIZABLE | ConfigFlags.FLAG_VSYNC_HINT);
+ SetConfigFlags(ConfigFlags.ResizableWindow | ConfigFlags.VSyncHint);
InitWindow(windowWidth, windowHeight, "raylib [core] example - window scale letterbox");
SetWindowMinSize(320, 240);
@@ -34,7 +34,7 @@ public class WindowLetterbox
// Render texture initialization, used to hold the rendering result so we can easily resize it
RenderTexture2D target = LoadRenderTexture(gameScreenWidth, gameScreenHeight);
- SetTextureFilter(target.Texture, TextureFilter.TEXTURE_FILTER_BILINEAR);
+ SetTextureFilter(target.Texture, TextureFilter.Bilinear);
Color[] colors = new Color[10];
for (int i = 0; i < 10; i++)
@@ -56,7 +56,7 @@ public class WindowLetterbox
(float)GetScreenHeight() / gameScreenHeight
);
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
// Recalculate random colors for the bars
for (int i = 0; i < 10; i++)
@@ -83,11 +83,11 @@ public class WindowLetterbox
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.BLACK);
+ ClearBackground(Color.Black);
// Draw everything in the render texture, note this will not be rendered on screen, yet
BeginTextureMode(target);
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
for (int i = 0; i < 10; i++)
{
@@ -99,11 +99,11 @@ public class WindowLetterbox
10,
25,
20,
- Color.WHITE
+ Color.White
);
- DrawText($"Default Mouse: [{(int)mouse.X} {(int)mouse.Y}]", 350, 25, 20, Color.GREEN);
- DrawText($"Virtual Mouse: [{(int)virtualMouse.X}, {(int)virtualMouse.Y}]", 350, 55, 20, Color.YELLOW);
+ DrawText($"Default Mouse: [{(int)mouse.X} {(int)mouse.Y}]", 350, 25, 20, Color.Green);
+ DrawText($"Virtual Mouse: [{(int)virtualMouse.X}, {(int)virtualMouse.Y}]", 350, 55, 20, Color.Yellow);
EndTextureMode();
@@ -120,7 +120,7 @@ public class WindowLetterbox
(float)gameScreenWidth * scale,
(float)gameScreenHeight * scale
);
- DrawTexturePro(target.Texture, sourceRec, destRec, new Vector2(0, 0), 0.0f, Color.WHITE);
+ DrawTexturePro(target.Texture, sourceRec, destRec, new Vector2(0, 0), 0.0f, Color.White);
EndDrawing();
//--------------------------------------------------------------------------------------
diff --git a/Examples/Core/WorldScreen.cs b/Examples/Core/WorldScreen.cs
index 74be29b..72f9a20 100644
--- a/Examples/Core/WorldScreen.cs
+++ b/Examples/Core/WorldScreen.cs
@@ -31,7 +31,7 @@ public class WorldScreen
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 cubePosition = new(0.0f, 0.0f, 0.0f);
Vector2 cubeScreenPosition;
@@ -44,7 +44,7 @@ public class WorldScreen
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
// Calculate cube screen space position (with a little offset to be in top)
cubeScreenPosition = GetWorldToScreen(
@@ -56,12 +56,12 @@ public class WorldScreen
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.RED);
- DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.MAROON);
+ DrawCube(cubePosition, 2.0f, 2.0f, 2.0f, Color.Red);
+ DrawCubeWires(cubePosition, 2.0f, 2.0f, 2.0f, Color.Maroon);
DrawGrid(10, 1.0f);
@@ -72,14 +72,14 @@ public class WorldScreen
(int)cubeScreenPosition.X - MeasureText("Enemy: 100 / 100", 20) / 2,
(int)cubeScreenPosition.Y,
20,
- Color.BLACK
+ Color.Black
);
DrawText(
"Text is always on top of the cube",
(screenWidth - MeasureText("Text is always on top of the cube", 20)) / 2,
25,
20,
- Color.GRAY
+ Color.Gray
);
EndDrawing();
diff --git a/Examples/Models/AnimationDemo.cs b/Examples/Models/AnimationDemo.cs
index ff3be17..8ef9674 100644
--- a/Examples/Models/AnimationDemo.cs
+++ b/Examples/Models/AnimationDemo.cs
@@ -39,11 +39,11 @@ public class AnimationDemo
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Model model = LoadModel("resources/models/iqm/guy.iqm");
Texture2D texture = LoadTexture("resources/models/iqm/guytex.png");
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 position = new(0.0f, 0.0f, 0.0f);
// Load animation data
@@ -59,10 +59,10 @@ public class AnimationDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
// Play animation when spacebar is held down
- if (IsKeyDown(KeyboardKey.KEY_SPACE))
+ if (IsKeyDown(KeyboardKey.Space))
{
animFrameCounter++;
UpdateModelAnimation(model, anims[0], animFrameCounter);
@@ -76,7 +76,7 @@ public class AnimationDemo
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
@@ -86,21 +86,21 @@ public class AnimationDemo
new Vector3(1.0f, 0.0f, 0.0f),
-90.0f,
new Vector3(1.0f, 1.0f, 1.0f),
- Color.WHITE
+ Color.White
);
for (int i = 0; i < model.BoneCount; i++)
{
var framePoses = anims[0].FramePoses;
- DrawCube(framePoses[animFrameCounter][i].Translation, 0.2f, 0.2f, 0.2f, Color.RED);
+ DrawCube(framePoses[animFrameCounter][i].Translation, 0.2f, 0.2f, 0.2f, Color.Red);
}
DrawGrid(10, 1.0f);
EndMode3D();
- DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, Color.MAROON);
- DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawText("PRESS SPACE to PLAY MODEL ANIMATION", 10, 10, 20, Color.Maroon);
+ DrawText("(c) Guy IQM 3D model by @culacant", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Models/BillboardDemo.cs b/Examples/Models/BillboardDemo.cs
index d407e54..8b1359e 100644
--- a/Examples/Models/BillboardDemo.cs
+++ b/Examples/Models/BillboardDemo.cs
@@ -31,7 +31,7 @@ public class BillboardDemo
camera.Target = new Vector3(0.0f, 2.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Our texture billboard
Texture2D bill = LoadTexture("resources/billboard.png");
@@ -66,7 +66,7 @@ public class BillboardDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
rotation += 0.4f;
distanceStatic = Vector3.Distance(camera.Position, billPositionStatic);
distanceRotating = Vector3.Distance(camera.Position, billPositionRotating);
@@ -75,7 +75,7 @@ public class BillboardDemo
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
@@ -84,7 +84,7 @@ public class BillboardDemo
// Draw order matters!
if (distanceStatic > distanceRotating)
{
- DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.WHITE);
+ DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.White);
DrawBillboardPro(
camera,
bill,
@@ -94,7 +94,7 @@ public class BillboardDemo
new Vector2(1.0f, 1.0f),
rotateOrigin,
rotation,
- Color.WHITE
+ Color.White
);
}
else
@@ -108,9 +108,9 @@ public class BillboardDemo
new Vector2(1.0f, 1.0f),
rotateOrigin,
rotation,
- Color.WHITE
+ Color.White
);
- DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.WHITE);
+ DrawBillboard(camera, bill, billPositionStatic, 2.0f, Color.White);
}
EndMode3D();
diff --git a/Examples/Models/BoxCollisions.cs b/Examples/Models/BoxCollisions.cs
index 18e93a1..6d4436c 100644
--- a/Examples/Models/BoxCollisions.cs
+++ b/Examples/Models/BoxCollisions.cs
@@ -31,11 +31,11 @@ public class BoxCollisions
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Vector3 playerPosition = new(0.0f, 1.0f, 2.0f);
Vector3 playerSize = new(1.0f, 2.0f, 1.0f);
- Color playerColor = Color.GREEN;
+ Color playerColor = Color.Green;
Vector3 enemyBoxPos = new(-4.0f, 1.0f, 0.0f);
Vector3 enemyBoxSize = new(2.0f, 2.0f, 2.0f);
@@ -55,19 +55,19 @@ public class BoxCollisions
//----------------------------------------------------------------------------------
// Move player
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
playerPosition.X += 0.2f;
}
- else if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ else if (IsKeyDown(KeyboardKey.Left))
{
playerPosition.X -= 0.2f;
}
- else if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ else if (IsKeyDown(KeyboardKey.Down))
{
playerPosition.Z += 0.2f;
}
- else if (IsKeyDown(KeyboardKey.KEY_UP))
+ else if (IsKeyDown(KeyboardKey.Up))
{
playerPosition.Z -= 0.2f;
}
@@ -97,28 +97,28 @@ public class BoxCollisions
if (collision)
{
- playerColor = Color.RED;
+ playerColor = Color.Red;
}
else
{
- playerColor = Color.GREEN;
+ playerColor = Color.Green;
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
// Draw enemy-box
- DrawCube(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.GRAY);
- DrawCubeWires(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.DARKGRAY);
+ DrawCube(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.Gray);
+ DrawCubeWires(enemyBoxPos, enemyBoxSize.X, enemyBoxSize.Y, enemyBoxSize.Z, Color.DarkGray);
// Draw enemy-sphere
- DrawSphere(enemySpherePos, enemySphereSize, Color.GRAY);
- DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, Color.DARKGRAY);
+ DrawSphere(enemySpherePos, enemySphereSize, Color.Gray);
+ DrawSphereWires(enemySpherePos, enemySphereSize, 16, 16, Color.DarkGray);
// Draw player
DrawCubeV(playerPosition, playerSize, playerColor);
@@ -127,7 +127,7 @@ public class BoxCollisions
EndMode3D();
- DrawText("Move player with cursors to collide", 220, 40, 20, Color.GRAY);
+ DrawText("Move player with cursors to collide", 220, 40, 20, Color.Gray);
DrawFPS(10, 10);
EndDrawing();
diff --git a/Examples/Models/CubicmapDemo.cs b/Examples/Models/CubicmapDemo.cs
index 3bdbb92..1ddaefd 100644
--- a/Examples/Models/CubicmapDemo.cs
+++ b/Examples/Models/CubicmapDemo.cs
@@ -31,7 +31,7 @@ public class CubicmapDemo
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Image image = LoadImage("resources/cubicmap.png");
Texture2D cubicmap = LoadTextureFromImage(image);
@@ -43,7 +43,7 @@ public class CubicmapDemo
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
// Set map diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 mapPosition = new(-16.0f, 0.0f, -8.0f);
UnloadImage(image);
@@ -56,32 +56,32 @@ public class CubicmapDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, mapPosition, 1.0f, Color.WHITE);
+ DrawModel(model, mapPosition, 1.0f, Color.White);
EndMode3D();
Vector2 position = new(screenWidth - cubicmap.Width * 4 - 20, 20);
- DrawTextureEx(cubicmap, position, 0.0f, 4.0f, Color.WHITE);
+ DrawTextureEx(cubicmap, position, 0.0f, 4.0f, Color.White);
DrawRectangleLines(
screenWidth - cubicmap.Width * 4 - 20,
20,
cubicmap.Width * 4,
cubicmap.Height * 4,
- Color.GREEN
+ Color.Green
);
- DrawText("cubicmap image used to", 658, 90, 10, Color.GRAY);
- DrawText("generate map 3d model", 658, 104, 10, Color.GRAY);
+ DrawText("cubicmap image used to", 658, 90, 10, Color.Gray);
+ DrawText("generate map 3d model", 658, 104, 10, Color.Gray);
DrawFPS(10, 10);
diff --git a/Examples/Models/FirstPersonMaze.cs b/Examples/Models/FirstPersonMaze.cs
index d3dc609..1582b58 100644
--- a/Examples/Models/FirstPersonMaze.cs
+++ b/Examples/Models/FirstPersonMaze.cs
@@ -31,7 +31,7 @@ public class FirstPersonMaze
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Image imMap = LoadImage("resources/cubicmap.png");
Texture2D cubicmap = LoadTextureFromImage(imMap);
@@ -42,7 +42,7 @@ public class FirstPersonMaze
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
// Set map diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
// Get map image data to be used for collision detection
Color* mapPixels = LoadImageColors(imMap);
@@ -61,7 +61,7 @@ public class FirstPersonMaze
//----------------------------------------------------------------------------------
Vector3 oldCamPos = camera.Position;
- UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
+ UpdateCamera(ref camera, CameraMode.FirstPerson);
// Check player collision (we simplify to 2D collision detection)
Vector2 playerPos = new(camera.Position.X, camera.Position.Z);
@@ -120,18 +120,18 @@ public class FirstPersonMaze
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw maze map
BeginMode3D(camera);
- DrawModel(model, mapPosition, 1.0f, Color.WHITE);
+ DrawModel(model, mapPosition, 1.0f, Color.White);
EndMode3D();
- DrawTextureEx(cubicmap, new Vector2(GetScreenWidth() - cubicmap.Width * 4 - 20, 20), 0.0f, 4.0f, Color.WHITE);
- DrawRectangleLines(GetScreenWidth() - cubicmap.Width * 4 - 20, 20, cubicmap.Width * 4, cubicmap.Height * 4, Color.GREEN);
+ DrawTextureEx(cubicmap, new Vector2(GetScreenWidth() - cubicmap.Width * 4 - 20, 20), 0.0f, 4.0f, Color.White);
+ DrawRectangleLines(GetScreenWidth() - cubicmap.Width * 4 - 20, 20, cubicmap.Width * 4, cubicmap.Height * 4, Color.Green);
// Draw player position radar
- DrawRectangle(GetScreenWidth() - cubicmap.Width * 4 - 20 + playerCellX * 4, 20 + playerCellY * 4, 4, 4, Color.RED);
+ DrawRectangle(GetScreenWidth() - cubicmap.Width * 4 - 20 + playerCellX * 4, 20 + playerCellY * 4, 4, 4, Color.Red);
DrawFPS(10, 10);
diff --git a/Examples/Models/GeometricShapes.cs b/Examples/Models/GeometricShapes.cs
index 01e5916..3a59c59 100644
--- a/Examples/Models/GeometricShapes.cs
+++ b/Examples/Models/GeometricShapes.cs
@@ -31,7 +31,7 @@ public class GeometricShapes
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -47,23 +47,23 @@ public class GeometricShapes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.RED);
- DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.GOLD);
- DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.MAROON);
+ DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Red);
+ DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Gold);
+ DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.Maroon);
- DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.GREEN);
- DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.LIME);
+ DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.Green);
+ DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.Lime);
- DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SKYBLUE);
- DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DARKBLUE);
- DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.BROWN);
+ DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SkyBlue);
+ DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DarkBlue);
+ DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.Brown);
- DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.GOLD);
- DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.PINK);
+ DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Gold);
+ DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Pink);
DrawGrid(10, 1.0f);
diff --git a/Examples/Models/HeightmapDemo.cs b/Examples/Models/HeightmapDemo.cs
index a63bb81..d0471f5 100644
--- a/Examples/Models/HeightmapDemo.cs
+++ b/Examples/Models/HeightmapDemo.cs
@@ -31,7 +31,7 @@ public class HeightmapDemo
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Image image = LoadImage("resources/heightmap.png");
Texture2D texture = LoadTextureFromImage(image);
@@ -40,7 +40,7 @@ public class HeightmapDemo
Model model = LoadModelFromMesh(mesh);
// Set map diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 mapPosition = new(-8.0f, 0.0f, -8.0f);
@@ -54,24 +54,24 @@ public class HeightmapDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, mapPosition, 1.0f, Color.RED);
+ DrawModel(model, mapPosition, 1.0f, Color.Red);
DrawGrid(20, 1.0f);
EndMode3D();
- DrawTexture(texture, screenWidth - texture.Width - 20, 20, Color.WHITE);
- DrawRectangleLines(screenWidth - texture.Width - 20, 20, texture.Width, texture.Height, Color.GREEN);
+ DrawTexture(texture, screenWidth - texture.Width - 20, 20, Color.White);
+ DrawRectangleLines(screenWidth - texture.Width - 20, 20, texture.Width, texture.Height, Color.Green);
DrawFPS(10, 10);
diff --git a/Examples/Models/MeshDemo.cs b/Examples/Models/MeshDemo.cs
index 922327e..9f2be23 100644
--- a/Examples/Models/MeshDemo.cs
+++ b/Examples/Models/MeshDemo.cs
@@ -20,7 +20,7 @@ public class MeshDemo
camera.Target = Vector3.Zero;
camera.Up = Vector3.UnitY;
camera.FovY = 60.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Generate a mesh using utils to allocate/access mesh attribute data
Mesh tetrahedron = new(4, 4);
@@ -44,10 +44,10 @@ public class MeshDemo
texcoords[2] = Vector2.UnitY;
texcoords[3] = Vector2.One;
- colors[0] = Color.PINK;
- colors[1] = Color.LIME;
- colors[2] = Color.SKYBLUE;
- colors[3] = Color.VIOLET;
+ colors[0] = Color.Pink;
+ colors[1] = Color.Lime;
+ colors[2] = Color.SkyBlue;
+ colors[3] = Color.Violet;
indices[0] = 2;
indices[1] = 1;
@@ -76,7 +76,7 @@ public class MeshDemo
Texture2D texture = Raylib.LoadTextureFromImage(image);
Raylib.UnloadImage(image);
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_DIFFUSE, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Diffuse, ref texture);
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -86,17 +86,17 @@ public class MeshDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
rotationAngle = Raymath.Wrap(rotationAngle += 1f, 0f, 360f);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- Raylib.DrawModelEx(model, Vector3.Zero, Vector3.UnitX, rotationAngle, Vector3.One, Color.WHITE);
+ Raylib.DrawModelEx(model, Vector3.Zero, Vector3.UnitX, rotationAngle, Vector3.One, Color.White);
EndMode3D();
EndDrawing();
diff --git a/Examples/Models/MeshGeneration.cs b/Examples/Models/MeshGeneration.cs
index f6943e0..e4b27c4 100644
--- a/Examples/Models/MeshGeneration.cs
+++ b/Examples/Models/MeshGeneration.cs
@@ -26,7 +26,7 @@ public class MeshGeneration
InitWindow(screenWidth, screenHeight, "raylib [models] example - mesh generation");
// We generate a isChecked image for texturing
- Image isChecked = GenImageChecked(2, 2, 1, 1, Color.RED, Color.GREEN);
+ Image isChecked = GenImageChecked(2, 2, 1, 1, Color.Red, Color.Green);
Texture2D texture = LoadTextureFromImage(isChecked);
UnloadImage(isChecked);
@@ -46,7 +46,7 @@ public class MeshGeneration
for (int i = 0; i < models.Length; i++)
{
// Set map diffuse texture
- Raylib.SetMaterialTexture(ref models[i], 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref models[i], 0, MaterialMapIndex.Albedo, ref texture);
}
// Define the camera to look into our 3d world
@@ -55,7 +55,7 @@ public class MeshGeneration
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Model drawing position
Vector3 position = new(0.0f, 0.0f, 0.0f);
@@ -70,9 +70,9 @@ public class MeshGeneration
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
// Cycle between the textures
currentModel = (currentModel + 1) % models.Length;
@@ -82,48 +82,48 @@ public class MeshGeneration
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(models[currentModel], position, 1.0f, Color.WHITE);
+ DrawModel(models[currentModel], position, 1.0f, Color.White);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawRectangle(30, 400, 310, 30, ColorAlpha(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(30, 400, 310, 30, ColorAlpha(Color.DARKBLUE, 0.5f));
- DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, Color.BLUE);
+ DrawRectangle(30, 400, 310, 30, ColorAlpha(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(30, 400, 310, 30, ColorAlpha(Color.DarkBlue, 0.5f));
+ DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL MODELS", 40, 410, 10, Color.Blue);
switch (currentModel)
{
case 0:
- DrawText("PLANE", 680, 10, 20, Color.DARKBLUE);
+ DrawText("PLANE", 680, 10, 20, Color.DarkBlue);
break;
case 1:
- DrawText("CUBE", 680, 10, 20, Color.DARKBLUE);
+ DrawText("CUBE", 680, 10, 20, Color.DarkBlue);
break;
case 2:
- DrawText("SPHERE", 680, 10, 20, Color.DARKBLUE);
+ DrawText("SPHERE", 680, 10, 20, Color.DarkBlue);
break;
case 3:
- DrawText("HEMISPHERE", 640, 10, 20, Color.DARKBLUE);
+ DrawText("HEMISPHERE", 640, 10, 20, Color.DarkBlue);
break;
case 4:
- DrawText("CYLINDER", 680, 10, 20, Color.DARKBLUE);
+ DrawText("CYLINDER", 680, 10, 20, Color.DarkBlue);
break;
case 5:
- DrawText("TORUS", 680, 10, 20, Color.DARKBLUE);
+ DrawText("TORUS", 680, 10, 20, Color.DarkBlue);
break;
case 6:
- DrawText("KNOT", 680, 10, 20, Color.DARKBLUE);
+ DrawText("KNOT", 680, 10, 20, Color.DarkBlue);
break;
case 7:
- DrawText("POLY", 680, 10, 20, Color.DARKBLUE);
+ DrawText("POLY", 680, 10, 20, Color.DarkBlue);
break;
case 8:
- DrawText("Custom (triagnle)", 580, 10, 20, Color.DARKBLUE);
+ DrawText("Custom (triagnle)", 580, 10, 20, Color.DarkBlue);
break;
default:
break;
diff --git a/Examples/Models/MeshPicking.cs b/Examples/Models/MeshPicking.cs
index ff7c19b..c0e098a 100644
--- a/Examples/Models/MeshPicking.cs
+++ b/Examples/Models/MeshPicking.cs
@@ -33,14 +33,14 @@ public class MeshPicking
camera.Target = new Vector3(0.0f, 8.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.6f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Picking ray
Ray ray = new();
Model tower = LoadModel("resources/models/obj/turret.obj");
Texture2D texture = LoadTexture("resources/models/obj/turret_diffuse.png");
- Raylib.SetMaterialTexture(ref tower, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref tower, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 towerPos = new(0.0f, 0.0f, 0.0f);
BoundingBox towerBBox = GetMeshBoundingBox(tower.Meshes[0]);
@@ -75,11 +75,11 @@ public class MeshPicking
//----------------------------------------------------------------------------------
if (IsCursorHidden())
{
- UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
+ UpdateCamera(ref camera, CameraMode.FirstPerson);
}
// Toggle camera controls
- if (IsMouseButtonPressed(MouseButton.MOUSE_BUTTON_RIGHT))
+ if (IsMouseButtonPressed(MouseButton.Right))
{
if (IsCursorHidden())
{
@@ -96,7 +96,7 @@ public class MeshPicking
string hitObjectName = "None";
collision.Distance = float.MaxValue;
collision.Hit = false;
- Color cursorColor = Color.WHITE;
+ Color cursorColor = Color.White;
// Get ray and test against objects
ray = GetMouseRay(GetMousePosition(), camera);
@@ -106,7 +106,7 @@ public class MeshPicking
if (groundHitInfo.Hit && (groundHitInfo.Distance < collision.Distance))
{
collision = groundHitInfo;
- cursorColor = Color.GREEN;
+ cursorColor = Color.Green;
hitObjectName = "Ground";
}
@@ -115,7 +115,7 @@ public class MeshPicking
if (triHitInfo.Hit && (triHitInfo.Distance < collision.Distance))
{
collision = triHitInfo;
- cursorColor = Color.PURPLE;
+ cursorColor = Color.Purple;
hitObjectName = "Triangle";
bary = Vector3Barycenter(collision.Point, ta, tb, tc);
@@ -126,7 +126,7 @@ public class MeshPicking
if ((sphereHitInfo.Hit) && (sphereHitInfo.Distance < collision.Distance))
{
collision = sphereHitInfo;
- cursorColor = Color.ORANGE;
+ cursorColor = Color.Orange;
hitObjectName = "Sphere";
}
@@ -135,7 +135,7 @@ public class MeshPicking
if (boxHitInfo.Hit && boxHitInfo.Distance < collision.Distance)
{
collision = boxHitInfo;
- cursorColor = Color.ORANGE;
+ cursorColor = Color.Orange;
hitObjectName = "Box";
// Check ray collision against model meshes
@@ -160,7 +160,7 @@ public class MeshPicking
if (meshHitInfo.Hit)
{
collision = meshHitInfo;
- cursorColor = Color.ORANGE;
+ cursorColor = Color.Orange;
hitObjectName = "Mesh";
}
}
@@ -169,65 +169,65 @@ public class MeshPicking
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
// Draw the tower
- DrawModel(tower, towerPos, 1.0f, Color.WHITE);
+ DrawModel(tower, towerPos, 1.0f, Color.White);
// Draw the test triangle
- DrawLine3D(ta, tb, Color.PURPLE);
- DrawLine3D(tb, tc, Color.PURPLE);
- DrawLine3D(tc, ta, Color.PURPLE);
+ DrawLine3D(ta, tb, Color.Purple);
+ DrawLine3D(tb, tc, Color.Purple);
+ DrawLine3D(tc, ta, Color.Purple);
// Draw the test sphere
- DrawSphereWires(sp, sr, 8, 8, Color.PURPLE);
+ DrawSphereWires(sp, sr, 8, 8, Color.Purple);
// Draw the mesh bbox if we hit it
if (boxHitInfo.Hit)
{
- DrawBoundingBox(towerBBox, Color.LIME);
+ DrawBoundingBox(towerBBox, Color.Lime);
}
// If we hit something, draw the cursor at the hit point
if (collision.Hit)
{
DrawCube(collision.Point, 0.3f, 0.3f, 0.3f, cursorColor);
- DrawCubeWires(collision.Point, 0.3f, 0.3f, 0.3f, Color.RED);
+ DrawCubeWires(collision.Point, 0.3f, 0.3f, 0.3f, Color.Red);
Vector3 normalEnd = collision.Point + collision.Normal;
- DrawLine3D(collision.Point, normalEnd, Color.RED);
+ DrawLine3D(collision.Point, normalEnd, Color.Red);
}
- DrawRay(ray, Color.MAROON);
+ DrawRay(ray, Color.Maroon);
DrawGrid(10, 10.0f);
EndMode3D();
// Draw some debug GUI text
- DrawText($"Hit Object: {hitObjectName}", 10, 50, 10, Color.BLACK);
+ DrawText($"Hit Object: {hitObjectName}", 10, 50, 10, Color.Black);
if (collision.Hit)
{
int ypos = 70;
- DrawText($"Distance: {collision.Distance}", 10, ypos, 10, Color.BLACK);
+ DrawText($"Distance: {collision.Distance}", 10, ypos, 10, Color.Black);
- DrawText($"Hit Pos: {collision.Point}", 10, ypos + 15, 10, Color.BLACK);
+ DrawText($"Hit Pos: {collision.Point}", 10, ypos + 15, 10, Color.Black);
- DrawText($"Hit Norm: {collision.Normal}", 10, ypos + 30, 10, Color.BLACK);
+ DrawText($"Hit Norm: {collision.Normal}", 10, ypos + 30, 10, Color.Black);
if (triHitInfo.Hit)
{
- DrawText($"Barycenter: {bary}", 10, ypos + 45, 10, Color.BLACK);
+ DrawText($"Barycenter: {bary}", 10, ypos + 45, 10, Color.Black);
}
}
- DrawText("Right click mouse to toggle camera controls", 10, 430, 10, Color.GRAY);
+ DrawText("Right click mouse to toggle camera controls", 10, 430, 10, Color.Gray);
- DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawText("(c) Turret 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
DrawFPS(10, 10);
diff --git a/Examples/Models/ModelCubeTexture.cs b/Examples/Models/ModelCubeTexture.cs
index dd7265c..7af9219 100644
--- a/Examples/Models/ModelCubeTexture.cs
+++ b/Examples/Models/ModelCubeTexture.cs
@@ -33,7 +33,7 @@ public class ModelCubeTexture
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Load texture to be applied to the cubes sides
Texture2D texture = LoadTexture("resources/cubicmap_atlas.png");
@@ -51,12 +51,12 @@ public class ModelCubeTexture
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
// Draw cube with an applied texture
- DrawCubeTexture(texture, new Vector3(-2.0f, 2.0f, 0.0f), 2.0f, 4.0f, 2.0f, Color.WHITE);
+ DrawCubeTexture(texture, new Vector3(-2.0f, 2.0f, 0.0f), 2.0f, 4.0f, 2.0f, Color.White);
// Draw cube with an applied texture, but only a defined rectangle piece of the texture
DrawCubeTextureRec(
@@ -66,7 +66,7 @@ public class ModelCubeTexture
2.0f,
2.0f,
2.0f,
- Color.WHITE
+ Color.White
);
DrawGrid(10, 1.0f);
@@ -113,7 +113,7 @@ public class ModelCubeTexture
// Rlgl.Rotatef(45, 0, 1, 0);
// Rlgl.Scalef(2.0f, 2.0f, 2.0f);
- Rlgl.Begin(DrawMode.QUADS);
+ Rlgl.Begin(DrawMode.Quads);
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
// Front Face
@@ -239,7 +239,7 @@ public class ModelCubeTexture
// We calculate the normalized texture coordinates for the desired texture-source-rectangle
// It means converting from (tex.Width, tex.Height) coordinates to [0.0f, 1.0f] equivalent
- Rlgl.Begin(DrawMode.QUADS);
+ Rlgl.Begin(DrawMode.Quads);
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
// Front face
diff --git a/Examples/Models/ModelLoading.cs b/Examples/Models/ModelLoading.cs
index 4766669..51ffcba 100644
--- a/Examples/Models/ModelLoading.cs
+++ b/Examples/Models/ModelLoading.cs
@@ -40,13 +40,13 @@ public class ModelLoading
camera.Target = new Vector3(0.0f, 10.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Model model = LoadModel("resources/models/obj/castle.obj");
Texture2D texture = LoadTexture("resources/models/obj/castle_diffuse.png");
// Set map diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 position = new(0.0f, 0.0f, 0.0f);
BoundingBox bounds = GetMeshBoundingBox(model.Meshes[0]);
@@ -64,7 +64,7 @@ public class ModelLoading
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
if (IsFileDropped())
{
@@ -81,7 +81,7 @@ public class ModelLoading
model = LoadModel(files[0]);
// Set current map diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
bounds = GetMeshBoundingBox(model.Meshes[0]);
@@ -92,13 +92,13 @@ public class ModelLoading
// Unload model texture and load new one
UnloadTexture(texture);
texture = LoadTexture(files[0]);
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
}
}
}
// Select model on mouse click
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
// Check collision between ray and box
if (GetRayCollisionBox(GetMouseRay(GetMousePosition(), camera), bounds).Hit)
@@ -115,28 +115,28 @@ public class ModelLoading
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, position, 1.0f, Color.WHITE);
+ DrawModel(model, position, 1.0f, Color.White);
DrawGrid(20, 10.0f);
if (selected)
{
- DrawBoundingBox(bounds, Color.GREEN);
+ DrawBoundingBox(bounds, Color.Green);
}
EndMode3D();
- DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, Color.DARKGRAY);
+ DrawText("Drag & drop model to load mesh/texture.", 10, GetScreenHeight() - 20, 10, Color.DarkGray);
if (selected)
{
- DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, Color.GREEN);
+ DrawText("MODEL SELECTED", GetScreenWidth() - 110, 10, 10, Color.Green);
}
- DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawText("(c) Castle 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
DrawFPS(10, 10);
diff --git a/Examples/Models/OrthographicProjection.cs b/Examples/Models/OrthographicProjection.cs
index d11a4f2..bf9e302 100644
--- a/Examples/Models/OrthographicProjection.cs
+++ b/Examples/Models/OrthographicProjection.cs
@@ -36,7 +36,7 @@ public class OrthographicProjection
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = FOVY_PERSPECTIVE;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@@ -46,17 +46,17 @@ public class OrthographicProjection
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
- if (camera.Projection == CameraProjection.CAMERA_PERSPECTIVE)
+ if (camera.Projection == CameraProjection.Perspective)
{
camera.FovY = WIDTH_ORTHOGRAPHIC;
- camera.Projection = CameraProjection.CAMERA_ORTHOGRAPHIC;
+ camera.Projection = CameraProjection.Orthographic;
}
else
{
camera.FovY = FOVY_PERSPECTIVE;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
}
}
//----------------------------------------------------------------------------------
@@ -64,37 +64,37 @@ public class OrthographicProjection
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.RED);
- DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.GOLD);
- DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.MAROON);
+ DrawCube(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Red);
+ DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f), 2.0f, 5.0f, 2.0f, Color.Gold);
+ DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f), 3.0f, 6.0f, 2.0f, Color.Maroon);
- DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.GREEN);
- DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.LIME);
+ DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f), 1.0f, Color.Green);
+ DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f), 2.0f, 16, 16, Color.Lime);
- DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SKYBLUE);
- DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DARKBLUE);
- DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.BROWN);
+ DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.SkyBlue);
+ DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f), 1.0f, 2.0f, 3.0f, 4, Color.DarkBlue);
+ DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f), 1.0f, 1.0f, 2.0f, 6, Color.Brown);
- DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.GOLD);
- DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.PINK);
+ DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Gold);
+ DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f), 0.0f, 1.5f, 3.0f, 8, Color.Pink);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, Color.DARKGRAY);
+ DrawText("Press Spacebar to switch camera type", 10, GetScreenHeight() - 30, 20, Color.DarkGray);
- if (camera.Projection == CameraProjection.CAMERA_ORTHOGRAPHIC)
+ if (camera.Projection == CameraProjection.Orthographic)
{
- DrawText("ORTHOGRAPHIC", 10, 40, 20, Color.BLACK);
+ DrawText("ORTHOGRAPHIC", 10, 40, 20, Color.Black);
}
- else if (camera.Projection == CameraProjection.CAMERA_PERSPECTIVE)
+ else if (camera.Projection == CameraProjection.Perspective)
{
- DrawText("PERSPECTIVE", 10, 40, 20, Color.BLACK);
+ DrawText("PERSPECTIVE", 10, 40, 20, Color.Black);
}
DrawFPS(10, 10);
diff --git a/Examples/Models/SkyboxDemo.cs b/Examples/Models/SkyboxDemo.cs
index 2e4ba5a..974c9dd 100644
--- a/Examples/Models/SkyboxDemo.cs
+++ b/Examples/Models/SkyboxDemo.cs
@@ -31,7 +31,7 @@ public class SkyboxDemo
camera.Target = new Vector3(4.0f, 1.0f, 4.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Load skybox model
Mesh cube = GenMeshCube(1.0f, 1.0f, 1.0f);
@@ -46,22 +46,22 @@ public class SkyboxDemo
Raylib.SetShaderValue(
shdrSkybox,
GetShaderLocation(shdrSkybox, "environmentMap"),
- (int)MaterialMapIndex.MATERIAL_MAP_CUBEMAP,
- ShaderUniformDataType.SHADER_UNIFORM_INT
+ (int)MaterialMapIndex.Cubemap,
+ ShaderUniformDataType.Int
);
Raylib.SetShaderValue(
shdrSkybox,
GetShaderLocation(shdrSkybox, "doGamma"),
useHdr ? 1 : 0,
- ShaderUniformDataType.SHADER_UNIFORM_INT
+ ShaderUniformDataType.Int
);
Raylib.SetShaderValue(
shdrSkybox,
GetShaderLocation(shdrSkybox, "vflipped"),
useHdr ? 1 : 0,
- ShaderUniformDataType.SHADER_UNIFORM_INT
+ ShaderUniformDataType.Int
);
Raylib.SetMaterialShader(ref skybox, 0, ref shdrSkybox);
@@ -75,7 +75,7 @@ public class SkyboxDemo
shdrCubemap,
GetShaderLocation(shdrCubemap, "equirectangularMap"),
0,
- ShaderUniformDataType.SHADER_UNIFORM_INT
+ ShaderUniformDataType.Int
);
// Load skybox
@@ -90,16 +90,16 @@ public class SkyboxDemo
shdrCubemap,
panorama,
1024,
- PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
+ PixelFormat.UncompressedR8G8B8A8
);
- SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
+ SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
UnloadTexture(panorama);
}
else
{
Image img = LoadImage("resources/skybox.png");
- Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.CUBEMAP_LAYOUT_AUTO_DETECT);
- SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
+ Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.AutoDetect);
+ SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
UnloadImage(img);
}
@@ -113,7 +113,7 @@ public class SkyboxDemo
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FIRST_PERSON);
+ UpdateCamera(ref camera, CameraMode.FirstPerson);
// Load new cubemap texture on drag & drop
if (IsFileDropped())
@@ -125,7 +125,7 @@ public class SkyboxDemo
if (IsFileExtension(files[0], ".png;.jpg;.hdr;.bmp;.tga"))
{
// Unload cubemap texture and load new one
- UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP));
+ UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap));
if (useHdr)
{
@@ -134,16 +134,16 @@ public class SkyboxDemo
shdrCubemap,
panorama,
1024,
- PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8
+ PixelFormat.UncompressedR8G8B8A8
);
- SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
+ SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
UnloadTexture(panorama);
}
else
{
Image img = LoadImage(files[0]);
- Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.CUBEMAP_LAYOUT_AUTO_DETECT);
- SetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP, ref cubemap);
+ Texture2D cubemap = LoadTextureCubemap(img, CubemapLayout.AutoDetect);
+ SetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap, ref cubemap);
UnloadImage(img);
}
@@ -156,14 +156,14 @@ public class SkyboxDemo
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
// We are inside the cube, we need to disable backface culling!
Rlgl.DisableBackfaceCulling();
Rlgl.DisableDepthMask();
- DrawModel(skybox, Vector3.Zero, 1.0f, Color.WHITE);
+ DrawModel(skybox, Vector3.Zero, 1.0f, Color.White);
Rlgl.EnableBackfaceCulling();
Rlgl.EnableDepthMask();
@@ -178,12 +178,12 @@ public class SkyboxDemo
10,
GetScreenHeight() - 20,
10,
- Color.BLACK
+ Color.Black
);
}
else
{
- DrawText($": {skyboxFileName}", 10, GetScreenHeight() - 20, 10, Color.BLACK);
+ DrawText($": {skyboxFileName}", 10, GetScreenHeight() - 20, 10, Color.Black);
}
DrawFPS(10, 10);
@@ -195,7 +195,7 @@ public class SkyboxDemo
// De-Initialization
//--------------------------------------------------------------------------------------
UnloadShader(Raylib.GetMaterial(ref skybox, 0).Shader);
- UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.MATERIAL_MAP_CUBEMAP));
+ UnloadTexture(Raylib.GetMaterialTexture(ref skybox, 0, MaterialMapIndex.Cubemap));
UnloadModel(skybox);
@@ -222,15 +222,15 @@ public class SkyboxDemo
Rlgl.FramebufferAttach(
fbo,
rbo,
- FramebufferAttachType.RL_ATTACHMENT_DEPTH,
- FramebufferAttachTextureType.RL_ATTACHMENT_RENDERBUFFER,
+ FramebufferAttachType.Depth,
+ FramebufferAttachTextureType.Renderbuffer,
0
);
Rlgl.FramebufferAttach(
fbo,
cubemap.Id,
- FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
- FramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_X,
+ FramebufferAttachType.ColorChannel0,
+ FramebufferAttachTextureType.CubemapPositiveX,
0
);
@@ -253,7 +253,7 @@ public class SkyboxDemo
Rlgl.CULL_DISTANCE_NEAR,
Rlgl.CULL_DISTANCE_FAR
);
- Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_PROJECTION], matFboProjection);
+ Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.MatrixProjection], matFboProjection);
// Define view matrix for every side of the cubemap
Matrix4x4[] fboViews = new[]
@@ -276,15 +276,15 @@ public class SkyboxDemo
for (int i = 0; i < 6; i++)
{
// Set the view matrix for the current cube face
- Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_VIEW], fboViews[i]);
+ Rlgl.SetUniformMatrix(shader.Locs[(int)ShaderLocationIndex.MatrixView], fboViews[i]);
// Select the current cubemap face attachment for the fbo
// WARNING: This function by default enables->attach->disables fbo!!!
Rlgl.FramebufferAttach(
fbo,
cubemap.Id,
- FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
- FramebufferAttachTextureType.RL_ATTACHMENT_CUBEMAP_POSITIVE_X + i,
+ FramebufferAttachType.ColorChannel0,
+ FramebufferAttachTextureType.CubemapPositiveX + i,
0
);
Rlgl.EnableFramebuffer(fbo);
diff --git a/Examples/Models/SolarSystem.cs b/Examples/Models/SolarSystem.cs
index f0c1c9f..8b5c294 100644
--- a/Examples/Models/SolarSystem.cs
+++ b/Examples/Models/SolarSystem.cs
@@ -40,7 +40,7 @@ public class SolarSystem
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// General system rotation speed
float rotationSpeed = 0.2f;
@@ -61,7 +61,7 @@ public class SolarSystem
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
earthRotation += (5.0f * rotationSpeed);
earthOrbitRotation += (365 / 360.0f * (5.0f * rotationSpeed) * rotationSpeed);
@@ -72,7 +72,7 @@ public class SolarSystem
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
@@ -80,7 +80,7 @@ public class SolarSystem
// Scale Sun
Rlgl.Scalef(sunRadius, sunRadius, sunRadius);
// Draw the Sun
- DrawSphereBasic(Color.GOLD);
+ DrawSphereBasic(Color.Gold);
Rlgl.PopMatrix();
Rlgl.PushMatrix();
@@ -98,7 +98,7 @@ public class SolarSystem
Rlgl.Scalef(earthRadius, earthRadius, earthRadius);
// Draw the Earth
- DrawSphereBasic(Color.BLUE);
+ DrawSphereBasic(Color.Blue);
Rlgl.PopMatrix();
// Rotation for Moon orbit around Earth
@@ -113,7 +113,7 @@ public class SolarSystem
Rlgl.Scalef(moonRadius, moonRadius, moonRadius);
// Draw the Moon
- DrawSphereBasic(Color.LIGHTGRAY);
+ DrawSphereBasic(Color.LightGray);
Rlgl.PopMatrix();
// Some reference elements (not affected by previous matrix transformations)
@@ -122,13 +122,13 @@ public class SolarSystem
earthOrbitRadius,
new Vector3(1, 0, 0),
90.0f,
- ColorAlpha(Color.RED, 0.5f)
+ ColorAlpha(Color.Red, 0.5f)
);
DrawGrid(20, 1.0f);
EndMode3D();
- DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, Color.MAROON);
+ DrawText("EARTH ORBITING AROUND THE SUN!", 400, 10, 20, Color.Maroon);
DrawFPS(10, 10);
EndDrawing();
@@ -150,7 +150,7 @@ public class SolarSystem
int rings = 16;
int slices = 16;
- Rlgl.Begin(DrawMode.TRIANGLES);
+ Rlgl.Begin(DrawMode.Triangles);
Rlgl.Color4ub(color.R, color.G, color.B, color.A);
for (int i = 0; i < (rings + 2); i++)
diff --git a/Examples/Models/WavingCubes.cs b/Examples/Models/WavingCubes.cs
index 9aafd4a..27867d5 100644
--- a/Examples/Models/WavingCubes.cs
+++ b/Examples/Models/WavingCubes.cs
@@ -34,7 +34,7 @@ public class WavingCubes
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 70.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Specify the amount of blocks in each direction
const int numBlocks = 15;
@@ -61,7 +61,7 @@ public class WavingCubes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
diff --git a/Examples/Models/YawPitchRoll.cs b/Examples/Models/YawPitchRoll.cs
index f858ed1..85e8092 100644
--- a/Examples/Models/YawPitchRoll.cs
+++ b/Examples/Models/YawPitchRoll.cs
@@ -33,12 +33,12 @@ public class YawPitchRoll
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 30.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Model loading
Model model = LoadModel("resources/models/obj/plane.obj");
Texture2D texture = LoadTexture("resources/models/obj/plane_diffuse.png");
- model.Materials[0].Maps[(int)MaterialMapIndex.MATERIAL_MAP_DIFFUSE].Texture = texture;
+ model.Materials[0].Maps[(int)MaterialMapIndex.Diffuse].Texture = texture;
float pitch = 0.0f;
float roll = 0.0f;
@@ -53,11 +53,11 @@ public class YawPitchRoll
//----------------------------------------------------------------------------------
// Plane roll (x-axis) controls
- if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ if (IsKeyDown(KeyboardKey.Down))
{
pitch += 0.6f;
}
- else if (IsKeyDown(KeyboardKey.KEY_UP))
+ else if (IsKeyDown(KeyboardKey.Up))
{
pitch -= 0.6f;
}
@@ -74,11 +74,11 @@ public class YawPitchRoll
}
// Plane yaw (y-axis) controls
- if (IsKeyDown(KeyboardKey.KEY_S))
+ if (IsKeyDown(KeyboardKey.S))
{
yaw += 1.0f;
}
- else if (IsKeyDown(KeyboardKey.KEY_A))
+ else if (IsKeyDown(KeyboardKey.A))
{
yaw -= 1.0f;
}
@@ -95,11 +95,11 @@ public class YawPitchRoll
}
// Plane pitch (z-axis) controls
- if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ if (IsKeyDown(KeyboardKey.Left))
{
roll += 1.0f;
}
- else if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ else if (IsKeyDown(KeyboardKey.Right))
{
roll -= 1.0f;
}
@@ -122,30 +122,30 @@ public class YawPitchRoll
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw 3D model (recomended to draw 3D always before 2D)
BeginMode3D(camera);
// Draw 3d model with texture
- DrawModel(model, new Vector3(0.0f, -8.0f, 0.0f), 1.0f, Color.WHITE);
+ DrawModel(model, new Vector3(0.0f, -8.0f, 0.0f), 1.0f, Color.White);
DrawGrid(10, 10.0f);
EndMode3D();
// Draw controls info
- DrawRectangle(30, 370, 260, 70, Fade(Color.GREEN, 0.5f));
- DrawRectangleLines(30, 370, 260, 70, Fade(Color.DARKGREEN, 0.5f));
- DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 380, 10, Color.DARKGRAY);
- DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 400, 10, Color.DARKGRAY);
- DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 420, 10, Color.DARKGRAY);
+ DrawRectangle(30, 370, 260, 70, Fade(Color.Green, 0.5f));
+ DrawRectangleLines(30, 370, 260, 70, Fade(Color.DarkGreen, 0.5f));
+ DrawText("Pitch controlled with: KEY_UP / KEY_DOWN", 40, 380, 10, Color.DarkGray);
+ DrawText("Roll controlled with: KEY_LEFT / KEY_RIGHT", 40, 400, 10, Color.DarkGray);
+ DrawText("Yaw controlled with: KEY_A / KEY_S", 40, 420, 10, Color.DarkGray);
DrawText(
"(c) WWI Plane Model created by GiaHanLam",
screenWidth - 240,
screenHeight - 20,
10,
- Color.DARKGRAY
+ Color.DarkGray
);
EndDrawing();
diff --git a/Examples/Shaders/BasicLighting.cs b/Examples/Shaders/BasicLighting.cs
index 4d2ad25..dd98681 100644
--- a/Examples/Shaders/BasicLighting.cs
+++ b/Examples/Shaders/BasicLighting.cs
@@ -43,7 +43,7 @@ public class BasicLighting
const int screenHeight = 450;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - basic lighting");
// Define the camera to look into our 3d world
@@ -52,7 +52,7 @@ public class BasicLighting
camera.Target = new Vector3(0.0f, 0.5f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Load plane model from a generated mesh
Model model = LoadModelFromMesh(GenMeshPlane(10.0f, 10.0f, 3, 3));
@@ -64,12 +64,12 @@ public class BasicLighting
);
// Get some required shader loactions
- shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
+ shader.Locs[(int)ShaderLocationIndex.VectorView] = GetShaderLocation(shader, "viewPos");
// ambient light level
int ambientLoc = GetShaderLocation(shader, "ambient");
float[] ambient = new[] { 0.1f, 0.1f, 0.1f, 1.0f };
- Raylib.SetShaderValue(shader, ambientLoc, ambient, ShaderUniformDataType.SHADER_UNIFORM_VEC4);
+ Raylib.SetShaderValue(shader, ambientLoc, ambient, ShaderUniformDataType.Vec4);
// Assign out lighting shader to model
model.Materials[0].Shader = shader;
@@ -82,7 +82,7 @@ public class BasicLighting
LightType.Point,
new Vector3(-2, 1, -2),
Vector3.Zero,
- Color.YELLOW,
+ Color.Yellow,
shader
);
lights[1] = Rlights.CreateLight(
@@ -90,7 +90,7 @@ public class BasicLighting
LightType.Point,
new Vector3(2, 1, 2),
Vector3.Zero,
- Color.RED,
+ Color.Red,
shader
);
lights[2] = Rlights.CreateLight(
@@ -98,7 +98,7 @@ public class BasicLighting
LightType.Point,
new Vector3(-2, 1, 2),
Vector3.Zero,
- Color.GREEN,
+ Color.Green,
shader
);
lights[3] = Rlights.CreateLight(
@@ -106,7 +106,7 @@ public class BasicLighting
LightType.Point,
new Vector3(2, 1, -2),
Vector3.Zero,
- Color.BLUE,
+ Color.Blue,
shader
);
@@ -118,21 +118,21 @@ public class BasicLighting
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
- if (IsKeyPressed(KeyboardKey.KEY_Y))
+ if (IsKeyPressed(KeyboardKey.Y))
{
lights[0].Enabled = !lights[0].Enabled;
}
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
lights[1].Enabled = !lights[1].Enabled;
}
- if (IsKeyPressed(KeyboardKey.KEY_G))
+ if (IsKeyPressed(KeyboardKey.G))
{
lights[2].Enabled = !lights[2].Enabled;
}
- if (IsKeyPressed(KeyboardKey.KEY_B))
+ if (IsKeyPressed(KeyboardKey.B))
{
lights[3].Enabled = !lights[3].Enabled;
}
@@ -146,57 +146,57 @@ public class BasicLighting
// Update the light shader with the camera view position
Raylib.SetShaderValue(
shader,
- shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW],
+ shader.Locs[(int)ShaderLocationIndex.VectorView],
camera.Position,
- ShaderUniformDataType.SHADER_UNIFORM_VEC3
+ ShaderUniformDataType.Vec3
);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, Vector3.Zero, 1.0f, Color.WHITE);
- DrawModel(cube, Vector3.Zero, 1.0f, Color.WHITE);
+ DrawModel(model, Vector3.Zero, 1.0f, Color.White);
+ DrawModel(cube, Vector3.Zero, 1.0f, Color.White);
// Draw markers to show where the lights are
if (lights[0].Enabled)
{
- DrawSphereEx(lights[0].Position, 0.2f, 8, 8, Color.YELLOW);
+ DrawSphereEx(lights[0].Position, 0.2f, 8, 8, Color.Yellow);
}
else
{
- DrawSphereWires(lights[0].Position, 0.2f, 8, 8, ColorAlpha(Color.YELLOW, 0.3f));
+ DrawSphereWires(lights[0].Position, 0.2f, 8, 8, ColorAlpha(Color.Yellow, 0.3f));
}
if (lights[1].Enabled)
{
- DrawSphereEx(lights[1].Position, 0.2f, 8, 8, Color.RED);
+ DrawSphereEx(lights[1].Position, 0.2f, 8, 8, Color.Red);
}
else
{
- DrawSphereWires(lights[1].Position, 0.2f, 8, 8, ColorAlpha(Color.RED, 0.3f));
+ DrawSphereWires(lights[1].Position, 0.2f, 8, 8, ColorAlpha(Color.Red, 0.3f));
}
if (lights[2].Enabled)
{
- DrawSphereEx(lights[2].Position, 0.2f, 8, 8, Color.GREEN);
+ DrawSphereEx(lights[2].Position, 0.2f, 8, 8, Color.Green);
}
else
{
- DrawSphereWires(lights[2].Position, 0.2f, 8, 8, ColorAlpha(Color.GREEN, 0.3f));
+ DrawSphereWires(lights[2].Position, 0.2f, 8, 8, ColorAlpha(Color.Green, 0.3f));
}
if (lights[3].Enabled)
{
- DrawSphereEx(lights[3].Position, 0.2f, 8, 8, Color.BLUE);
+ DrawSphereEx(lights[3].Position, 0.2f, 8, 8, Color.Blue);
}
else
{
- DrawSphereWires(lights[3].Position, 0.2f, 8, 8, ColorAlpha(Color.BLUE, 0.3f));
+ DrawSphereWires(lights[3].Position, 0.2f, 8, 8, ColorAlpha(Color.Blue, 0.3f));
}
DrawGrid(10, 1.0f);
@@ -204,7 +204,7 @@ public class BasicLighting
EndMode3D();
DrawFPS(10, 10);
- DrawText("Use keys [Y][R][G][B] to toggle lights", 10, 40, 20, Color.DARKGRAY);
+ DrawText("Use keys [Y][R][G][B] to toggle lights", 10, 40, 20, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shaders/CustomUniform.cs b/Examples/Shaders/CustomUniform.cs
index 0cc312e..3149df1 100644
--- a/Examples/Shaders/CustomUniform.cs
+++ b/Examples/Shaders/CustomUniform.cs
@@ -31,7 +31,7 @@ public class CustomUniform
const int screenHeight = 450;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - custom uniform variable");
@@ -41,13 +41,13 @@ public class CustomUniform
camera.Target = new Vector3(0.0f, 1.5f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Model model = LoadModel("resources/models/obj/barracks.obj");
Texture2D texture = LoadTexture("resources/models/obj/barracks_diffuse.png");
// Set model diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 position = new(0.0f, 0.0f, 0.0f);
@@ -78,28 +78,28 @@ public class CustomUniform
swirlCenter[1] = screenHeight - mousePosition.Y;
// Send new value to the shader to be used on drawing
- Raylib.SetShaderValue(shader, swirlCenterLoc, swirlCenter, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, swirlCenterLoc, swirlCenter, ShaderUniformDataType.Vec2);
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Enable drawing to texture
BeginTextureMode(target);
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, position, 0.5f, Color.WHITE);
+ DrawModel(model, position, 0.5f, Color.White);
DrawGrid(10, 1.0f);
EndMode3D();
- DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, Color.RED);
+ DrawText("TEXT DRAWN IN RENDER TEXTURE", 200, 10, 30, Color.Red);
// End drawing to texture (now we have a texture available for next passes)
EndTextureMode();
@@ -111,7 +111,7 @@ public class CustomUniform
target.Texture,
new Rectangle(0, 0, target.Texture.Width, -target.Texture.Height),
new Vector2(0, 0),
- Color.WHITE
+ Color.White
);
EndShaderMode();
@@ -121,7 +121,7 @@ public class CustomUniform
screenWidth - 220,
screenHeight - 20,
10,
- Color.GRAY
+ Color.Gray
);
DrawFPS(10, 10);
diff --git a/Examples/Shaders/Eratosthenes.cs b/Examples/Shaders/Eratosthenes.cs
index 77a1e84..73d1cf4 100644
--- a/Examples/Shaders/Eratosthenes.cs
+++ b/Examples/Shaders/Eratosthenes.cs
@@ -61,17 +61,17 @@ public class Eratosthenes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Enable drawing to texture
BeginTextureMode(target);
- ClearBackground(Color.BLACK);
+ ClearBackground(Color.Black);
// Draw a rectangle in shader mode to be used as shader canvas
// NOTE: Rectangle uses font white character texture coordinates,
// so shader can not be applied here directly because input vertexTexCoord
// do not represent full screen coordinates (space where want to apply shader)
- DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.BLACK);
+ DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.Black);
// End drawing to texture (now we have a blank texture available for the shader)
EndTextureMode();
@@ -82,7 +82,7 @@ public class Eratosthenes
target.Texture,
new Rectangle(0, 0, target.Texture.Width, -target.Texture.Height),
new Vector2(0.0f, 0.0f),
- Color.WHITE
+ Color.White
);
EndShaderMode();
diff --git a/Examples/Shaders/Fog.cs b/Examples/Shaders/Fog.cs
index 4618ee6..c94ec58 100644
--- a/Examples/Shaders/Fog.cs
+++ b/Examples/Shaders/Fog.cs
@@ -42,7 +42,7 @@ public class Fog
const int screenHeight = 450;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - fog");
// Define the camera to look into our 3d world
@@ -51,7 +51,7 @@ public class Fog
camera.Target = new Vector3(0.0f, 0.5f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Load models and texture
Model modelA = LoadModelFromMesh(GenMeshTorus(0.4f, 1.0f, 16, 32));
@@ -60,14 +60,14 @@ public class Fog
Texture2D texture = LoadTexture("resources/texel_checker.png");
// Assign texture to default model material
- Raylib.SetMaterialTexture(ref modelA, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
- Raylib.SetMaterialTexture(ref modelB, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
- Raylib.SetMaterialTexture(ref modelC, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref modelA, 0, MaterialMapIndex.Albedo, ref texture);
+ Raylib.SetMaterialTexture(ref modelB, 0, MaterialMapIndex.Albedo, ref texture);
+ Raylib.SetMaterialTexture(ref modelC, 0, MaterialMapIndex.Albedo, ref texture);
// Load shader and set up some uniforms
Shader shader = LoadShader("resources/shaders/glsl330/lighting.vs", "resources/shaders/glsl330/fog.fs");
- shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_MODEL] = GetShaderLocation(shader, "matModel");
- shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
+ shader.Locs[(int)ShaderLocationIndex.MatrixModel] = GetShaderLocation(shader, "matModel");
+ shader.Locs[(int)ShaderLocationIndex.VectorView] = GetShaderLocation(shader, "viewPos");
// Ambient light level
int ambientLoc = GetShaderLocation(shader, "ambient");
@@ -75,12 +75,12 @@ public class Fog
shader,
ambientLoc,
new float[] { 0.2f, 0.2f, 0.2f, 1.0f },
- ShaderUniformDataType.SHADER_UNIFORM_VEC4
+ ShaderUniformDataType.Vec4
);
float fogDensity = 0.15f;
int fogDensityLoc = GetShaderLocation(shader, "fogDensity");
- Raylib.SetShaderValue(shader, fogDensityLoc, fogDensity, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, fogDensityLoc, fogDensity, ShaderUniformDataType.Float);
// NOTE: All models share the same shader
Raylib.SetMaterialShader(ref modelA, 0, ref shader);
@@ -88,7 +88,7 @@ public class Fog
Raylib.SetMaterialShader(ref modelC, 0, ref shader);
// Using just 1 point lights
- Rlights.CreateLight(0, LightType.Point, new Vector3(0, 2, 6), Vector3.Zero, Color.WHITE, shader);
+ Rlights.CreateLight(0, LightType.Point, new Vector3(0, 2, 6), Vector3.Zero, Color.White, shader);
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -98,9 +98,9 @@ public class Fog
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
- if (IsKeyDown(KeyboardKey.KEY_UP))
+ if (IsKeyDown(KeyboardKey.Up))
{
fogDensity += 0.001f;
if (fogDensity > 1.0f)
@@ -109,7 +109,7 @@ public class Fog
}
}
- if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ if (IsKeyDown(KeyboardKey.Down))
{
fogDensity -= 0.001f;
if (fogDensity < 0.0f)
@@ -118,7 +118,7 @@ public class Fog
}
}
- Raylib.SetShaderValue(shader, fogDensityLoc, fogDensity, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, fogDensityLoc, fogDensity, ShaderUniformDataType.Float);
// Rotate the torus
modelA.Transform = MatrixMultiply(modelA.Transform, MatrixRotateX(-0.025f));
@@ -127,27 +127,27 @@ public class Fog
// Update the light shader with the camera view position
Raylib.SetShaderValue(
shader,
- shader.Locs[(int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW],
+ shader.Locs[(int)ShaderLocationIndex.VectorView],
camera.Position,
- ShaderUniformDataType.SHADER_UNIFORM_VEC3
+ ShaderUniformDataType.Vec3
);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.GRAY);
+ ClearBackground(Color.Gray);
BeginMode3D(camera);
// Draw the three models
- DrawModel(modelA, Vector3.Zero, 1.0f, Color.WHITE);
- DrawModel(modelB, new Vector3(-2.6f, 0, 0), 1.0f, Color.WHITE);
- DrawModel(modelC, new Vector3(2.6f, 0, 0), 1.0f, Color.WHITE);
+ DrawModel(modelA, Vector3.Zero, 1.0f, Color.White);
+ DrawModel(modelB, new Vector3(-2.6f, 0, 0), 1.0f, Color.White);
+ DrawModel(modelC, new Vector3(2.6f, 0, 0), 1.0f, Color.White);
for (int i = -20; i < 20; i += 2)
{
- DrawModel(modelA, new Vector3(i, 0, 2), 1.0f, Color.WHITE);
+ DrawModel(modelA, new Vector3(i, 0, 2), 1.0f, Color.White);
}
EndMode3D();
@@ -157,7 +157,7 @@ public class Fog
10,
10,
20,
- Color.RAYWHITE
+ Color.RayWhite
);
EndDrawing();
diff --git a/Examples/Shaders/HotReloading.cs b/Examples/Shaders/HotReloading.cs
index 808758e..f3d5d29 100644
--- a/Examples/Shaders/HotReloading.cs
+++ b/Examples/Shaders/HotReloading.cs
@@ -41,7 +41,7 @@ public class HotReloading
int timeLoc = GetShaderLocation(shader, "time");
float[] resolution = new[] { (float)screenWidth, (float)screenHeight };
- Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.Vec2);
float totalTime = 0.0f;
bool shaderAutoReloading = false;
@@ -59,11 +59,11 @@ public class HotReloading
float[] mousePos = new[] { mouse.X, mouse.Y };
// Set shader required uniform values
- Raylib.SetShaderValue(shader, timeLoc, totalTime, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, mouseLoc, mousePos, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, timeLoc, totalTime, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, mouseLoc, mousePos, ShaderUniformDataType.Vec2);
// Hot shader reloading
- if (shaderAutoReloading || (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON)))
+ if (shaderAutoReloading || (IsMouseButtonPressed(MouseButton.Left)))
{
long currentFragShaderModTime = GetFileModTime(fragShaderFileName);
@@ -89,7 +89,7 @@ public class HotReloading
shader,
resolutionLoc,
resolution,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
}
@@ -97,7 +97,7 @@ public class HotReloading
}
}
- if (IsKeyPressed(KeyboardKey.KEY_A))
+ if (IsKeyPressed(KeyboardKey.A))
{
shaderAutoReloading = !shaderAutoReloading;
}
@@ -106,18 +106,18 @@ public class HotReloading
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// We only draw a white full-screen rectangle, frame is generated in shader
BeginShaderMode(shader);
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.WHITE);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.White);
EndShaderMode();
string info = $"PRESS [A] to TOGGLE SHADER AUTOLOADING: {(shaderAutoReloading ? "AUTO" : "MANUAL")}";
- DrawText(info, 10, 10, 10, shaderAutoReloading ? Color.RED : Color.BLACK);
+ DrawText(info, 10, 10, 10, shaderAutoReloading ? Color.Red : Color.Black);
if (!shaderAutoReloading)
{
- DrawText("MOUSE CLICK to SHADER RE-LOADING", 10, 30, 10, Color.BLACK);
+ DrawText("MOUSE CLICK to SHADER RE-LOADING", 10, 30, 10, Color.Black);
}
// DrawText($"Shader last modification: ", 10, 430, 10, Color.BLACK);
diff --git a/Examples/Shaders/HybridRender.cs b/Examples/Shaders/HybridRender.cs
index 5c9a369..3b23268 100644
--- a/Examples/Shaders/HybridRender.cs
+++ b/Examples/Shaders/HybridRender.cs
@@ -60,7 +60,7 @@ public class HybridRender
shdrRaymarch,
marchLocs.ScreenCenter,
screenCenter,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
// Use customized function to create writable depth texture buffer
@@ -72,7 +72,7 @@ public class HybridRender
camera.Target = new Vector3(0.0f, 0.5f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Camera FOV is pre-calculated in the camera Distance.
float camDist = 1.0f / (MathF.Tan(camera.FovY * 0.5f * Raylib.DEG2RAD));
@@ -85,41 +85,41 @@ public class HybridRender
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
// Update Camera Postion in the ray march shader.
SetShaderValue(
shdrRaymarch,
marchLocs.CamPos,
camera.Position,
- ShaderUniformDataType.SHADER_UNIFORM_VEC3
+ ShaderUniformDataType.Vec3
);
// Update Camera Looking Vector. Vector length determines FOV.
Vector3 camDir = Vector3.Normalize(camera.Target - camera.Position) * camDist;
- SetShaderValue(shdrRaymarch, marchLocs.CamDir, camDir, ShaderUniformDataType.SHADER_UNIFORM_VEC3);
+ SetShaderValue(shdrRaymarch, marchLocs.CamDir, camDir, ShaderUniformDataType.Vec3);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
// Draw into our custom render texture (framebuffer)
BeginTextureMode(target);
- ClearBackground(Color.WHITE);
+ ClearBackground(Color.White);
// Raymarch Scene
// Manually enable Depth Test to handle multiple rendering methods.
Rlgl.EnableDepthTest();
BeginShaderMode(shdrRaymarch);
- DrawRectangleRec(new Rectangle(0, 0, screenWidth, screenHeight), Color.WHITE);
+ DrawRectangleRec(new Rectangle(0, 0, screenWidth, screenHeight), Color.White);
EndShaderMode();
// Rasterize Scene
BeginMode3D(camera);
BeginShaderMode(shdrRaster);
- DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.RED);
- DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.PURPLE);
- DrawCubeWiresV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.DARKGREEN);
- DrawCubeV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.YELLOW);
+ DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Red);
+ DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Purple);
+ DrawCubeWiresV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.DarkGreen);
+ DrawCubeV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Yellow);
DrawGrid(10, 1.0f);
EndShaderMode();
EndMode3D();
@@ -128,13 +128,13 @@ public class HybridRender
// Draw custom render texture
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawTextureRec(
target.Texture,
new Rectangle(0, 0, screenWidth, -screenHeight),
Vector2.Zero,
- Color.WHITE
+ Color.White
);
DrawFPS(10, 10);
@@ -171,48 +171,48 @@ public class HybridRender
null,
width,
height,
- PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ PixelFormat.UncompressedR8G8B8A8,
1
);
target.Texture.Width = width;
target.Texture.Height = height;
- target.Texture.Format = PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
+ target.Texture.Format = PixelFormat.UncompressedR8G8B8A8;
target.Texture.Mipmaps = 1;
// Create depth texture buffer (instead of raylib default renderbuffer)
target.Depth.Id = Rlgl.LoadTextureDepth(width, height, false);
target.Depth.Width = width;
target.Depth.Height = height;
- target.Depth.Format = PixelFormat.PIXELFORMAT_COMPRESSED_PVRT_RGBA;
+ target.Depth.Format = PixelFormat.CompressedPvrtRgba;
target.Depth.Mipmaps = 1;
// Attach color texture and depth texture to FBO
Rlgl.FramebufferAttach(
target.Id,
target.Texture.Id,
- FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
- FramebufferAttachTextureType.RL_ATTACHMENT_TEXTURE2D,
+ FramebufferAttachType.ColorChannel0,
+ FramebufferAttachTextureType.Texture2D,
0
);
Rlgl.FramebufferAttach(
target.Id,
target.Depth.Id,
- FramebufferAttachType.RL_ATTACHMENT_DEPTH,
- FramebufferAttachTextureType.RL_ATTACHMENT_TEXTURE2D,
+ FramebufferAttachType.Depth,
+ FramebufferAttachTextureType.Texture2D,
0
);
// Check if fbo is complete with attachments (valid)
if (Rlgl.FramebufferComplete(target.Id))
{
- TraceLog(TraceLogLevel.LOG_INFO, $"FBO: [ID {target.Id}] Framebuffer object created successfully");
+ TraceLog(TraceLogLevel.Info, $"FBO: [ID {target.Id}] Framebuffer object created successfully");
}
Rlgl.DisableFramebuffer();
}
else
{
- TraceLog(TraceLogLevel.LOG_WARNING, "FBO: Framebuffer object can not be created");
+ TraceLog(TraceLogLevel.Warning, "FBO: Framebuffer object can not be created");
}
return target;
diff --git a/Examples/Shaders/JuliaSet.cs b/Examples/Shaders/JuliaSet.cs
index 31d2000..b74f75d 100644
--- a/Examples/Shaders/JuliaSet.cs
+++ b/Examples/Shaders/JuliaSet.cs
@@ -69,12 +69,12 @@ public class JuliaSet
shader,
GetShaderLocation(shader, "screenDims"),
screenDims,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
- Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
- Raylib.SetShaderValue(shader, zoomLoc, zoomLoc, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, offsetLoc, offset, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.Vec2);
+ Raylib.SetShaderValue(shader, zoomLoc, zoomLoc, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, offsetLoc, offset, ShaderUniformDataType.Vec2);
// Create a RenderTexture2D to be used for render to texture
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
@@ -95,80 +95,80 @@ public class JuliaSet
// Update
//----------------------------------------------------------------------------------
// Press [1 - 6] to reset c to a point of interest
- if (IsKeyPressed(KeyboardKey.KEY_ONE) ||
- IsKeyPressed(KeyboardKey.KEY_TWO) ||
- IsKeyPressed(KeyboardKey.KEY_THREE) ||
- IsKeyPressed(KeyboardKey.KEY_FOUR) ||
- IsKeyPressed(KeyboardKey.KEY_FIVE) ||
- IsKeyPressed(KeyboardKey.KEY_SIX))
+ if (IsKeyPressed(KeyboardKey.One) ||
+ IsKeyPressed(KeyboardKey.Two) ||
+ IsKeyPressed(KeyboardKey.Three) ||
+ IsKeyPressed(KeyboardKey.Four) ||
+ IsKeyPressed(KeyboardKey.Five) ||
+ IsKeyPressed(KeyboardKey.Six))
{
- if (IsKeyPressed(KeyboardKey.KEY_ONE))
+ if (IsKeyPressed(KeyboardKey.One))
{
c[0] = PointsOfInterest[0][0];
c[1] = PointsOfInterest[0][1];
}
- else if (IsKeyPressed(KeyboardKey.KEY_TWO))
+ else if (IsKeyPressed(KeyboardKey.Two))
{
c[0] = PointsOfInterest[1][0];
c[1] = PointsOfInterest[1][1];
}
- else if (IsKeyPressed(KeyboardKey.KEY_THREE))
+ else if (IsKeyPressed(KeyboardKey.Three))
{
c[0] = PointsOfInterest[2][0];
c[1] = PointsOfInterest[2][1];
}
- else if (IsKeyPressed(KeyboardKey.KEY_FOUR))
+ else if (IsKeyPressed(KeyboardKey.Four))
{
c[0] = PointsOfInterest[3][0];
c[1] = PointsOfInterest[3][1];
}
- else if (IsKeyPressed(KeyboardKey.KEY_FIVE))
+ else if (IsKeyPressed(KeyboardKey.Five))
{
c[0] = PointsOfInterest[4][0];
c[1] = PointsOfInterest[4][1];
}
- else if (IsKeyPressed(KeyboardKey.KEY_SIX))
+ else if (IsKeyPressed(KeyboardKey.Six))
{
c[0] = PointsOfInterest[5][0];
c[1] = PointsOfInterest[5][1];
}
- Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.Vec2);
}
// Pause animation (c change)
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
pause = !pause;
}
// Toggle whether or not to show controls
- if (IsKeyPressed(KeyboardKey.KEY_F1))
+ if (IsKeyPressed(KeyboardKey.F1))
{
showControls = !showControls;
}
if (!pause)
{
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
incrementSpeed++;
}
- else if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ else if (IsKeyPressed(KeyboardKey.Left))
{
incrementSpeed--;
}
// TODO: The idea is to zoom and move around with mouse
// Probably offset movement should be proportional to zoom level
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON) || IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left) || IsMouseButtonDown(MouseButton.Right))
{
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left))
{
zoom += zoom * 0.003f;
}
- if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Right))
{
zoom -= zoom * 0.003f;
}
@@ -187,48 +187,48 @@ public class JuliaSet
offsetSpeed = new Vector2(0.0f, 0.0f);
}
- Raylib.SetShaderValue(shader, zoomLoc, zoom, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, offsetLoc, offset, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, zoomLoc, zoom, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, offsetLoc, offset, ShaderUniformDataType.Vec2);
// Increment c value with time
float amount = GetFrameTime() * incrementSpeed * 0.0005f;
c[0] += amount;
c[1] += amount;
- Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, cLoc, c, ShaderUniformDataType.Vec2);
}
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.BLACK);
+ ClearBackground(Color.Black);
// Using a render texture to draw Julia set
// Enable drawing to texture
BeginTextureMode(target);
- ClearBackground(Color.BLACK);
+ ClearBackground(Color.Black);
// Draw a rectangle in shader mode to be used as shader canvas
// NOTE: Rectangle uses font Color.white character texture coordinates,
// so shader can not be applied here directly because input vertexTexCoord
// do not represent full screen coordinates (space where want to apply shader)
- DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.BLACK);
+ DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Color.Black);
EndTextureMode();
// Draw the saved texture and rendered julia set with shader
// NOTE: We do not invert texture on Y, already considered inside shader
BeginShaderMode(shader);
- DrawTexture(target.Texture, 0, 0, Color.WHITE);
+ DrawTexture(target.Texture, 0, 0, Color.White);
EndShaderMode();
if (showControls)
{
- DrawText("Press Mouse buttons right/left to zoom in/out and move", 10, 15, 10, Color.RAYWHITE);
- DrawText("Press KEY_F1 to toggle these controls", 10, 30, 10, Color.RAYWHITE);
- DrawText("Press KEYS [1 - 6] to change point of interest", 10, 45, 10, Color.RAYWHITE);
- DrawText("Press KEY_LEFT | KEY_RIGHT to change speed", 10, 60, 10, Color.RAYWHITE);
- DrawText("Press KEY_SPACE to pause movement animation", 10, 75, 10, Color.RAYWHITE);
+ DrawText("Press Mouse buttons right/left to zoom in/out and move", 10, 15, 10, Color.RayWhite);
+ DrawText("Press KEY_F1 to toggle these controls", 10, 30, 10, Color.RayWhite);
+ DrawText("Press KEYS [1 - 6] to change point of interest", 10, 45, 10, Color.RayWhite);
+ DrawText("Press KEY_LEFT | KEY_RIGHT to change speed", 10, 60, 10, Color.RayWhite);
+ DrawText("Press KEY_SPACE to pause movement animation", 10, 75, 10, Color.RayWhite);
}
EndDrawing();
diff --git a/Examples/Shaders/MeshInstancing.cs b/Examples/Shaders/MeshInstancing.cs
index 82baa98..20d3870 100644
--- a/Examples/Shaders/MeshInstancing.cs
+++ b/Examples/Shaders/MeshInstancing.cs
@@ -30,7 +30,7 @@ public class MeshInstancing
const int fps = 60;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - rlgl mesh instanced");
// Speed of jump animation
@@ -55,7 +55,7 @@ public class MeshInstancing
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Number of instances to display
const int instances = 10000;
@@ -97,9 +97,9 @@ public class MeshInstancing
unsafe
{
int* locs = (int*)shader.Locs;
- locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_MVP] = GetShaderLocation(shader, "mvp");
- locs[(int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW] = GetShaderLocation(shader, "viewPos");
- locs[(int)ShaderLocationIndex.SHADER_LOC_MATRIX_MODEL] = GetShaderLocationAttrib(
+ locs[(int)ShaderLocationIndex.MatrixMvp] = GetShaderLocation(shader, "mvp");
+ locs[(int)ShaderLocationIndex.VectorView] = GetShaderLocation(shader, "viewPos");
+ locs[(int)ShaderLocationIndex.MatrixModel] = GetShaderLocationAttrib(
shader,
"instanceTransform"
);
@@ -111,7 +111,7 @@ public class MeshInstancing
shader,
ambientLoc,
new float[] { 0.2f, 0.2f, 0.2f, 1.0f },
- ShaderUniformDataType.SHADER_UNIFORM_VEC4
+ ShaderUniformDataType.Vec4
);
Rlights.CreateLight(
@@ -119,7 +119,7 @@ public class MeshInstancing
LightType.Directorional,
new Vector3(50, 50, 0),
Vector3.Zero,
- Color.WHITE,
+ Color.White,
shader
);
@@ -127,7 +127,7 @@ public class MeshInstancing
material.Shader = shader;
unsafe
{
- material.Maps[(int)MaterialMapIndex.MATERIAL_MAP_DIFFUSE].Color = Color.RED;
+ material.Maps[(int)MaterialMapIndex.Diffuse].Color = Color.Red;
}
int textPositionY = 300;
@@ -143,77 +143,77 @@ public class MeshInstancing
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
textPositionY = 300;
framesCounter += 1;
- if (IsKeyDown(KeyboardKey.KEY_UP))
+ if (IsKeyDown(KeyboardKey.Up))
{
amp += 0.5f;
}
- if (IsKeyDown(KeyboardKey.KEY_DOWN))
+ if (IsKeyDown(KeyboardKey.Down))
{
amp = (amp <= 1) ? 1.0f : (amp - 1.0f);
}
- if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ if (IsKeyDown(KeyboardKey.Left))
{
variance = (variance <= 0.0f) ? 0.0f : (variance - 0.01f);
}
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
variance = (variance >= 1.0f) ? 1.0f : (variance + 0.01f);
}
- if (IsKeyDown(KeyboardKey.KEY_ONE))
+ if (IsKeyDown(KeyboardKey.One))
{
groups = 1;
}
- if (IsKeyDown(KeyboardKey.KEY_TWO))
+ if (IsKeyDown(KeyboardKey.Two))
{
groups = 2;
}
- if (IsKeyDown(KeyboardKey.KEY_THREE))
+ if (IsKeyDown(KeyboardKey.Three))
{
groups = 3;
}
- if (IsKeyDown(KeyboardKey.KEY_FOUR))
+ if (IsKeyDown(KeyboardKey.Four))
{
groups = 4;
}
- if (IsKeyDown(KeyboardKey.KEY_FIVE))
+ if (IsKeyDown(KeyboardKey.Five))
{
groups = 5;
}
- if (IsKeyDown(KeyboardKey.KEY_SIX))
+ if (IsKeyDown(KeyboardKey.Six))
{
groups = 6;
}
- if (IsKeyDown(KeyboardKey.KEY_SEVEN))
+ if (IsKeyDown(KeyboardKey.Seven))
{
groups = 7;
}
- if (IsKeyDown(KeyboardKey.KEY_EIGHT))
+ if (IsKeyDown(KeyboardKey.Eight))
{
groups = 8;
}
- if (IsKeyDown(KeyboardKey.KEY_NINE))
+ if (IsKeyDown(KeyboardKey.Nine))
{
groups = 9;
}
- if (IsKeyDown(KeyboardKey.KEY_W))
+ if (IsKeyDown(KeyboardKey.W))
{
groups = 7;
amp = 25;
@@ -221,22 +221,22 @@ public class MeshInstancing
variance = 0.70f;
}
- if (IsKeyDown(KeyboardKey.KEY_EQUAL))
+ if (IsKeyDown(KeyboardKey.Equal))
{
speed = (speed <= (int)(fps * 0.25f)) ? (int)(fps * 0.25f) : (int)(speed * 0.95f);
}
- if (IsKeyDown(KeyboardKey.KEY_KP_ADD))
+ if (IsKeyDown(KeyboardKey.KpAdd))
{
speed = (speed <= (int)(fps * 0.25f)) ? (int)(fps * 0.25f) : (int)(speed * 0.95f);
}
- if (IsKeyDown(KeyboardKey.KEY_MINUS))
+ if (IsKeyDown(KeyboardKey.Minus))
{
speed = (int)MathF.Max(speed * 1.02f, speed + 1);
}
- if (IsKeyDown(KeyboardKey.KEY_KP_SUBTRACT))
+ if (IsKeyDown(KeyboardKey.KpSubtract))
{
speed = (int)MathF.Max(speed * 1.02f, speed + 1);
}
@@ -245,9 +245,9 @@ public class MeshInstancing
float[] cameraPos = { camera.Position.X, camera.Position.Y, camera.Position.Z };
Raylib.SetShaderValue(
shader,
- (int)ShaderLocationIndex.SHADER_LOC_VECTOR_VIEW,
+ (int)ShaderLocationIndex.VectorView,
cameraPos,
- ShaderUniformDataType.SHADER_UNIFORM_VEC3
+ ShaderUniformDataType.Vec3
);
// Apply per-instance transformations
@@ -273,42 +273,42 @@ public class MeshInstancing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
DrawMeshInstanced(cube, material, transforms, instances);
EndMode3D();
- DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, Color.MAROON);
- DrawText("PRESS KEYS:", 10, textPositionY, 20, Color.BLACK);
+ DrawText("A CUBE OF DANCING CUBES!", 490, 10, 20, Color.Maroon);
+ DrawText("PRESS KEYS:", 10, textPositionY, 20, Color.Black);
- DrawText("1 - 9", 10, textPositionY += 25, 10, Color.BLACK);
- DrawText(": Number of groups", 50, textPositionY, 10, Color.BLACK);
- DrawText($": {groups}", 160, textPositionY, 10, Color.BLACK);
+ DrawText("1 - 9", 10, textPositionY += 25, 10, Color.Black);
+ DrawText(": Number of groups", 50, textPositionY, 10, Color.Black);
+ DrawText($": {groups}", 160, textPositionY, 10, Color.Black);
- DrawText("UP", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": increase amplitude", 50, textPositionY, 10, Color.BLACK);
- DrawText($": {amp}%.2f", 160, textPositionY, 10, Color.BLACK);
+ DrawText("UP", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": increase amplitude", 50, textPositionY, 10, Color.Black);
+ DrawText($": {amp}%.2f", 160, textPositionY, 10, Color.Black);
- DrawText("DOWN", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": decrease amplitude", 50, textPositionY, 10, Color.BLACK);
+ DrawText("DOWN", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": decrease amplitude", 50, textPositionY, 10, Color.Black);
- DrawText("LEFT", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": decrease variance", 50, textPositionY, 10, Color.BLACK);
- DrawText($": {variance}.2f", 160, textPositionY, 10, Color.BLACK);
+ DrawText("LEFT", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": decrease variance", 50, textPositionY, 10, Color.Black);
+ DrawText($": {variance}.2f", 160, textPositionY, 10, Color.Black);
- DrawText("RIGHT", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": increase variance", 50, textPositionY, 10, Color.BLACK);
+ DrawText("RIGHT", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": increase variance", 50, textPositionY, 10, Color.Black);
- DrawText("+/=", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": increase speed", 50, textPositionY, 10, Color.BLACK);
- DrawText($": {speed} = {((float)fps / speed)} loops/sec", 160, textPositionY, 10, Color.BLACK);
+ DrawText("+/=", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": increase speed", 50, textPositionY, 10, Color.Black);
+ DrawText($": {speed} = {((float)fps / speed)} loops/sec", 160, textPositionY, 10, Color.Black);
- DrawText("-", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": decrease speed", 50, textPositionY, 10, Color.BLACK);
+ DrawText("-", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": decrease speed", 50, textPositionY, 10, Color.Black);
- DrawText("W", 10, textPositionY += 15, 10, Color.BLACK);
- DrawText(": Wild setup!", 50, textPositionY, 10, Color.BLACK);
+ DrawText("W", 10, textPositionY += 15, 10, Color.Black);
+ DrawText(": Wild setup!", 50, textPositionY, 10, Color.Black);
DrawFPS(10, 10);
diff --git a/Examples/Shaders/ModelShader.cs b/Examples/Shaders/ModelShader.cs
index 2dd1be2..1d78b96 100644
--- a/Examples/Shaders/ModelShader.cs
+++ b/Examples/Shaders/ModelShader.cs
@@ -31,7 +31,7 @@ public class ModelShader
const int screenHeight = 450;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - model shader");
@@ -41,7 +41,7 @@ public class ModelShader
camera.Target = new Vector3(0.0f, 1.0f, -1.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Model model = LoadModel("resources/models/obj/watermill.obj");
Texture2D texture = LoadTexture("resources/models/obj/watermill_diffuse.png");
@@ -49,7 +49,7 @@ public class ModelShader
"resources/shaders/glsl330/grayscale.fs");
Raylib.SetMaterialShader(ref model, 0, ref shader);
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 position = new(0.0f, 0.0f, 0.0f);
@@ -61,17 +61,17 @@ public class ModelShader
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, position, 0.2f, Color.WHITE);
+ DrawModel(model, position, 0.2f, Color.White);
DrawGrid(10, 1.0f);
@@ -82,11 +82,11 @@ public class ModelShader
screenWidth - 210,
screenHeight - 20,
10,
- Color.GRAY
+ Color.Gray
);
- DrawText($"Camera3D position: ({camera.Position})", 600, 20, 10, Color.BLACK);
- DrawText($"Camera3D target: ({camera.Position})", 600, 40, 10, Color.GRAY);
+ DrawText($"Camera3D position: ({camera.Position})", 600, 20, 10, Color.Black);
+ DrawText($"Camera3D target: ({camera.Position})", 600, 40, 10, Color.Gray);
DrawFPS(10, 10);
diff --git a/Examples/Shaders/MultiSample2d.cs b/Examples/Shaders/MultiSample2d.cs
index 1ddf7e4..ba318fc 100644
--- a/Examples/Shaders/MultiSample2d.cs
+++ b/Examples/Shaders/MultiSample2d.cs
@@ -56,11 +56,11 @@ public class MultiSample2d
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ if (IsKeyDown(KeyboardKey.Right))
{
dividerValue += 0.01f;
}
- else if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ else if (IsKeyDown(KeyboardKey.Left))
{
dividerValue -= 0.01f;
}
@@ -74,13 +74,13 @@ public class MultiSample2d
dividerValue = 1.0f;
}
- Raylib.SetShaderValue(shader, dividerLoc, dividerValue, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, dividerLoc, dividerValue, ShaderUniformDataType.Float);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginShaderMode(shader);
@@ -91,12 +91,12 @@ public class MultiSample2d
// We are drawing texRed using default sampler2D texture0 but
// an additional texture units is enabled for texBlue (sampler2D texture1)
- DrawTexture(texRed, 0, 0, Color.WHITE);
+ DrawTexture(texRed, 0, 0, Color.White);
EndShaderMode();
int y = GetScreenHeight() - 40;
- DrawText("Use KEY_LEFT/KEY_RIGHT to move texture mixing in shader!", 80, y, 20, Color.RAYWHITE);
+ DrawText("Use KEY_LEFT/KEY_RIGHT to move texture mixing in shader!", 80, y, 20, Color.RayWhite);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shaders/PaletteSwitch.cs b/Examples/Shaders/PaletteSwitch.cs
index 25386c6..b14b189 100644
--- a/Examples/Shaders/PaletteSwitch.cs
+++ b/Examples/Shaders/PaletteSwitch.cs
@@ -99,11 +99,11 @@ public class PaletteSwitch
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
currentPalette++;
}
- else if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ else if (IsKeyPressed(KeyboardKey.Left))
{
currentPalette--;
}
@@ -123,7 +123,7 @@ public class PaletteSwitch
shader,
paletteLoc,
Palettes[currentPalette],
- ShaderUniformDataType.SHADER_UNIFORM_IVEC3,
+ ShaderUniformDataType.IVec3,
ColorsPerPalette
);
//----------------------------------------------------------------------------------
@@ -131,7 +131,7 @@ public class PaletteSwitch
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginShaderMode(shader);
@@ -144,9 +144,9 @@ public class PaletteSwitch
EndShaderMode();
- DrawText("< >", 10, 10, 30, Color.DARKBLUE);
- DrawText("CURRENT PALETTE:", 60, 15, 20, Color.RAYWHITE);
- DrawText(PaletteText[currentPalette], 300, 15, 20, Color.RED);
+ DrawText("< >", 10, 10, 30, Color.DarkBlue);
+ DrawText("CURRENT PALETTE:", 60, 15, 20, Color.RayWhite);
+ DrawText(PaletteText[currentPalette], 300, 15, 20, Color.Red);
DrawFPS(700, 15);
diff --git a/Examples/Shaders/PostProcessing.cs b/Examples/Shaders/PostProcessing.cs
index 68db83d..b7dd2a5 100644
--- a/Examples/Shaders/PostProcessing.cs
+++ b/Examples/Shaders/PostProcessing.cs
@@ -67,7 +67,7 @@ public class PostProcessing
const int screenHeight = 450;
// Enable Multi Sampling Anti Aliasing 4x (if available)
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader");
// Define the camera to look into our 3d world
@@ -76,13 +76,13 @@ public class PostProcessing
camera.Target = new Vector3(0.0f, 1.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
Model model = LoadModel("resources/models/obj/church.obj");
Texture2D texture = LoadTexture("resources/models/obj/church_diffuse.png");
// Set model diffuse texture
- Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.MATERIAL_MAP_ALBEDO, ref texture);
+ Raylib.SetMaterialTexture(ref model, 0, MaterialMapIndex.Albedo, ref texture);
Vector3 position = new(0.0f, 0.0f, 0.0f);
@@ -119,13 +119,13 @@ public class PostProcessing
{
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
currentShader++;
}
- else if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ else if (IsKeyPressed(KeyboardKey.Left))
{
currentShader--;
}
@@ -143,15 +143,15 @@ public class PostProcessing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Enable drawing to texture
BeginTextureMode(target);
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginMode3D(camera);
- DrawModel(model, position, 0.1f, Color.WHITE);
+ DrawModel(model, position, 0.1f, Color.White);
DrawGrid(10, 1.0f);
@@ -168,18 +168,18 @@ public class PostProcessing
target.Texture,
new Rectangle(0, 0, target.Texture.Width, -target.Texture.Height),
new Vector2(0, 0),
- Color.WHITE
+ Color.White
);
EndShaderMode();
- DrawRectangle(0, 9, 580, 30, ColorAlpha(Color.LIGHTGRAY, 0.7f));
+ DrawRectangle(0, 9, 580, 30, ColorAlpha(Color.LightGray, 0.7f));
- DrawText("(c) Church 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawText("(c) Church 3D model by Alberto Cano", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
- DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, Color.BLACK);
- DrawText(postproShaderText[currentShader], 330, 15, 20, Color.RED);
- DrawText("< >", 540, 10, 30, Color.DARKBLUE);
+ DrawText("CURRENT POSTPRO SHADER:", 10, 15, 20, Color.Black);
+ DrawText(postproShaderText[currentShader], 330, 15, 20, Color.Red);
+ DrawText("< >", 540, 10, 30, Color.DarkBlue);
DrawFPS(700, 15);
diff --git a/Examples/Shaders/Raymarching.cs b/Examples/Shaders/Raymarching.cs
index 36aa77f..b40c032 100644
--- a/Examples/Shaders/Raymarching.cs
+++ b/Examples/Shaders/Raymarching.cs
@@ -33,7 +33,7 @@ public class Raymarching
int screenWidth = 800;
int screenHeight = 450;
- SetConfigFlags(FLAG_WINDOW_RESIZABLE);
+ SetConfigFlags(ResizableWindow);
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - raymarching shapes");
Camera3D camera = new();
@@ -53,7 +53,7 @@ public class Raymarching
int resolutionLoc = GetShaderLocation(shader, "resolution");
float[] resolution = { (float)screenWidth, (float)screenHeight };
- Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.Vec2);
float runTime = 0.0f;
@@ -70,31 +70,31 @@ public class Raymarching
screenWidth = GetScreenWidth();
screenHeight = GetScreenHeight();
resolution = new float[] { (float)screenWidth, (float)screenHeight };
- Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.SHADER_UNIFORM_VEC2);
+ Raylib.SetShaderValue(shader, resolutionLoc, resolution, ShaderUniformDataType.Vec2);
}
// Update
//----------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_FREE);
+ UpdateCamera(ref camera, CameraMode.Free);
float deltaTime = GetFrameTime();
runTime += deltaTime;
// Set shader required uniform values
- Raylib.SetShaderValue(shader, viewEyeLoc, camera.Position, ShaderUniformDataType.SHADER_UNIFORM_VEC3);
- Raylib.SetShaderValue(shader, viewCenterLoc, camera.Target, ShaderUniformDataType.SHADER_UNIFORM_VEC3);
- Raylib.SetShaderValue(shader, runTimeLoc, runTime, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, viewEyeLoc, camera.Position, ShaderUniformDataType.Vec3);
+ Raylib.SetShaderValue(shader, viewCenterLoc, camera.Target, ShaderUniformDataType.Vec3);
+ Raylib.SetShaderValue(shader, runTimeLoc, runTime, ShaderUniformDataType.Float);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// We only draw a white full-screen rectangle,
// frame is generated in shader using raymarching
BeginShaderMode(shader);
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.WHITE);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.White);
EndShaderMode();
DrawText(
@@ -102,7 +102,7 @@ public class Raymarching
screenWidth - 280,
screenHeight - 20,
10,
- Color.BLACK
+ Color.Black
);
EndDrawing();
diff --git a/Examples/Shaders/ShapesTextures.cs b/Examples/Shaders/ShapesTextures.cs
index 7e8d2f8..b2a3c10 100644
--- a/Examples/Shaders/ShapesTextures.cs
+++ b/Examples/Shaders/ShapesTextures.cs
@@ -54,54 +54,54 @@ public class ShapesTextures
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Start drawing with default shader
- DrawText("USING DEFAULT SHADER", 20, 40, 10, Color.RED);
+ DrawText("USING DEFAULT SHADER", 20, 40, 10, Color.Red);
- DrawCircle(80, 120, 35, Color.DARKBLUE);
- DrawCircleGradient(80, 220, 60, Color.GREEN, Color.SKYBLUE);
- DrawCircleLines(80, 340, 80, Color.DARKBLUE);
+ DrawCircle(80, 120, 35, Color.DarkBlue);
+ DrawCircleGradient(80, 220, 60, Color.Green, Color.SkyBlue);
+ DrawCircleLines(80, 340, 80, Color.DarkBlue);
// Activate our custom shader to be applied on next shapes/textures drawings
BeginShaderMode(shader);
- DrawText("USING CUSTOM SHADER", 190, 40, 10, Color.RED);
+ DrawText("USING CUSTOM SHADER", 190, 40, 10, Color.Red);
- DrawRectangle(250 - 60, 90, 120, 60, Color.RED);
- DrawRectangleGradientH(250 - 90, 170, 180, 130, Color.MAROON, Color.GOLD);
- DrawRectangleLines(250 - 40, 320, 80, 60, Color.ORANGE);
+ DrawRectangle(250 - 60, 90, 120, 60, Color.Red);
+ DrawRectangleGradientH(250 - 90, 170, 180, 130, Color.Maroon, Color.Gold);
+ DrawRectangleLines(250 - 40, 320, 80, 60, Color.Orange);
// Activate our default shader for next drawings
EndShaderMode();
- DrawText("USING DEFAULT SHADER", 370, 40, 10, Color.RED);
+ DrawText("USING DEFAULT SHADER", 370, 40, 10, Color.Red);
DrawTriangle(
new Vector2(430, 80),
new Vector2(430 - 60, 150),
- new Vector2(430 + 60, 150), Color.VIOLET
+ new Vector2(430 + 60, 150), Color.Violet
);
DrawTriangleLines(
new Vector2(430, 160),
new Vector2(430 - 20, 230),
- new Vector2(430 + 20, 230), Color.DARKBLUE
+ new Vector2(430 + 20, 230), Color.DarkBlue
);
- DrawPoly(new Vector2(430, 320), 6, 80, 0, Color.BROWN);
+ DrawPoly(new Vector2(430, 320), 6, 80, 0, Color.Brown);
// Activate our custom shader to be applied on next shapes/textures drawings
BeginShaderMode(shader);
// Using custom shader
- DrawTexture(fudesumi, 500, -30, Color.WHITE);
+ DrawTexture(fudesumi, 500, -30, Color.White);
// Activate our default shader for next drawings
EndShaderMode();
- DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, Color.GRAY);
+ DrawText("(c) Fudesumi sprite by Eiden Marsal", 380, screenHeight - 20, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shaders/SimpleMask.cs b/Examples/Shaders/SimpleMask.cs
index 7e7761f..ce43c2f 100644
--- a/Examples/Shaders/SimpleMask.cs
+++ b/Examples/Shaders/SimpleMask.cs
@@ -41,7 +41,7 @@ public class SimpleMask
camera.Target = new Vector3(0.0f, 0.0f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
// Define our three models to show the shader on
Mesh torus = GenMeshTorus(.3f, 1, 16, 32);
@@ -62,11 +62,11 @@ public class SimpleMask
Material* materials = model1.Materials;
MaterialMap* maps = materials[0].Maps;
- model1.Materials[0].Maps[(int)MaterialMapIndex.MATERIAL_MAP_ALBEDO].Texture = texDiffuse;
+ model1.Materials[0].Maps[(int)MaterialMapIndex.Albedo].Texture = texDiffuse;
materials = model2.Materials;
maps = materials[0].Maps;
- maps[(int)MaterialMapIndex.MATERIAL_MAP_ALBEDO].Texture = texDiffuse;
+ maps[(int)MaterialMapIndex.Albedo].Texture = texDiffuse;
// Using MAP_EMISSION as a spare slot to use for 2nd texture
// NOTE: Don't use MAP_IRRADIANCE, MAP_PREFILTER or MAP_CUBEMAP
@@ -75,14 +75,14 @@ public class SimpleMask
materials = model1.Materials;
maps = (MaterialMap*)materials[0].Maps;
- maps[(int)MaterialMapIndex.MATERIAL_MAP_EMISSION].Texture = texMask;
+ maps[(int)MaterialMapIndex.Emission].Texture = texMask;
materials = model2.Materials;
maps = (MaterialMap*)materials[0].Maps;
- maps[(int)MaterialMapIndex.MATERIAL_MAP_EMISSION].Texture = texMask;
+ maps[(int)MaterialMapIndex.Emission].Texture = texMask;
int* locs = shader.Locs;
- locs[(int)ShaderLocationIndex.SHADER_LOC_MAP_EMISSION] = GetShaderLocation(shader, "mask");
+ locs[(int)ShaderLocationIndex.MapEmission] = GetShaderLocation(shader, "mask");
// Frame is incremented each frame to animate the shader
int shaderFrame = GetShaderLocation(shader, "framesCounter");
@@ -113,31 +113,31 @@ public class SimpleMask
rotation.Z -= 0.0025f;
// Send frames counter to shader for animation
- Raylib.SetShaderValue(shader, shaderFrame, framesCounter, ShaderUniformDataType.SHADER_UNIFORM_INT);
+ Raylib.SetShaderValue(shader, shaderFrame, framesCounter, ShaderUniformDataType.Int);
// Rotate one of the models
model1.Transform = MatrixRotateXYZ(rotation);
- UpdateCamera(ref camera, CameraMode.CAMERA_CUSTOM);
+ UpdateCamera(ref camera, CameraMode.Custom);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.DARKBLUE);
+ ClearBackground(Color.DarkBlue);
BeginMode3D(camera);
- DrawModel(model1, new Vector3(0.5f, 0, 0), 1, Color.WHITE);
- DrawModelEx(model2, new Vector3(-.5f, 0, 0), new Vector3(1, 1, 0), 50, new Vector3(1, 1, 1), Color.WHITE);
- DrawModel(model3, new Vector3(0, 0, -1.5f), 1, Color.WHITE);
+ DrawModel(model1, new Vector3(0.5f, 0, 0), 1, Color.White);
+ DrawModelEx(model2, new Vector3(-.5f, 0, 0), new Vector3(1, 1, 0), 50, new Vector3(1, 1, 1), Color.White);
+ DrawModel(model3, new Vector3(0, 0, -1.5f), 1, Color.White);
DrawGrid(10, 1.0f);
EndMode3D();
string frameText = $"Frame: {framesCounter}";
- DrawRectangle(16, 698, MeasureText(frameText, 20) + 8, 42, Color.BLUE);
- DrawText(frameText, 20, 700, 20, Color.WHITE);
+ DrawRectangle(16, 698, MeasureText(frameText, 20) + 8, 42, Color.Blue);
+ DrawText(frameText, 20, 700, 20, Color.White);
DrawFPS(10, 10);
diff --git a/Examples/Shaders/Spotlight.cs b/Examples/Shaders/Spotlight.cs
index 7d0307a..cf86e3a 100644
--- a/Examples/Shaders/Spotlight.cs
+++ b/Examples/Shaders/Spotlight.cs
@@ -111,7 +111,7 @@ public class Spotlight
// a pitch Color.black half and a dimly lit half.
int wLoc = GetShaderLocation(shdrSpot, "screenWidth");
float sw = (float)GetScreenWidth();
- Raylib.SetShaderValue(shdrSpot, wLoc, sw, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shdrSpot, wLoc, sw, ShaderUniformDataType.Float);
// Randomise the locations and velocities of the spotlights
// and initialise the shader locations
@@ -134,19 +134,19 @@ public class Spotlight
shdrSpot,
spots[i].posLoc,
spots[i].pos,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
Raylib.SetShaderValue(
shdrSpot,
spots[i].innerLoc,
spots[i].inner,
- ShaderUniformDataType.SHADER_UNIFORM_FLOAT
+ ShaderUniformDataType.Float
);
Raylib.SetShaderValue(
shdrSpot,
spots[i].radiusLoc,
spots[i].radius,
- ShaderUniformDataType.SHADER_UNIFORM_FLOAT
+ ShaderUniformDataType.Float
);
}
@@ -205,20 +205,20 @@ public class Spotlight
shdrSpot,
spots[i].posLoc,
spots[i].pos,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
}
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.DARKBLUE);
+ ClearBackground(Color.DarkBlue);
// Draw stars and bobs
for (int n = 0; n < MaxStars; n++)
{
// MathF.Single pixel is just too small these days!
- DrawRectangle((int)stars[n].pos.X, (int)stars[n].pos.Y, 2, 2, Color.WHITE);
+ DrawRectangle((int)stars[n].pos.X, (int)stars[n].pos.Y, 2, 2, Color.White);
}
for (int i = 0; i < 16; i++)
@@ -227,7 +227,7 @@ public class Spotlight
texRay,
(int)((screenWidth / 2.0) + MathF.Cos((frameCounter + i * 8) / 51.45f) * (screenWidth / 2.2) - 32),
(int)((screenHeight / 2.0) + MathF.Sin((frameCounter + i * 8) / 17.87f) * (screenHeight / 4.2)),
- Color.WHITE
+ Color.White
);
}
@@ -236,14 +236,14 @@ public class Spotlight
// Instead of a blank rectangle you could render a render texture of the full screen used to do screen
// scaling (slight adjustment to shader would be required to actually pay attention to the colour!)
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.WHITE);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.White);
EndShaderMode();
DrawFPS(10, 10);
- DrawText("Move the mouse!", 10, 30, 20, Color.GREEN);
- DrawText("Pitch Color.Black", (int)(screenWidth * 0.2f), screenHeight / 2, 20, Color.GREEN);
- DrawText("Dark", (int)(screenWidth * 0.66f), screenHeight / 2, 20, Color.GREEN);
+ DrawText("Move the mouse!", 10, 30, 20, Color.Green);
+ DrawText("Pitch Color.Black", (int)(screenWidth * 0.2f), screenHeight / 2, 20, Color.Green);
+ DrawText("Dark", (int)(screenWidth * 0.66f), screenHeight / 2, 20, Color.Green);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shaders/TextureDrawing.cs b/Examples/Shaders/TextureDrawing.cs
index 56d49ae..001e900 100644
--- a/Examples/Shaders/TextureDrawing.cs
+++ b/Examples/Shaders/TextureDrawing.cs
@@ -31,7 +31,7 @@ public class TextureDrawing
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - texture drawing");
// Load blank texture to fill on shader
- Image imBlank = GenImageColor(1024, 1024, Color.BLANK);
+ Image imBlank = GenImageColor(1024, 1024, Color.Blank);
Texture2D texture = LoadTextureFromImage(imBlank);
UnloadImage(imBlank);
@@ -40,7 +40,7 @@ public class TextureDrawing
float time = 0.0f;
int timeLoc = GetShaderLocation(shader, "uTime");
- Raylib.SetShaderValue(shader, timeLoc, time, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, timeLoc, time, ShaderUniformDataType.Float);
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -51,24 +51,24 @@ public class TextureDrawing
// Update
//----------------------------------------------------------------------------------
time = (float)GetTime();
- Raylib.SetShaderValue(shader, timeLoc, time, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, timeLoc, time, ShaderUniformDataType.Float);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Enable our custom shader for next shapes/textures drawings
BeginShaderMode(shader);
// Drawing blank texture, all magic happens on shader
- DrawTexture(texture, 0, 0, Color.WHITE);
+ DrawTexture(texture, 0, 0, Color.White);
// Disable our custom shader, return to default shader
EndShaderMode();
- DrawText("BACKGROUND is PAINTED and ANIMATED on SHADER!", 10, 10, 20, Color.MAROON);
+ DrawText("BACKGROUND is PAINTED and ANIMATED on SHADER!", 10, 10, 20, Color.Maroon);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shaders/TextureOutline.cs b/Examples/Shaders/TextureOutline.cs
index 3993610..4023d5c 100644
--- a/Examples/Shaders/TextureOutline.cs
+++ b/Examples/Shaders/TextureOutline.cs
@@ -49,19 +49,19 @@ public class TextureOutline
shdrOutline,
outlineSizeLoc,
outlineSize,
- ShaderUniformDataType.SHADER_UNIFORM_FLOAT
+ ShaderUniformDataType.Float
);
Raylib.SetShaderValue(
shdrOutline,
outlineColorLoc,
outlineColor,
- ShaderUniformDataType.SHADER_UNIFORM_VEC4
+ ShaderUniformDataType.Vec4
);
Raylib.SetShaderValue(
shdrOutline,
textureSizeLoc,
textureSize,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
SetTargetFPS(60);
@@ -82,7 +82,7 @@ public class TextureOutline
shdrOutline,
outlineSizeLoc,
outlineSize,
- ShaderUniformDataType.SHADER_UNIFORM_FLOAT
+ ShaderUniformDataType.Float
);
//----------------------------------------------------------------------------------
@@ -90,15 +90,15 @@ public class TextureOutline
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginShaderMode(shdrOutline);
- DrawTexture(texture, GetScreenWidth() / 2 - texture.Width / 2, -30, Color.WHITE);
+ DrawTexture(texture, GetScreenWidth() / 2 - texture.Width / 2, -30, Color.White);
EndShaderMode();
- DrawText("Shader-based\ntexture\noutline", 10, 10, 20, Color.GRAY);
+ DrawText("Shader-based\ntexture\noutline", 10, 10, 20, Color.Gray);
- DrawText($"Outline size: {outlineSize} px", 10, 120, 20, Color.MAROON);
+ DrawText($"Outline size: {outlineSize} px", 10, 120, 20, Color.Maroon);
DrawFPS(710, 10);
diff --git a/Examples/Shaders/TextureWaves.cs b/Examples/Shaders/TextureWaves.cs
index 35d2051..8446a92 100644
--- a/Examples/Shaders/TextureWaves.cs
+++ b/Examples/Shaders/TextureWaves.cs
@@ -62,14 +62,14 @@ public class TextureWaves
shader,
GetShaderLocation(shader, "size"),
screenSize,
- ShaderUniformDataType.SHADER_UNIFORM_VEC2
+ ShaderUniformDataType.Vec2
);
- Raylib.SetShaderValue(shader, freqXLoc, freqX, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, freqYLoc, freqY, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, ampXLoc, ampX, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, ampYLoc, ampY, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, speedXLoc, speedX, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
- Raylib.SetShaderValue(shader, speedYLoc, speedY, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, freqXLoc, freqX, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, freqYLoc, freqY, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, ampXLoc, ampX, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, ampYLoc, ampY, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, speedXLoc, speedX, ShaderUniformDataType.Float);
+ Raylib.SetShaderValue(shader, speedYLoc, speedY, ShaderUniformDataType.Float);
float seconds = 0.0f;
@@ -83,18 +83,18 @@ public class TextureWaves
//----------------------------------------------------------------------------------
seconds += GetFrameTime();
- Raylib.SetShaderValue(shader, secondsLoc, seconds, ShaderUniformDataType.SHADER_UNIFORM_FLOAT);
+ Raylib.SetShaderValue(shader, secondsLoc, seconds, ShaderUniformDataType.Float);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
BeginShaderMode(shader);
- DrawTexture(texture, 0, 0, Color.WHITE);
- DrawTexture(texture, texture.Width, 0, Color.WHITE);
+ DrawTexture(texture, 0, 0, Color.White);
+ DrawTexture(texture, texture.Width, 0, Color.White);
EndShaderMode();
diff --git a/Examples/Shaders/WriteDepth.cs b/Examples/Shaders/WriteDepth.cs
index eaaf954..193c573 100644
--- a/Examples/Shaders/WriteDepth.cs
+++ b/Examples/Shaders/WriteDepth.cs
@@ -43,27 +43,27 @@ public class WriteDepth
camera.Target = new Vector3(0.0f, 0.5f, 0.0f);
camera.Up = new Vector3(0.0f, 1.0f, 0.0f);
camera.FovY = 45.0f;
- camera.Projection = CameraProjection.CAMERA_PERSPECTIVE;
+ camera.Projection = CameraProjection.Perspective;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
- UpdateCamera(ref camera, CameraMode.CAMERA_ORBITAL);
+ UpdateCamera(ref camera, CameraMode.Orbital);
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
// Draw into our custom render texture (framebuffer)
BeginTextureMode(target);
- ClearBackground(Color.WHITE);
+ ClearBackground(Color.White);
BeginMode3D(camera);
BeginShaderMode(shader);
- DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.RED);
- DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.PURPLE);
- DrawCubeWiresV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.DARKGREEN);
- DrawCubeV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.YELLOW);
+ DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Red);
+ DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Purple);
+ DrawCubeWiresV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.DarkGreen);
+ DrawCubeV(new Vector3(0.0f, 0.5f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Yellow);
DrawGrid(10, 1.0f);
EndShaderMode();
@@ -72,13 +72,13 @@ public class WriteDepth
// Draw custom render texture
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawTextureRec(
target.Texture,
new Rectangle(0, 0, screenWidth, -screenHeight),
Vector2.Zero,
- Color.WHITE
+ Color.White
);
DrawFPS(10, 10);
@@ -113,48 +113,48 @@ public class WriteDepth
null,
width,
height,
- PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ PixelFormat.UncompressedR8G8B8A8,
1
);
target.Texture.Width = width;
target.Texture.Height = height;
- target.Texture.Format = PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8;
+ target.Texture.Format = PixelFormat.UncompressedR8G8B8A8;
target.Texture.Mipmaps = 1;
// Create depth texture buffer (instead of raylib default renderbuffer)
target.Depth.Id = Rlgl.LoadTextureDepth(width, height, false);
target.Depth.Width = width;
target.Depth.Height = height;
- target.Depth.Format = PixelFormat.PIXELFORMAT_COMPRESSED_PVRT_RGBA;
+ target.Depth.Format = PixelFormat.CompressedPvrtRgba;
target.Depth.Mipmaps = 1;
// Attach color texture and depth texture to FBO
Rlgl.FramebufferAttach(
target.Id,
target.Texture.Id,
- FramebufferAttachType.RL_ATTACHMENT_COLOR_CHANNEL0,
- FramebufferAttachTextureType.RL_ATTACHMENT_TEXTURE2D,
+ FramebufferAttachType.ColorChannel0,
+ FramebufferAttachTextureType.Texture2D,
0
);
Rlgl.FramebufferAttach(
target.Id,
target.Depth.Id,
- FramebufferAttachType.RL_ATTACHMENT_DEPTH,
- FramebufferAttachTextureType.RL_ATTACHMENT_TEXTURE2D,
+ FramebufferAttachType.Depth,
+ FramebufferAttachTextureType.Texture2D,
0
);
// Check if fbo is complete with attachments (valid)
if (Rlgl.FramebufferComplete(target.Id))
{
- TraceLog(TraceLogLevel.LOG_INFO, $"FBO: [ID {target.Id}] Framebuffer object created successfully");
+ TraceLog(TraceLogLevel.Info, $"FBO: [ID {target.Id}] Framebuffer object created successfully");
}
Rlgl.DisableFramebuffer();
}
else
{
- TraceLog(TraceLogLevel.LOG_WARNING, "FBO: Framebuffer object can not be created");
+ TraceLog(TraceLogLevel.Warning, "FBO: Framebuffer object can not be created");
}
return target;
diff --git a/Examples/Shapes/BasicShapes.cs b/Examples/Shapes/BasicShapes.cs
index e02587b..ead53d9 100644
--- a/Examples/Shapes/BasicShapes.cs
+++ b/Examples/Shapes/BasicShapes.cs
@@ -39,33 +39,33 @@ public class BasicShapes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("some basic shapes available on raylib", 20, 20, 20, Color.DARKGRAY);
+ DrawText("some basic shapes available on raylib", 20, 20, 20, Color.DarkGray);
- DrawLine(18, 42, screenWidth - 18, 42, Color.BLACK);
+ DrawLine(18, 42, screenWidth - 18, 42, Color.Black);
- DrawCircle(screenWidth / 4, 120, 35, Color.DARKBLUE);
- DrawCircleGradient(screenWidth / 4, 220, 60, Color.GREEN, Color.SKYBLUE);
- DrawCircleLines(screenWidth / 4, 340, 80, Color.DARKBLUE);
+ DrawCircle(screenWidth / 4, 120, 35, Color.DarkBlue);
+ DrawCircleGradient(screenWidth / 4, 220, 60, Color.Green, Color.SkyBlue);
+ DrawCircleLines(screenWidth / 4, 340, 80, Color.DarkBlue);
- DrawRectangle(screenWidth / 4 * 2 - 60, 100, 120, 60, Color.RED);
- DrawRectangleGradientH(screenWidth / 4 * 2 - 90, 170, 180, 130, Color.MAROON, Color.GOLD);
- DrawRectangleLines(screenWidth / 4 * 2 - 40, 320, 80, 60, Color.ORANGE);
+ DrawRectangle(screenWidth / 4 * 2 - 60, 100, 120, 60, Color.Red);
+ DrawRectangleGradientH(screenWidth / 4 * 2 - 90, 170, 180, 130, Color.Maroon, Color.Gold);
+ DrawRectangleLines(screenWidth / 4 * 2 - 40, 320, 80, 60, Color.Orange);
DrawTriangle(
new Vector2(screenWidth / 4 * 3, 80),
new Vector2(screenWidth / 4 * 3 - 60, 150),
- new Vector2(screenWidth / 4 * 3 + 60, 150), Color.VIOLET
+ new Vector2(screenWidth / 4 * 3 + 60, 150), Color.Violet
);
DrawTriangleLines(
new Vector2(screenWidth / 4 * 3, 160),
new Vector2(screenWidth / 4 * 3 - 20, 230),
- new Vector2(screenWidth / 4 * 3 + 20, 230), Color.DARKBLUE
+ new Vector2(screenWidth / 4 * 3 + 20, 230), Color.DarkBlue
);
- DrawPoly(new Vector2(screenWidth / 4 * 3, 320), 6, 80, 0, Color.BROWN);
+ DrawPoly(new Vector2(screenWidth / 4 * 3, 320), 6, 80, 0, Color.Brown);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shapes/BouncingBall.cs b/Examples/Shapes/BouncingBall.cs
index bef8b8e..0771ef1 100644
--- a/Examples/Shapes/BouncingBall.cs
+++ b/Examples/Shapes/BouncingBall.cs
@@ -40,7 +40,7 @@ public class BouncingBall
{
// Update
//-----------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
pause = !pause;
}
@@ -69,15 +69,15 @@ public class BouncingBall
// Draw
//-----------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawCircleV(ballPosition, ballRadius, Color.MAROON);
- DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, Color.LIGHTGRAY);
+ DrawCircleV(ballPosition, ballRadius, Color.Maroon);
+ DrawText("PRESS SPACE to PAUSE BALL MOVEMENT", 10, GetScreenHeight() - 25, 20, Color.LightGray);
// On pause, we draw a blinking message
if (pause && ((framesCounter / 30) % 2) == 0)
{
- DrawText("PAUSED", 350, 200, 30, Color.GRAY);
+ DrawText("PAUSED", 350, 200, 30, Color.Gray);
}
DrawFPS(10, 10);
diff --git a/Examples/Shapes/CollisionArea.cs b/Examples/Shapes/CollisionArea.cs
index 2325ee2..05ba2f0 100644
--- a/Examples/Shapes/CollisionArea.cs
+++ b/Examples/Shapes/CollisionArea.cs
@@ -91,7 +91,7 @@ public class CollisionArea
}
// Pause Box A movement
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
pause = !pause;
}
@@ -100,26 +100,26 @@ public class CollisionArea
// Draw
//-----------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawRectangle(0, 0, screenWidth, screenUpperLimit, collision ? Color.RED : Color.BLACK);
+ DrawRectangle(0, 0, screenWidth, screenUpperLimit, collision ? Color.Red : Color.Black);
- DrawRectangleRec(boxA, Color.GOLD);
- DrawRectangleRec(boxB, Color.BLUE);
+ DrawRectangleRec(boxA, Color.Gold);
+ DrawRectangleRec(boxB, Color.Blue);
if (collision)
{
// Draw collision area
- DrawRectangleRec(boxCollision, Color.LIME);
+ DrawRectangleRec(boxCollision, Color.Lime);
// Draw collision message
int cx = GetScreenWidth() / 2 - MeasureText("COLLISION!", 20) / 2;
int cy = screenUpperLimit / 2 - 10;
- DrawText("COLLISION!", cx, cy, 20, Color.BLACK);
+ DrawText("COLLISION!", cx, cy, 20, Color.Black);
// Draw collision area
string text = $"Collision Area: {(int)boxCollision.Width * (int)boxCollision.Height}";
- DrawText(text, GetScreenWidth() / 2 - 100, screenUpperLimit + 10, 20, Color.BLACK);
+ DrawText(text, GetScreenWidth() / 2 - 100, screenUpperLimit + 10, 20, Color.Black);
}
DrawFPS(10, 10);
diff --git a/Examples/Shapes/ColorsPalette.cs b/Examples/Shapes/ColorsPalette.cs
index 94d2bdd..bb3a9c2 100644
--- a/Examples/Shapes/ColorsPalette.cs
+++ b/Examples/Shapes/ColorsPalette.cs
@@ -27,27 +27,27 @@ public class ColorsPalette
Color[] colors = new[]
{
- Color.DARKGRAY,
- Color.MAROON,
- Color.ORANGE,
- Color.DARKGREEN,
- Color.DARKBLUE,
- Color.DARKPURPLE,
- Color.DARKBROWN,
- Color.GRAY,
- Color.RED,
- Color.GOLD,
- Color.LIME,
- Color.BLUE,
- Color.VIOLET,
- Color.BROWN,
- Color.LIGHTGRAY,
- Color.PINK,
- Color.YELLOW,
- Color.GREEN,
- Color.SKYBLUE,
- Color.PURPLE,
- Color.BEIGE
+ Color.DarkGray,
+ Color.Maroon,
+ Color.Orange,
+ Color.DarkGreen,
+ Color.DarkBlue,
+ Color.DarkPurple,
+ Color.DarkBrown,
+ Color.Gray,
+ Color.Red,
+ Color.Gold,
+ Color.Lime,
+ Color.Blue,
+ Color.Violet,
+ Color.Brown,
+ Color.LightGray,
+ Color.Pink,
+ Color.Yellow,
+ Color.Green,
+ Color.SkyBlue,
+ Color.Purple,
+ Color.Beige
};
string[] colorNames = new[]
@@ -118,15 +118,15 @@ public class ColorsPalette
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("raylib colors palette", 28, 42, 20, Color.BLACK);
+ DrawText("raylib colors palette", 28, 42, 20, Color.Black);
DrawText(
"press SPACE to see all colors",
GetScreenWidth() - 180,
GetScreenHeight() - 40,
10,
- Color.GRAY
+ Color.Gray
);
// Draw all rectangles
@@ -134,16 +134,16 @@ public class ColorsPalette
{
DrawRectangleRec(colorsRecs[i], ColorAlpha(colors[i], colorState[i] != 0 ? 0.6f : 1.0f));
- if (IsKeyDown(KeyboardKey.KEY_SPACE) || colorState[i] != 0)
+ if (IsKeyDown(KeyboardKey.Space) || colorState[i] != 0)
{
DrawRectangle(
(int)colorsRecs[i].X,
(int)(colorsRecs[i].Y + colorsRecs[i].Height - 26),
(int)colorsRecs[i].Width,
20,
- Color.BLACK
+ Color.Black
);
- DrawRectangleLinesEx(colorsRecs[i], 6, ColorAlpha(Color.BLACK, 0.3f));
+ DrawRectangleLinesEx(colorsRecs[i], 6, ColorAlpha(Color.Black, 0.3f));
DrawText(
colorNames[i],
(int)(colorsRecs[i].X + colorsRecs[i].Width - MeasureText(colorNames[i], 10) - 12),
diff --git a/Examples/Shapes/DrawCircleSector.cs b/Examples/Shapes/DrawCircleSector.cs
index b52e91a..7178fc3 100644
--- a/Examples/Shapes/DrawCircleSector.cs
+++ b/Examples/Shapes/DrawCircleSector.cs
@@ -50,19 +50,19 @@ public class DrawCircleSector
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
- DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
+ DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
+ DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
- DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, ColorAlpha(Color.MAROON, 0.3f));
+ DrawCircleSector(center, outerRadius, startAngle, endAngle, segments, ColorAlpha(Color.Maroon, 0.3f));
DrawCircleSectorLines(
center,
outerRadius,
startAngle,
endAngle,
segments,
- ColorAlpha(Color.MAROON, 0.6f)
+ ColorAlpha(Color.Maroon, 0.6f)
);
// Draw GUI controls
@@ -75,7 +75,7 @@ public class DrawCircleSector
//------------------------------------------------------------------------------
minSegments = (int)MathF.Ceiling((endAngle - startAngle) / 90);
- Color color = (segments >= minSegments) ? Color.MAROON : Color.DARKGRAY;
+ Color color = (segments >= minSegments) ? Color.Maroon : Color.DarkGray;
DrawText($"MODE: {((segments >= minSegments) ? "MANUAL" : "AUTO")}", 600, 270, 10, color);
DrawFPS(10, 10);
diff --git a/Examples/Shapes/DrawRectangleRounded.cs b/Examples/Shapes/DrawRectangleRounded.cs
index cf7eb54..b46f926 100644
--- a/Examples/Shapes/DrawRectangleRounded.cs
+++ b/Examples/Shapes/DrawRectangleRounded.cs
@@ -55,22 +55,22 @@ public class DrawRectangleRounded
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawLine(560, 0, 560, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
- DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
+ DrawLine(560, 0, 560, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
+ DrawRectangle(560, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
if (drawRect)
{
- DrawRectangleRec(rec, ColorAlpha(Color.GOLD, 0.6f));
+ DrawRectangleRec(rec, ColorAlpha(Color.Gold, 0.6f));
}
if (drawRoundedRect)
{
- DrawRectangleRounded(rec, roundness, segments, ColorAlpha(Color.MAROON, 0.2f));
+ DrawRectangleRounded(rec, roundness, segments, ColorAlpha(Color.Maroon, 0.2f));
}
if (drawRoundedLines)
{
- DrawRectangleRoundedLines(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.MAROON, 0.4f));
+ DrawRectangleRoundedLines(rec, roundness, segments, (float)lineThick, ColorAlpha(Color.Maroon, 0.4f));
}
// Draw GUI controls
@@ -87,7 +87,7 @@ public class DrawRectangleRounded
//------------------------------------------------------------------------------
string text = $"MODE: {((segments >= 4) ? "MANUAL" : "AUTO")}";
- DrawText(text, 640, 280, 10, (segments >= 4) ? Color.MAROON : Color.DARKGRAY);
+ DrawText(text, 640, 280, 10, (segments >= 4) ? Color.Maroon : Color.DarkGray);
DrawFPS(10, 10);
EndDrawing();
diff --git a/Examples/Shapes/DrawRing.cs b/Examples/Shapes/DrawRing.cs
index e4eaf29..2a53ce7 100644
--- a/Examples/Shapes/DrawRing.cs
+++ b/Examples/Shapes/DrawRing.cs
@@ -56,10 +56,10 @@ public class DrawRing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.6f));
- DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LIGHTGRAY, 0.3f));
+ DrawLine(500, 0, 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.6f));
+ DrawRectangle(500, 0, GetScreenWidth() - 500, GetScreenHeight(), ColorAlpha(Color.LightGray, 0.3f));
if (drawRing)
{
@@ -70,7 +70,7 @@ public class DrawRing
startAngle,
endAngle,
segments,
- ColorAlpha(Color.MAROON, 0.3f)
+ ColorAlpha(Color.Maroon, 0.3f)
);
}
if (drawRingLines)
@@ -82,7 +82,7 @@ public class DrawRing
startAngle,
endAngle,
segments,
- ColorAlpha(Color.BLACK, 0.4f)
+ ColorAlpha(Color.Black, 0.4f)
);
}
if (drawCircleLines)
@@ -93,7 +93,7 @@ public class DrawRing
startAngle,
endAngle,
segments,
- ColorAlpha(Color.BLACK, 0.4f)
+ ColorAlpha(Color.Black, 0.4f)
);
}
@@ -113,7 +113,7 @@ public class DrawRing
//------------------------------------------------------------------------------
minSegments = (int)MathF.Ceiling((endAngle - startAngle) / 90);
- Color color = (segments >= minSegments) ? Color.MAROON : Color.DARKGRAY;
+ Color color = (segments >= minSegments) ? Color.Maroon : Color.DarkGray;
DrawText($"MODE: {((segments >= minSegments) ? "MANUAL" : "AUTO")}", 600, 270, 10, color);
DrawFPS(10, 10);
diff --git a/Examples/Shapes/EasingsBallAnim.cs b/Examples/Shapes/EasingsBallAnim.cs
index cdb7bb5..1052e8a 100644
--- a/Examples/Shapes/EasingsBallAnim.cs
+++ b/Examples/Shapes/EasingsBallAnim.cs
@@ -79,7 +79,7 @@ public class EasingsBallAnim
// Reset state to play again
else if (state == 3)
{
- if (IsKeyPressed(KeyboardKey.KEY_ENTER))
+ if (IsKeyPressed(KeyboardKey.Enter))
{
// Reset required variables to play again
ballPositionX = -100;
@@ -89,7 +89,7 @@ public class EasingsBallAnim
}
}
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
framesCounter = 0;
}
@@ -98,18 +98,18 @@ public class EasingsBallAnim
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (state >= 2)
{
- DrawRectangle(0, 0, screenWidth, screenHeight, Color.GREEN);
+ DrawRectangle(0, 0, screenWidth, screenHeight, Color.Green);
}
- DrawCircle(ballPositionX, 200, ballRadius, ColorAlpha(Color.RED, 1.0f - ballAlpha));
+ DrawCircle(ballPositionX, 200, ballRadius, ColorAlpha(Color.Red, 1.0f - ballAlpha));
if (state == 3)
{
- DrawText("PRESS [ENTER] TO PLAY AGAIN!", 240, 200, 20, Color.BLACK);
+ DrawText("PRESS [ENTER] TO PLAY AGAIN!", 240, 200, 20, Color.Black);
}
EndDrawing();
diff --git a/Examples/Shapes/EasingsBoxAnim.cs b/Examples/Shapes/EasingsBoxAnim.cs
index b302066..ce07558 100644
--- a/Examples/Shapes/EasingsBoxAnim.cs
+++ b/Examples/Shapes/EasingsBoxAnim.cs
@@ -108,7 +108,7 @@ public class EasingsBoxAnim
}
// Reset animation at any moment
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
rec = new Rectangle(GetScreenWidth() / 2, -100, 100, 100);
rotation = 0.0f;
@@ -121,15 +121,15 @@ public class EasingsBoxAnim
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawRectanglePro(
rec,
new Vector2(rec.Width / 2, rec.Height / 2),
rotation,
- ColorAlpha(Color.BLACK, alpha)
+ ColorAlpha(Color.Black, alpha)
);
- DrawText("PRESS [SPACE] TO RESET BOX ANIMATION!", 10, GetScreenHeight() - 25, 20, Color.LIGHTGRAY);
+ DrawText("PRESS [SPACE] TO RESET BOX ANIMATION!", 10, GetScreenHeight() - 25, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shapes/EasingsRectangleArray.cs b/Examples/Shapes/EasingsRectangleArray.cs
index 1eaee2c..6e74f52 100644
--- a/Examples/Shapes/EasingsRectangleArray.cs
+++ b/Examples/Shapes/EasingsRectangleArray.cs
@@ -90,7 +90,7 @@ public class EasingsRectangleArray
rotation = Easings.EaseLinearIn(framesCounter, 0.0f, 360.0f, PlayTimeInFrames);
}
}
- else if ((state == 1) && IsKeyPressed(KeyboardKey.KEY_SPACE))
+ else if ((state == 1) && IsKeyPressed(KeyboardKey.Space))
{
// When animation has finished, press space to restart
framesCounter = 0;
@@ -108,7 +108,7 @@ public class EasingsRectangleArray
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (state == 0)
{
@@ -118,13 +118,13 @@ public class EasingsRectangleArray
recs[i],
new Vector2(recs[i].Width / 2, recs[i].Height / 2),
rotation,
- Color.RED
+ Color.Red
);
}
}
else if (state == 1)
{
- DrawText("PRESS [SPACE] TO PLAY AGAIN!", 240, 200, 20, Color.GRAY);
+ DrawText("PRESS [SPACE] TO PLAY AGAIN!", 240, 200, 20, Color.Gray);
}
EndDrawing();
diff --git a/Examples/Shapes/FollowingEyes.cs b/Examples/Shapes/FollowingEyes.cs
index 5e0c83b..80ea28b 100644
--- a/Examples/Shapes/FollowingEyes.cs
+++ b/Examples/Shapes/FollowingEyes.cs
@@ -82,15 +82,15 @@ public class FollowingEyes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawCircleV(scleraLeftPosition, scleraRadius, Color.LIGHTGRAY);
- DrawCircleV(irisLeftPosition, irisRadius, Color.BROWN);
- DrawCircleV(irisLeftPosition, 10, Color.BLACK);
+ DrawCircleV(scleraLeftPosition, scleraRadius, Color.LightGray);
+ DrawCircleV(irisLeftPosition, irisRadius, Color.Brown);
+ DrawCircleV(irisLeftPosition, 10, Color.Black);
- DrawCircleV(scleraRightPosition, scleraRadius, Color.LIGHTGRAY);
- DrawCircleV(irisRightPosition, irisRadius, Color.DARKGREEN);
- DrawCircleV(irisRightPosition, 10, Color.BLACK);
+ DrawCircleV(scleraRightPosition, scleraRadius, Color.LightGray);
+ DrawCircleV(irisRightPosition, irisRadius, Color.DarkGreen);
+ DrawCircleV(irisRightPosition, 10, Color.Black);
DrawFPS(10, 10);
diff --git a/Examples/Shapes/LinesBezier.cs b/Examples/Shapes/LinesBezier.cs
index f70a48a..7861de4 100644
--- a/Examples/Shapes/LinesBezier.cs
+++ b/Examples/Shapes/LinesBezier.cs
@@ -23,7 +23,7 @@ public class LinesBezier
const int screenWidth = 800;
const int screenHeight = 450;
- SetConfigFlags(ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [shapes] example - cubic-bezier lines");
Vector2 start = new(0, 0);
@@ -37,11 +37,11 @@ public class LinesBezier
{
// Update
//----------------------------------------------------------------------------------
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left))
{
start = GetMousePosition();
}
- else if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
+ else if (IsMouseButtonDown(MouseButton.Right))
{
end = GetMousePosition();
}
@@ -50,10 +50,10 @@ public class LinesBezier
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, Color.GRAY);
- DrawLineBezier(start, end, 2.0f, Color.RED);
+ DrawText("USE MOUSE LEFT-RIGHT CLICK to DEFINE LINE START and END POINTS", 15, 20, 20, Color.Gray);
+ DrawLineBezier(start, end, 2.0f, Color.Red);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shapes/LogoRaylibAnim.cs b/Examples/Shapes/LogoRaylibAnim.cs
index 590997c..7309e5b 100644
--- a/Examples/Shapes/LogoRaylibAnim.cs
+++ b/Examples/Shapes/LogoRaylibAnim.cs
@@ -113,7 +113,7 @@ public class LogoRaylibAnim
// State 4: Reset and Replay
else if (state == 4)
{
- if (IsKeyPressed(KeyboardKey.KEY_R))
+ if (IsKeyPressed(KeyboardKey.R))
{
framesCounter = 0;
lettersCount = 0;
@@ -134,7 +134,7 @@ public class LogoRaylibAnim
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (state == 0)
{
@@ -165,7 +165,7 @@ public class LogoRaylibAnim
DrawRectangle(logoPositionX + 240, logoPositionY + 16, 16, rightSideRecHeight - 32, outlineFade);
DrawRectangle(logoPositionX, logoPositionY + 240, bottomSideRecWidth, 16, outlineFade);
- Color whiteFade = ColorAlpha(Color.RAYWHITE, alpha);
+ Color whiteFade = ColorAlpha(Color.RayWhite, alpha);
DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, whiteFade);
Color label = ColorAlpha(new Color(155, 79, 151, 255), alpha);
@@ -176,7 +176,7 @@ public class LogoRaylibAnim
}
else if (state == 4)
{
- DrawText("[R] REPLAY", 340, 200, 20, Color.GRAY);
+ DrawText("[R] REPLAY", 340, 200, 20, Color.Gray);
}
EndDrawing();
diff --git a/Examples/Shapes/LogoRaylibShape.cs b/Examples/Shapes/LogoRaylibShape.cs
index f0c109a..341f330 100644
--- a/Examples/Shapes/LogoRaylibShape.cs
+++ b/Examples/Shapes/LogoRaylibShape.cs
@@ -38,14 +38,14 @@ public class LogoRaylibShape
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawRectangle(screenWidth / 2 - 128, screenHeight / 2 - 128, 256, 256, new Color(139, 71, 135, 255));
- DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, Color.RAYWHITE);
+ DrawRectangle(screenWidth / 2 - 112, screenHeight / 2 - 112, 224, 224, Color.RayWhite);
DrawText("raylib", screenWidth / 2 - 44, screenHeight / 2 + 28, 50, new Color(155, 79, 151, 255));
DrawText("cs", screenWidth / 2 - 44, screenHeight / 2 + 58, 50, new Color(155, 79, 151, 255));
- DrawText("this is NOT a texture!", 350, 370, 10, Color.GRAY);
+ DrawText("this is NOT a texture!", 350, 370, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Shapes/RectangleScaling.cs b/Examples/Shapes/RectangleScaling.cs
index cb180ce..36c279b 100644
--- a/Examples/Shapes/RectangleScaling.cs
+++ b/Examples/Shapes/RectangleScaling.cs
@@ -56,7 +56,7 @@ public class RectangleScaling
CheckCollisionPointRec(mousePosition, area))
{
mouseScaleReady = true;
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
mouseScaleMode = true;
}
@@ -82,7 +82,7 @@ public class RectangleScaling
rec.Height = MOUSE_SCALE_MARK_SIZE;
}
- if (IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonReleased(MouseButton.Left))
{
mouseScaleMode = false;
}
@@ -92,19 +92,19 @@ public class RectangleScaling
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Scale rectangle dragging from bottom-right corner!", 10, 10, 20, Color.GRAY);
- DrawRectangleRec(rec, ColorAlpha(Color.GREEN, 0.5f));
+ DrawText("Scale rectangle dragging from bottom-right corner!", 10, 10, 20, Color.Gray);
+ DrawRectangleRec(rec, ColorAlpha(Color.Green, 0.5f));
if (mouseScaleReady)
{
- DrawRectangleLinesEx(rec, 1, Color.RED);
+ DrawRectangleLinesEx(rec, 1, Color.Red);
DrawTriangle(
new Vector2(rec.X + rec.Width - MOUSE_SCALE_MARK_SIZE, rec.Y + rec.Height),
new Vector2(rec.X + rec.Width, rec.Y + rec.Height),
new Vector2(rec.X + rec.Width, rec.Y + rec.Height - MOUSE_SCALE_MARK_SIZE),
- Color.RED
+ Color.Red
);
}
diff --git a/Examples/Shared/Rlights.cs b/Examples/Shared/Rlights.cs
index 41daf04..729b25f 100644
--- a/Examples/Shared/Rlights.cs
+++ b/Examples/Shared/Rlights.cs
@@ -67,15 +67,15 @@ public static class Rlights
shader,
light.EnabledLoc,
light.Enabled ? 1 : 0,
- ShaderUniformDataType.SHADER_UNIFORM_INT
+ ShaderUniformDataType.Int
);
- Raylib.SetShaderValue(shader, light.TypeLoc, (int)light.Type, ShaderUniformDataType.SHADER_UNIFORM_INT);
+ Raylib.SetShaderValue(shader, light.TypeLoc, (int)light.Type, ShaderUniformDataType.Int);
// Send to shader light target position values
- Raylib.SetShaderValue(shader, light.PosLoc, light.Position, ShaderUniformDataType.SHADER_UNIFORM_VEC3);
+ Raylib.SetShaderValue(shader, light.PosLoc, light.Position, ShaderUniformDataType.Vec3);
// Send to shader light target position values
- Raylib.SetShaderValue(shader, light.TargetLoc, light.Target, ShaderUniformDataType.SHADER_UNIFORM_VEC3);
+ Raylib.SetShaderValue(shader, light.TargetLoc, light.Target, ShaderUniformDataType.Vec3);
// Send to shader light color values
float[] color = new[]
@@ -85,6 +85,6 @@ public static class Rlights
(float)light.Color.B / (float)255,
(float)light.Color.A / (float)255
};
- Raylib.SetShaderValue(shader, light.ColorLoc, color, ShaderUniformDataType.SHADER_UNIFORM_VEC4);
+ Raylib.SetShaderValue(shader, light.ColorLoc, color, ShaderUniformDataType.Vec4);
}
}
diff --git a/Examples/Text/CodepointsLoading.cs b/Examples/Text/CodepointsLoading.cs
index 18b2065..cc41443 100644
--- a/Examples/Text/CodepointsLoading.cs
+++ b/Examples/Text/CodepointsLoading.cs
@@ -52,7 +52,7 @@ class CodepointsLoading
);
// Set bilinear scale filter for better font scaling
- SetTextureFilter(font.Texture, TextureFilter.TEXTURE_FILTER_BILINEAR);
+ SetTextureFilter(font.Texture, TextureFilter.Bilinear);
bool showFontAtlas = false;
@@ -64,7 +64,7 @@ class CodepointsLoading
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
showFontAtlas = !showFontAtlas;
}
@@ -74,31 +74,31 @@ class CodepointsLoading
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawRectangle(0, 0, GetScreenWidth(), 70, Color.BLACK);
- DrawText($"Total codepoints contained in provided text: {codepoints.Count}", 10, 10, 20, Color.GREEN);
+ DrawRectangle(0, 0, GetScreenWidth(), 70, Color.Black);
+ DrawText($"Total codepoints contained in provided text: {codepoints.Count}", 10, 10, 20, Color.Green);
DrawText(
$"Total codepoints required for font atlas (duplicates excluded): {codepointsNoDuplicates.Length}",
10,
40,
20,
- Color.GREEN
+ Color.Green
);
if (showFontAtlas)
{
// Draw generated font texture atlas containing provided codepoints
- DrawTexture(font.Texture, 150, 100, Color.BLACK);
- DrawRectangleLines(150, 100, font.Texture.Width, font.Texture.Height, Color.BLACK);
+ DrawTexture(font.Texture, 150, 100, Color.Black);
+ DrawRectangleLines(150, 100, font.Texture.Width, font.Texture.Height, Color.Black);
}
else
{
// Draw provided text with laoded font, containing all required codepoint glyphs
- DrawTextEx(font, text, new Vector2(160, 110), 48, 5, Color.BLACK);
+ DrawTextEx(font, text, new Vector2(160, 110), 48, 5, Color.Black);
}
- DrawText("Press SPACE to toggle font atlas view!", 10, GetScreenHeight() - 30, 20, Color.GRAY);
+ DrawText("Press SPACE to toggle font atlas view!", 10, GetScreenHeight() - 30, 20, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Text/FontFilters.cs b/Examples/Text/FontFilters.cs
index bad0d0a..63cd9c3 100644
--- a/Examples/Text/FontFilters.cs
+++ b/Examples/Text/FontFilters.cs
@@ -45,8 +45,8 @@ public class FontFilters
Vector2 textSize = new(0.0f, 0.0f);
// Setup texture scaling filter
- SetTextureFilter(font.Texture, TextureFilter.TEXTURE_FILTER_POINT);
- TextureFilter currentFontFilter = TextureFilter.TEXTURE_FILTER_POINT;
+ SetTextureFilter(font.Texture, TextureFilter.Point);
+ TextureFilter currentFontFilter = TextureFilter.Point;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -59,30 +59,30 @@ public class FontFilters
fontSize += GetMouseWheelMove() * 4.0f;
// Choose font texture filter method
- if (IsKeyPressed(KeyboardKey.KEY_ONE))
+ if (IsKeyPressed(KeyboardKey.One))
{
- SetTextureFilter(font.Texture, TextureFilter.TEXTURE_FILTER_POINT);
- currentFontFilter = TextureFilter.TEXTURE_FILTER_POINT;
+ SetTextureFilter(font.Texture, TextureFilter.Point);
+ currentFontFilter = TextureFilter.Point;
}
- else if (IsKeyPressed(KeyboardKey.KEY_TWO))
+ else if (IsKeyPressed(KeyboardKey.Two))
{
- SetTextureFilter(font.Texture, TextureFilter.TEXTURE_FILTER_BILINEAR);
- currentFontFilter = TextureFilter.TEXTURE_FILTER_BILINEAR;
+ SetTextureFilter(font.Texture, TextureFilter.Bilinear);
+ currentFontFilter = TextureFilter.Bilinear;
}
- else if (IsKeyPressed(KeyboardKey.KEY_THREE))
+ else if (IsKeyPressed(KeyboardKey.Three))
{
// NOTE: Trilinear filter won't be noticed on 2D drawing
- SetTextureFilter(font.Texture, TextureFilter.TEXTURE_FILTER_TRILINEAR);
- currentFontFilter = TextureFilter.TEXTURE_FILTER_TRILINEAR;
+ SetTextureFilter(font.Texture, TextureFilter.Trilinear);
+ currentFontFilter = TextureFilter.Trilinear;
}
textSize = MeasureTextEx(font, msg, fontSize, 0);
- if (IsKeyDown(KeyboardKey.KEY_LEFT))
+ if (IsKeyDown(KeyboardKey.Left))
{
fontPosition.X -= 10;
}
- else if (IsKeyDown(KeyboardKey.KEY_RIGHT))
+ else if (IsKeyDown(KeyboardKey.Right))
{
fontPosition.X += 10;
}
@@ -104,29 +104,29 @@ public class FontFilters
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Use mouse wheel to change font size", 20, 20, 10, Color.GRAY);
- DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, Color.GRAY);
- DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, Color.GRAY);
- DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, Color.DARKGRAY);
+ DrawText("Use mouse wheel to change font size", 20, 20, 10, Color.Gray);
+ DrawText("Use KEY_RIGHT and KEY_LEFT to move text", 20, 40, 10, Color.Gray);
+ DrawText("Use 1, 2, 3 to change texture filter", 20, 60, 10, Color.Gray);
+ DrawText("Drop a new TTF font for dynamic loading", 20, 80, 10, Color.DarkGray);
- DrawTextEx(font, msg, fontPosition, fontSize, 0, Color.BLACK);
+ DrawTextEx(font, msg, fontPosition, fontSize, 0, Color.Black);
- DrawRectangle(0, screenHeight - 80, screenWidth, 80, Color.LIGHTGRAY);
- DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, Color.GRAY);
+ DrawRectangle(0, screenHeight - 80, screenWidth, 80, Color.LightGray);
+ DrawText("CURRENT TEXTURE FILTER:", 250, 400, 20, Color.Gray);
- if (currentFontFilter == TextureFilter.TEXTURE_FILTER_POINT)
+ if (currentFontFilter == TextureFilter.Point)
{
- DrawText("POINT", 570, 400, 20, Color.BLACK);
+ DrawText("POINT", 570, 400, 20, Color.Black);
}
- else if (currentFontFilter == TextureFilter.TEXTURE_FILTER_POINT)
+ else if (currentFontFilter == TextureFilter.Point)
{
- DrawText("BILINEAR", 570, 400, 20, Color.BLACK);
+ DrawText("BILINEAR", 570, 400, 20, Color.Black);
}
- else if (currentFontFilter == TextureFilter.TEXTURE_FILTER_TRILINEAR)
+ else if (currentFontFilter == TextureFilter.Trilinear)
{
- DrawText("TRILINEAR", 570, 400, 20, Color.BLACK);
+ DrawText("TRILINEAR", 570, 400, 20, Color.Black);
}
EndDrawing();
diff --git a/Examples/Text/FontLoading.cs b/Examples/Text/FontLoading.cs
index c4557dd..b7c37c5 100644
--- a/Examples/Text/FontLoading.cs
+++ b/Examples/Text/FontLoading.cs
@@ -57,7 +57,7 @@ public class FontLoading
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyDown(KeyboardKey.KEY_SPACE))
+ if (IsKeyDown(KeyboardKey.Space))
{
useTtf = true;
}
@@ -70,19 +70,19 @@ public class FontLoading
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Hold SPACE to use TTF generated font", 20, 20, 20, Color.LIGHTGRAY);
+ DrawText("Hold SPACE to use TTF generated font", 20, 20, 20, Color.LightGray);
if (!useTtf)
{
- DrawTextEx(fontBm, msg, new Vector2(20.0f, 100.0f), fontBm.BaseSize, 2, Color.MAROON);
- DrawText("Using BMFont (Angelcode) imported", 20, GetScreenHeight() - 30, 20, Color.GRAY);
+ DrawTextEx(fontBm, msg, new Vector2(20.0f, 100.0f), fontBm.BaseSize, 2, Color.Maroon);
+ DrawText("Using BMFont (Angelcode) imported", 20, GetScreenHeight() - 30, 20, Color.Gray);
}
else
{
- DrawTextEx(fontTtf, msg, new Vector2(20.0f, 100.0f), fontTtf.BaseSize, 2, Color.LIME);
- DrawText("Using TTF font generated", 20, GetScreenHeight() - 30, 20, Color.GRAY);
+ DrawTextEx(fontTtf, msg, new Vector2(20.0f, 100.0f), fontTtf.BaseSize, 2, Color.Lime);
+ DrawText("Using TTF font generated", 20, GetScreenHeight() - 30, 20, Color.Gray);
}
EndDrawing();
diff --git a/Examples/Text/FontSdf.cs b/Examples/Text/FontSdf.cs
index fbde01b..4959349 100644
--- a/Examples/Text/FontSdf.cs
+++ b/Examples/Text/FontSdf.cs
@@ -41,7 +41,7 @@ public class FontSdf
// Loading font data from memory data
// Parameters > font size: 16, no chars array provided (0), chars count: 95 (autogenerate chars array)
- fontDefault.Glyphs = LoadFontData(fileData, (int)fileSize, 16, null, 95, FontType.FONT_DEFAULT);
+ fontDefault.Glyphs = LoadFontData(fileData, (int)fileSize, 16, null, 95, FontType.Default);
// Parameters > chars count: 95, font size: 16, chars padding in image: 4 px, pack method: 0 (default)
Image atlas = GenImageFontAtlas(fontDefault.Glyphs, &fontDefault.Recs, 95, 16, 4, 0);
fontDefault.Texture = LoadTextureFromImage(atlas);
@@ -52,7 +52,7 @@ public class FontSdf
fontSDF.BaseSize = 16;
fontSDF.GlyphCount = 95;
// Parameters > font size: 16, no chars array provided (0), chars count: 0 (defaults to 95)
- fontSDF.Glyphs = LoadFontData(fileData, (int)fileSize, 16, null, 0, FontType.FONT_SDF);
+ fontSDF.Glyphs = LoadFontData(fileData, (int)fileSize, 16, null, 0, FontType.Sdf);
// Parameters > chars count: 95, font size: 16, chars padding in image: 0 px, pack method: 1 (Skyline algorythm)
atlas = GenImageFontAtlas(fontSDF.Glyphs, &fontSDF.Recs, 95, 16, 0, 1);
fontSDF.Texture = LoadTextureFromImage(atlas);
@@ -64,7 +64,7 @@ public class FontSdf
// Load SDF required shader (we use default vertex shader)
Shader shader = LoadShader(null, "resources/shaders/glsl330/sdf.fs");
// Required for SDF font
- SetTextureFilter(fontSDF.Texture, TextureFilter.TEXTURE_FILTER_BILINEAR);
+ SetTextureFilter(fontSDF.Texture, TextureFilter.Bilinear);
Vector2 fontPosition = new(40, screenHeight / 2 - 50);
Vector2 textSize = new(0.0f);
@@ -87,7 +87,7 @@ public class FontSdf
fontSize = 6;
}
- if (IsKeyDown(KeyboardKey.KEY_SPACE))
+ if (IsKeyDown(KeyboardKey.Space))
{
currentFont = 1;
}
@@ -112,37 +112,37 @@ public class FontSdf
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (currentFont == 1)
{
// NOTE: SDF fonts require a custom SDf shader to compute fragment color
BeginShaderMode(shader);
- DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, Color.BLACK);
+ DrawTextEx(fontSDF, msg, fontPosition, fontSize, 0, Color.Black);
EndShaderMode();
- DrawTexture(fontSDF.Texture, 10, 10, Color.BLACK);
+ DrawTexture(fontSDF.Texture, 10, 10, Color.Black);
}
else
{
- DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, Color.BLACK);
- DrawTexture(fontDefault.Texture, 10, 10, Color.BLACK);
+ DrawTextEx(fontDefault, msg, fontPosition, fontSize, 0, Color.Black);
+ DrawTexture(fontDefault.Texture, 10, 10, Color.Black);
}
if (currentFont == 1)
{
- DrawText("SDF!", 320, 20, 80, Color.RED);
+ DrawText("SDF!", 320, 20, 80, Color.Red);
}
else
{
- DrawText("default font", 315, 40, 30, Color.GRAY);
+ DrawText("default font", 315, 40, 30, Color.Gray);
}
- DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, Color.DARKGRAY);
- DrawText($"RENDER SIZE: {fontSize:2F}", GetScreenWidth() - 240, 50, 20, Color.DARKGRAY);
- DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, Color.DARKGRAY);
+ DrawText("FONT SIZE: 16.0", GetScreenWidth() - 240, 20, 20, Color.DarkGray);
+ DrawText($"RENDER SIZE: {fontSize:2F}", GetScreenWidth() - 240, 50, 20, Color.DarkGray);
+ DrawText("Use MOUSE WHEEL to SCALE TEXT!", GetScreenWidth() - 240, 90, 10, Color.DarkGray);
- DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, Color.MAROON);
+ DrawText("PRESS SPACE to USE SDF FONT VERSION!", 340, GetScreenHeight() - 30, 20, Color.Maroon);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Text/FontSpritefont.cs b/Examples/Text/FontSpritefont.cs
index 1c513f8..eb802a1 100644
--- a/Examples/Text/FontSpritefont.cs
+++ b/Examples/Text/FontSpritefont.cs
@@ -72,11 +72,11 @@ public class FontSpritefont
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawTextEx(font1, msg1, fontPosition1, font1.BaseSize, -3, Color.WHITE);
- DrawTextEx(font2, msg2, fontPosition2, font2.BaseSize, -2, Color.WHITE);
- DrawTextEx(font3, msg3, fontPosition3, font3.BaseSize, 2, Color.WHITE);
+ DrawTextEx(font1, msg1, fontPosition1, font1.BaseSize, -3, Color.White);
+ DrawTextEx(font2, msg2, fontPosition2, font2.BaseSize, -2, Color.White);
+ DrawTextEx(font3, msg3, fontPosition3, font3.BaseSize, 2, Color.White);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Text/FormatText.cs b/Examples/Text/FormatText.cs
index ab4186c..b463e12 100644
--- a/Examples/Text/FormatText.cs
+++ b/Examples/Text/FormatText.cs
@@ -42,12 +42,12 @@ public class FormatText
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText($"Score: {score}", 200, 80, 20, Color.RED);
- DrawText($"HiScore: {hiscore}", 200, 120, 20, Color.GREEN);
- DrawText($"Lives: {lives}", 200, 160, 40, Color.BLUE);
- DrawText($"Elapsed Time: {GetFrameTime() * 1000} ms", 200, 220, 20, Color.BLACK);
+ DrawText($"Score: {score}", 200, 80, 20, Color.Red);
+ DrawText($"HiScore: {hiscore}", 200, 120, 20, Color.Green);
+ DrawText($"Lives: {lives}", 200, 160, 40, Color.Blue);
+ DrawText($"Elapsed Time: {GetFrameTime() * 1000} ms", 200, 220, 20, Color.Black);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Text/InputBox.cs b/Examples/Text/InputBox.cs
index fa6075d..d15aee5 100644
--- a/Examples/Text/InputBox.cs
+++ b/Examples/Text/InputBox.cs
@@ -55,7 +55,7 @@ public class InputBox
if (mouseOnText)
{
// Set the window's cursor to the I-Beam
- SetMouseCursor(MouseCursor.MOUSE_CURSOR_IBEAM);
+ SetMouseCursor(MouseCursor.IBeam);
// Check if more characters have been pressed on the same frame
int key = GetCharPressed();
@@ -73,7 +73,7 @@ public class InputBox
key = GetCharPressed();
}
- if (IsKeyPressed(KeyboardKey.KEY_BACKSPACE))
+ if (IsKeyPressed(KeyboardKey.Backspace))
{
letterCount -= 1;
if (letterCount < 0)
@@ -85,7 +85,7 @@ public class InputBox
}
else
{
- SetMouseCursor(MouseCursor.MOUSE_CURSOR_DEFAULT);
+ SetMouseCursor(MouseCursor.Default);
}
if (mouseOnText)
@@ -101,10 +101,10 @@ public class InputBox
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, Color.GRAY);
- DrawRectangleRec(textBox, Color.LIGHTGRAY);
+ DrawText("PLACE MOUSE OVER INPUT BOX!", 240, 140, 20, Color.Gray);
+ DrawRectangleRec(textBox, Color.LightGray);
if (mouseOnText)
{
@@ -113,7 +113,7 @@ public class InputBox
(int)textBox.Y,
(int)textBox.Width,
(int)textBox.Height,
- Color.RED
+ Color.Red
);
}
else
@@ -123,12 +123,12 @@ public class InputBox
(int)textBox.Y,
(int)textBox.Width,
(int)textBox.Height,
- Color.DARKGRAY
+ Color.DarkGray
);
}
- DrawText(new string(name), (int)textBox.X + 5, (int)textBox.Y + 8, 40, Color.MAROON);
- DrawText($"INPUT CHARS: {letterCount}/{MaxInputChars}", 315, 250, 20, Color.DARKGRAY);
+ DrawText(new string(name), (int)textBox.X + 5, (int)textBox.Y + 8, 40, Color.Maroon);
+ DrawText($"INPUT CHARS: {letterCount}/{MaxInputChars}", 315, 250, 20, Color.DarkGray);
if (mouseOnText)
{
@@ -142,13 +142,13 @@ public class InputBox
(int)textBox.X + 8 + MeasureText(new string(name), 40),
(int)textBox.Y + 12,
40,
- Color.MAROON
+ Color.Maroon
);
}
}
else
{
- DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, Color.GRAY);
+ DrawText("Press BACKSPACE to delete chars...", 230, 300, 20, Color.Gray);
}
}
diff --git a/Examples/Text/RaylibFonts.cs b/Examples/Text/RaylibFonts.cs
index 6b99f25..59c2ef0 100644
--- a/Examples/Text/RaylibFonts.cs
+++ b/Examples/Text/RaylibFonts.cs
@@ -69,14 +69,14 @@ public class RaylibFonts
positions[7].Y -= 8;
Color[] colors = new Color[MaxFonts] {
- Color.MAROON,
- Color.ORANGE,
- Color.DARKGREEN,
- Color.DARKBLUE,
- Color.DARKPURPLE,
- Color.LIME,
- Color.GOLD,
- Color.RED
+ Color.Maroon,
+ Color.Orange,
+ Color.DarkGreen,
+ Color.DarkBlue,
+ Color.DarkPurple,
+ Color.Lime,
+ Color.Gold,
+ Color.Red
};
//--------------------------------------------------------------------------------------
@@ -91,10 +91,10 @@ public class RaylibFonts
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("free fonts included with raylib", 250, 20, 20, Color.DARKGRAY);
- DrawLine(220, 50, 590, 50, Color.DARKGRAY);
+ DrawText("free fonts included with raylib", 250, 20, 20, Color.DarkGray);
+ DrawLine(220, 50, 590, 50, Color.DarkGray);
for (int i = 0; i < MaxFonts; i++)
{
diff --git a/Examples/Text/RectangleBounds.cs b/Examples/Text/RectangleBounds.cs
index 3c4ffc1..b5ef7eb 100644
--- a/Examples/Text/RectangleBounds.cs
+++ b/Examples/Text/RectangleBounds.cs
@@ -37,7 +37,7 @@ public class RectangleBounds
const int maxHeight = screenHeight - 160;
Vector2 lastMouse = new(0.0f, 0.0f);
- Color borderColor = Color.MAROON;
+ Color borderColor = Color.Maroon;
Font font = GetFontDefault();
SetTargetFPS(60);
@@ -48,7 +48,7 @@ public class RectangleBounds
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
wordWrap = !wordWrap;
}
@@ -58,17 +58,17 @@ public class RectangleBounds
// Check if the mouse is inside the container and toggle border color
if (CheckCollisionPointRec(mouse, container))
{
- borderColor = ColorAlpha(Color.MAROON, 0.4f);
+ borderColor = ColorAlpha(Color.Maroon, 0.4f);
}
else if (!resizing)
{
- borderColor = Color.MAROON;
+ borderColor = Color.Maroon;
}
// Container resizing logic
if (resizing)
{
- if (IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonReleased(MouseButton.Left))
{
resizing = false;
}
@@ -82,7 +82,7 @@ public class RectangleBounds
else
{
// Check if we're resizing
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON) && CheckCollisionPointRec(mouse, resizer))
+ if (IsMouseButtonDown(MouseButton.Left) && CheckCollisionPointRec(mouse, resizer))
{
resizing = true;
}
@@ -98,7 +98,7 @@ public class RectangleBounds
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw container border
DrawRectangleLinesEx(container, 3, borderColor);
@@ -111,28 +111,28 @@ public class RectangleBounds
20.0f,
2.0f,
wordWrap,
- Color.GRAY
+ Color.Gray
);
DrawRectangleRec(resizer, borderColor);
// Draw bottom info
- DrawRectangle(0, screenHeight - 54, screenWidth, 54, Color.GRAY);
- DrawRectangleRec(new Rectangle(382, screenHeight - 34, 12, 12), Color.MAROON);
+ DrawRectangle(0, screenHeight - 54, screenWidth, 54, Color.Gray);
+ DrawRectangleRec(new Rectangle(382, screenHeight - 34, 12, 12), Color.Maroon);
- DrawText("Word Wrap: ", 313, screenHeight - 115, 20, Color.BLACK);
+ DrawText("Word Wrap: ", 313, screenHeight - 115, 20, Color.Black);
if (wordWrap)
{
- DrawText("ON", 447, screenHeight - 115, 20, Color.RED);
+ DrawText("ON", 447, screenHeight - 115, 20, Color.Red);
}
else
{
- DrawText("OFF", 447, screenHeight - 115, 20, Color.BLACK);
+ DrawText("OFF", 447, screenHeight - 115, 20, Color.Black);
}
- DrawText("Press [SPACE] to toggle word wrap", 218, screenHeight - 86, 20, Color.GRAY);
- DrawText("Click hold & drag the to resize the container", 155, screenHeight - 38, 20, Color.RAYWHITE);
+ DrawText("Press [SPACE] to toggle word wrap", 218, screenHeight - 86, 20, Color.Gray);
+ DrawText("Click hold & drag the to resize the container", 155, screenHeight - 38, 20, Color.RayWhite);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -157,7 +157,7 @@ public class RectangleBounds
Color tint
)
{
- DrawTextBoxedSelectable(font, text, rec, fontSize, spacing, wordWrap, tint, 0, 0, Color.WHITE, Color.WHITE);
+ DrawTextBoxedSelectable(font, text, rec, fontSize, spacing, wordWrap, tint, 0, 0, Color.White, Color.White);
}
// Draw text using font inside rectangle limits with support for text selection
diff --git a/Examples/Text/WritingAnim.cs b/Examples/Text/WritingAnim.cs
index 0cd5144..94ed451 100644
--- a/Examples/Text/WritingAnim.cs
+++ b/Examples/Text/WritingAnim.cs
@@ -35,7 +35,7 @@ public class WritingAnim
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyDown(KeyboardKey.KEY_SPACE))
+ if (IsKeyDown(KeyboardKey.Space))
{
framesCounter += 8;
}
@@ -44,7 +44,7 @@ public class WritingAnim
framesCounter += 1;
}
- if (IsKeyPressed(KeyboardKey.KEY_ENTER))
+ if (IsKeyPressed(KeyboardKey.Enter))
{
framesCounter = 0;
}
@@ -53,12 +53,12 @@ public class WritingAnim
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText(message.SubText(0, framesCounter / 10), 210, 160, 20, Color.MAROON);
+ DrawText(message.SubText(0, framesCounter / 10), 210, 160, 20, Color.Maroon);
- DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, Color.LIGHTGRAY);
- DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, Color.LIGHTGRAY);
+ DrawText("PRESS [ENTER] to RESTART!", 240, 260, 20, Color.LightGray);
+ DrawText("PRESS [SPACE] to SPEED UP!", 239, 300, 20, Color.LightGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/BackgroundScrolling.cs b/Examples/Textures/BackgroundScrolling.cs
index c7fcc63..3aa27d4 100644
--- a/Examples/Textures/BackgroundScrolling.cs
+++ b/Examples/Textures/BackgroundScrolling.cs
@@ -69,34 +69,34 @@ public class BackgroundScrolling
// Draw background image twice
// NOTE: Texture is scaled twice its size
- DrawTextureEx(background, new Vector2(scrollingBack, 20), 0.0f, 2.0f, Color.WHITE);
+ DrawTextureEx(background, new Vector2(scrollingBack, 20), 0.0f, 2.0f, Color.White);
DrawTextureEx(
background,
new Vector2(background.Width * 2 + scrollingBack, 20),
0.0f,
2.0f,
- Color.WHITE
+ Color.White
);
// Draw midground image twice
- DrawTextureEx(midground, new Vector2(scrollingMid, 20), 0.0f, 2.0f, Color.WHITE);
- DrawTextureEx(midground, new Vector2(midground.Width * 2 + scrollingMid, 20), 0.0f, 2.0f, Color.WHITE);
+ DrawTextureEx(midground, new Vector2(scrollingMid, 20), 0.0f, 2.0f, Color.White);
+ DrawTextureEx(midground, new Vector2(midground.Width * 2 + scrollingMid, 20), 0.0f, 2.0f, Color.White);
// Draw foreground image twice
- DrawTextureEx(foreground, new Vector2(scrollingFore, 70), 0.0f, 2.0f, Color.WHITE);
+ DrawTextureEx(foreground, new Vector2(scrollingFore, 70), 0.0f, 2.0f, Color.White);
DrawTextureEx(
foreground,
new Vector2(foreground.Width * 2 + scrollingFore, 70),
0.0f,
2.0f,
- Color.WHITE
+ Color.White
);
- DrawText("BACKGROUND SCROLLING & PARALLAX", 10, 10, 20, Color.RED);
+ DrawText("BACKGROUND SCROLLING & PARALLAX", 10, 10, 20, Color.Red);
int x = screenWidth - 330;
int y = screenHeight - 20;
- DrawText("(c) Cyberpunk Street Environment by Luis Zuno (@ansimuz)", x, y, 10, Color.RAYWHITE);
+ DrawText("(c) Cyberpunk Street Environment by Luis Zuno (@ansimuz)", x, y, 10, Color.RayWhite);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/BlendModes.cs b/Examples/Textures/BlendModes.cs
index cc1e2d3..49a26b9 100644
--- a/Examples/Textures/BlendModes.cs
+++ b/Examples/Textures/BlendModes.cs
@@ -47,7 +47,7 @@ public class BlendModes
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
if ((int)blendMode >= (blendCountMax - 1))
{
@@ -63,42 +63,42 @@ public class BlendModes
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
int bgX = screenWidth / 2 - bgTexture.Width / 2;
int bgY = screenHeight / 2 - bgTexture.Height / 2;
- DrawTexture(bgTexture, bgX, bgY, Color.WHITE);
+ DrawTexture(bgTexture, bgX, bgY, Color.White);
// Apply the blend mode and then draw the foreground texture
BeginBlendMode(blendMode);
int fgX = screenWidth / 2 - fgTexture.Width / 2;
int fgY = screenHeight / 2 - fgTexture.Height / 2;
- DrawTexture(fgTexture, fgX, fgY, Color.WHITE);
+ DrawTexture(fgTexture, fgX, fgY, Color.White);
EndBlendMode();
// Draw the texts
- DrawText("Press SPACE to change blend modes.", 310, 350, 10, Color.GRAY);
+ DrawText("Press SPACE to change blend modes.", 310, 350, 10, Color.Gray);
switch (blendMode)
{
- case BlendMode.BLEND_ALPHA:
- DrawText("Current: BLEND_ALPHA", (screenWidth / 2) - 60, 370, 10, Color.GRAY);
+ case BlendMode.Alpha:
+ DrawText("Current: BLEND_ALPHA", (screenWidth / 2) - 60, 370, 10, Color.Gray);
break;
- case BlendMode.BLEND_ADDITIVE:
- DrawText("Current: BLEND_ADDITIVE", (screenWidth / 2) - 60, 370, 10, Color.GRAY);
+ case BlendMode.Additive:
+ DrawText("Current: BLEND_ADDITIVE", (screenWidth / 2) - 60, 370, 10, Color.Gray);
break;
- case BlendMode.BLEND_MULTIPLIED:
- DrawText("Current: BLEND_MULTIPLIED", (screenWidth / 2) - 60, 370, 10, Color.GRAY);
+ case BlendMode.Multiplied:
+ DrawText("Current: BLEND_MULTIPLIED", (screenWidth / 2) - 60, 370, 10, Color.Gray);
break;
- case BlendMode.BLEND_ADD_COLORS:
- DrawText("Current: BLEND_ADD_COLORS", (screenWidth / 2) - 60, 370, 10, Color.GRAY);
+ case BlendMode.AddColors:
+ DrawText("Current: BLEND_ADD_COLORS", (screenWidth / 2) - 60, 370, 10, Color.Gray);
break;
default:
break;
}
string text = "(c) Cyberpunk Street Environment by Luis Zuno (@ansimuz)";
- DrawText(text, screenWidth - 330, screenHeight - 20, 10, Color.GRAY);
+ DrawText(text, screenWidth - 330, screenHeight - 20, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/Bunnymark.cs b/Examples/Textures/Bunnymark.cs
index 3b7b17b..2e1a22d 100644
--- a/Examples/Textures/Bunnymark.cs
+++ b/Examples/Textures/Bunnymark.cs
@@ -53,7 +53,7 @@ public class Bunnymark
{
// Update
//----------------------------------------------------------------------------------
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left))
{
// Create more bunnies
for (int i = 0; i < 100; i++)
@@ -98,7 +98,7 @@ public class Bunnymark
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
for (int i = 0; i < bunniesCount; i++)
{
@@ -111,9 +111,9 @@ public class Bunnymark
DrawTexture(texBunny, (int)bunnies[i].Position.X, (int)bunnies[i].Position.Y, bunnies[i].Color);
}
- DrawRectangle(0, 0, screenWidth, 40, Color.BLACK);
- DrawText($"bunnies: {bunniesCount}", 120, 10, 20, Color.GREEN);
- DrawText($"batched draw calls: {1 + bunniesCount / MAX_BATCH_ELEMENTS}", 320, 10, 20, Color.MAROON);
+ DrawRectangle(0, 0, screenWidth, 40, Color.Black);
+ DrawText($"bunnies: {bunniesCount}", 120, 10, 20, Color.Green);
+ DrawText($"batched draw calls: {1 + bunniesCount / MAX_BATCH_ELEMENTS}", 320, 10, 20, Color.Maroon);
DrawFPS(10, 10);
diff --git a/Examples/Textures/DrawTiled.cs b/Examples/Textures/DrawTiled.cs
index 18235e7..e069926 100644
--- a/Examples/Textures/DrawTiled.cs
+++ b/Examples/Textures/DrawTiled.cs
@@ -27,14 +27,14 @@ public class DrawTiled
int screenWidth = 800;
int screenHeight = 450;
- SetConfigFlags(ConfigFlags.FLAG_WINDOW_RESIZABLE);
+ SetConfigFlags(ConfigFlags.ResizableWindow);
InitWindow(screenWidth, screenHeight, "raylib [textures] example - Draw part of a texture tiled");
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Texture2D texPattern = LoadTexture("resources/patterns.png");
// Makes the texture smoother when upscaled
- SetTextureFilter(texPattern, TextureFilter.TEXTURE_FILTER_TRILINEAR);
+ SetTextureFilter(texPattern, TextureFilter.Trilinear);
// Coordinates for all patterns inside the texture
Rectangle[] recPattern = new[] {
@@ -49,16 +49,16 @@ public class DrawTiled
// Setup colors
Color[] colors = new[]
{
- Color.BLACK,
- Color.MAROON,
- Color.ORANGE,
- Color.BLUE,
- Color.PURPLE,
- Color.BEIGE,
- Color.LIME,
- Color.RED,
- Color.DARKGRAY,
- Color.SKYBLUE
+ Color.Black,
+ Color.Maroon,
+ Color.Orange,
+ Color.Blue,
+ Color.Purple,
+ Color.Beige,
+ Color.Lime,
+ Color.Red,
+ Color.DarkGray,
+ Color.SkyBlue
};
Rectangle[] colorRec = new Rectangle[colors.Length];
@@ -96,7 +96,7 @@ public class DrawTiled
screenHeight = GetScreenHeight();
// Handle mouse
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonPressed(MouseButton.Left))
{
Vector2 mouse = GetMousePosition();
@@ -130,11 +130,11 @@ public class DrawTiled
// Handle keys
// Change scale
- if (IsKeyPressed(KeyboardKey.KEY_UP))
+ if (IsKeyPressed(KeyboardKey.Up))
{
scale += 0.25f;
}
- if (IsKeyPressed(KeyboardKey.KEY_DOWN))
+ if (IsKeyPressed(KeyboardKey.Down))
{
scale -= 0.25f;
}
@@ -148,17 +148,17 @@ public class DrawTiled
}
// Change rotation
- if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ if (IsKeyPressed(KeyboardKey.Left))
{
rotation -= 25.0f;
}
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
rotation += 25.0f;
}
// Reset
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
rotation = 0.0f;
scale = 1.0f;
@@ -168,7 +168,7 @@ public class DrawTiled
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw the tiled area
Rectangle source = recPattern[activePattern];
@@ -181,39 +181,39 @@ public class DrawTiled
DrawTextureTiled(texPattern, source, dest, Vector2.Zero, rotation, scale, colors[activeCol]);
// Draw options
- Color color = ColorAlpha(Color.LIGHTGRAY, 0.5f);
+ Color color = ColorAlpha(Color.LightGray, 0.5f);
DrawRectangle(MarginSize, MarginSize, OptWidth - MarginSize, screenHeight - 2 * MarginSize, color);
- DrawText("Select Pattern", 2 + MarginSize, 30 + MarginSize, 10, Color.BLACK);
- DrawTexture(texPattern, 2 + MarginSize, 40 + MarginSize, Color.BLACK);
+ DrawText("Select Pattern", 2 + MarginSize, 30 + MarginSize, 10, Color.Black);
+ DrawTexture(texPattern, 2 + MarginSize, 40 + MarginSize, Color.Black);
DrawRectangle(
2 + MarginSize + (int)recPattern[activePattern].X,
40 + MarginSize + (int)recPattern[activePattern].Y,
(int)recPattern[activePattern].Width,
(int)recPattern[activePattern].Height,
- ColorAlpha(Color.DARKBLUE, 0.3f)
+ ColorAlpha(Color.DarkBlue, 0.3f)
);
- DrawText("Select Color", 2 + MarginSize, 10 + 256 + MarginSize, 10, Color.BLACK);
+ DrawText("Select Color", 2 + MarginSize, 10 + 256 + MarginSize, 10, Color.Black);
for (int i = 0; i < colors.Length; i++)
{
DrawRectangleRec(colorRec[i], colors[i]);
if (activeCol == i)
{
- DrawRectangleLinesEx(colorRec[i], 3, ColorAlpha(Color.WHITE, 0.5f));
+ DrawRectangleLinesEx(colorRec[i], 3, ColorAlpha(Color.White, 0.5f));
}
}
- DrawText("Scale (UP/DOWN to change)", 2 + MarginSize, 80 + 256 + MarginSize, 10, Color.BLACK);
- DrawText($"{scale}x", 2 + MarginSize, 92 + 256 + MarginSize, 20, Color.BLACK);
+ DrawText("Scale (UP/DOWN to change)", 2 + MarginSize, 80 + 256 + MarginSize, 10, Color.Black);
+ DrawText($"{scale}x", 2 + MarginSize, 92 + 256 + MarginSize, 20, Color.Black);
- DrawText("Rotation (LEFT/RIGHT to change)", 2 + MarginSize, 122 + 256 + MarginSize, 10, Color.BLACK);
- DrawText($"{rotation} degrees", 2 + MarginSize, 134 + 256 + MarginSize, 20, Color.BLACK);
+ DrawText("Rotation (LEFT/RIGHT to change)", 2 + MarginSize, 122 + 256 + MarginSize, 10, Color.Black);
+ DrawText($"{rotation} degrees", 2 + MarginSize, 134 + 256 + MarginSize, 20, Color.Black);
- DrawText("Press [SPACE] to reset", 2 + MarginSize, 164 + 256 + MarginSize, 10, Color.DARKBLUE);
+ DrawText("Press [SPACE] to reset", 2 + MarginSize, 164 + 256 + MarginSize, 10, Color.DarkBlue);
// Draw FPS
- DrawText($"{GetFPS()}", 2 + MarginSize, 2 + MarginSize, 20, Color.BLACK);
+ DrawText($"{GetFPS()}", 2 + MarginSize, 2 + MarginSize, 20, Color.Black);
EndDrawing();
//----------------------------------------------------------------------------------
}
diff --git a/Examples/Textures/ImageDrawing.cs b/Examples/Textures/ImageDrawing.cs
index e41c84f..7b048d0 100644
--- a/Examples/Textures/ImageDrawing.cs
+++ b/Examples/Textures/ImageDrawing.cs
@@ -38,13 +38,13 @@ public class ImageDrawing
// Draw one image over the other with a scaling of 1.5f
Rectangle src = new(0, 0, cat.Width, cat.Height);
- ImageDraw(ref parrots, cat, src, new Rectangle(30, 40, cat.Width * 1.5f, cat.Height * 1.5f), Color.WHITE);
+ ImageDraw(ref parrots, cat, src, new Rectangle(30, 40, cat.Width * 1.5f, cat.Height * 1.5f), Color.White);
ImageCrop(ref parrots, new Rectangle(0, 50, parrots.Width, parrots.Height - 100));
// Draw on the image with a few image draw methods
- ImageDrawPixel(ref parrots, 10, 10, Color.RAYWHITE);
- ImageDrawCircle(ref parrots, 10, 10, 5, Color.RAYWHITE);
- ImageDrawRectangle(ref parrots, 5, 20, 10, 10, Color.RAYWHITE);
+ ImageDrawPixel(ref parrots, 10, 10, Color.RayWhite);
+ ImageDrawCircle(ref parrots, 10, 10, 5, Color.RayWhite);
+ ImageDrawRectangle(ref parrots, 5, 20, 10, 10, Color.RayWhite);
UnloadImage(cat);
@@ -52,7 +52,7 @@ public class ImageDrawing
Font font = LoadFont("resources/fonts/custom_jupiter_crash.png");
// Draw over image using custom font
- ImageDrawTextEx(ref parrots, font, "PARROTS & CAT", new Vector2(300, 230), font.BaseSize, -2, Color.WHITE);
+ ImageDrawTextEx(ref parrots, font, "PARROTS & CAT", new Vector2(300, 230), font.BaseSize, -2, Color.White);
// Unload custom spritefont (already drawn used on image)
UnloadFont(font);
@@ -74,17 +74,17 @@ public class ImageDrawing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
int x = screenWidth / 2 - texture.Width / 2;
int y = screenHeight / 2 - texture.Height / 2;
- DrawTexture(texture, x, y - 40, Color.WHITE);
- DrawRectangleLines(x, y - 40, texture.Width, texture.Height, Color.DARKGRAY);
+ DrawTexture(texture, x, y - 40, Color.White);
+ DrawRectangleLines(x, y - 40, texture.Width, texture.Height, Color.DarkGray);
- DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, Color.DARKGRAY);
+ DrawText("We are drawing only one texture from various images composed!", 240, 350, 10, Color.DarkGray);
string text = "Source images have been cropped, scaled, flipped and copied one over the other.";
- DrawText(text, 90, 370, 10, Color.DARKGRAY);
+ DrawText(text, 90, 370, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/ImageGeneration.cs b/Examples/Textures/ImageGeneration.cs
index 43c4366..dacff9a 100644
--- a/Examples/Textures/ImageGeneration.cs
+++ b/Examples/Textures/ImageGeneration.cs
@@ -26,10 +26,10 @@ public class ImageGeneration
InitWindow(screenWidth, screenHeight, "raylib [textures] example - procedural images generation");
- Image verticalGradient = GenImageGradientLinear(screenWidth, screenHeight, 0, Color.RED, Color.BLUE);
- Image horizontalGradient = GenImageGradientLinear(screenWidth, screenHeight, 90, Color.RED, Color.BLUE);
- Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, Color.WHITE, Color.BLACK);
- Image isChecked = GenImageChecked(screenWidth, screenHeight, 32, 32, Color.RED, Color.BLUE);
+ Image verticalGradient = GenImageGradientLinear(screenWidth, screenHeight, 0, Color.Red, Color.Blue);
+ Image horizontalGradient = GenImageGradientLinear(screenWidth, screenHeight, 90, Color.Red, Color.Blue);
+ Image radialGradient = GenImageGradientRadial(screenWidth, screenHeight, 0.0f, Color.White, Color.Black);
+ Image isChecked = GenImageChecked(screenWidth, screenHeight, 32, 32, Color.Red, Color.Blue);
Image whiteNoise = GenImageWhiteNoise(screenWidth, screenHeight, 0.5f);
Image cellular = GenImageCellular(screenWidth, screenHeight, 32);
@@ -58,7 +58,7 @@ public class ImageGeneration
{
// Update
//----------------------------------------------------------------------------------
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON) || IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsMouseButtonPressed(MouseButton.Left) || IsKeyPressed(KeyboardKey.Right))
{
// Cycle between the textures
currentTexture = (currentTexture + 1) % NumTextures;
@@ -68,33 +68,33 @@ public class ImageGeneration
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawTexture(textures[currentTexture], 0, 0, Color.WHITE);
+ DrawTexture(textures[currentTexture], 0, 0, Color.White);
- DrawRectangle(30, 400, 325, 30, ColorAlpha(Color.SKYBLUE, 0.5f));
- DrawRectangleLines(30, 400, 325, 30, ColorAlpha(Color.WHITE, 0.5f));
- DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, Color.WHITE);
+ DrawRectangle(30, 400, 325, 30, ColorAlpha(Color.SkyBlue, 0.5f));
+ DrawRectangleLines(30, 400, 325, 30, ColorAlpha(Color.White, 0.5f));
+ DrawText("MOUSE LEFT BUTTON to CYCLE PROCEDURAL TEXTURES", 40, 410, 10, Color.White);
switch (currentTexture)
{
case 0:
- DrawText("VERTICAL GRADIENT", 560, 10, 20, Color.RAYWHITE);
+ DrawText("VERTICAL GRADIENT", 560, 10, 20, Color.RayWhite);
break;
case 1:
- DrawText("HORIZONTAL GRADIENT", 540, 10, 20, Color.RAYWHITE);
+ DrawText("HORIZONTAL GRADIENT", 540, 10, 20, Color.RayWhite);
break;
case 2:
- DrawText("RADIAL GRADIENT", 580, 10, 20, Color.LIGHTGRAY);
+ DrawText("RADIAL GRADIENT", 580, 10, 20, Color.LightGray);
break;
case 3:
- DrawText("CHECKED", 680, 10, 20, Color.RAYWHITE);
+ DrawText("CHECKED", 680, 10, 20, Color.RayWhite);
break;
case 4:
- DrawText("Color.WHITE NOISE", 640, 10, 20, Color.RED);
+ DrawText("Color.WHITE NOISE", 640, 10, 20, Color.Red);
break;
case 5:
- DrawText("CELLULAR", 670, 10, 20, Color.RAYWHITE);
+ DrawText("CELLULAR", 670, 10, 20, Color.RayWhite);
break;
default:
break;
diff --git a/Examples/Textures/ImageLoading.cs b/Examples/Textures/ImageLoading.cs
index fd648d6..5772b06 100644
--- a/Examples/Textures/ImageLoading.cs
+++ b/Examples/Textures/ImageLoading.cs
@@ -45,16 +45,16 @@ public class ImageLoading
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawTexture(
texture,
screenWidth / 2 - texture.Width / 2,
screenHeight / 2 - texture.Height / 2,
- Color.WHITE
+ Color.White
);
- DrawText("this IS a texture loaded from an image!", 300, 370, 10, Color.GRAY);
+ DrawText("this IS a texture loaded from an image!", 300, 370, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/ImageProcessing.cs b/Examples/Textures/ImageProcessing.cs
index cf35dd2..c28a263 100644
--- a/Examples/Textures/ImageProcessing.cs
+++ b/Examples/Textures/ImageProcessing.cs
@@ -55,7 +55,7 @@ public class ImageProcessing
// NOTE: Textures MUST be loaded after Window initialization (OpenGL context is required)
Image imageOrigin = LoadImage("resources/parrots.png");
- ImageFormat(ref imageOrigin, PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8);
+ ImageFormat(ref imageOrigin, PixelFormat.UncompressedR8G8B8A8);
Texture2D texture = LoadTextureFromImage(imageOrigin);
Image imageCopy = ImageCopy(imageOrigin);
@@ -87,7 +87,7 @@ public class ImageProcessing
{
mouseHoverRec = i;
- if (IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonReleased(MouseButton.Left))
{
currentProcess = (ImageProcess)i;
textureReload = true;
@@ -101,7 +101,7 @@ public class ImageProcessing
}
// Keyboard toggle group logic
- if (IsKeyPressed(KeyboardKey.KEY_DOWN))
+ if (IsKeyPressed(KeyboardKey.Down))
{
currentProcess++;
if ((int)currentProcess > (NumProcesses - 1))
@@ -111,7 +111,7 @@ public class ImageProcessing
textureReload = true;
}
- else if (IsKeyPressed(KeyboardKey.KEY_UP))
+ else if (IsKeyPressed(KeyboardKey.Up))
{
currentProcess--;
if (currentProcess < 0)
@@ -136,7 +136,7 @@ public class ImageProcessing
ImageColorGrayscale(ref imageCopy);
break;
case ImageProcess.ColorTint:
- ImageColorTint(ref imageCopy, Color.GREEN);
+ ImageColorTint(ref imageCopy, Color.Green);
break;
case ImageProcess.ColorInvert:
ImageColorInvert(ref imageCopy);
@@ -172,20 +172,20 @@ public class ImageProcessing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("IMAGE PROCESSING:", 40, 30, 10, Color.DARKGRAY);
+ DrawText("IMAGE PROCESSING:", 40, 30, 10, Color.DarkGray);
// Draw rectangles
for (int i = 0; i < NumProcesses; i++)
{
- DrawRectangleRec(toggleRecs[i], (i == (int)currentProcess) ? Color.SKYBLUE : Color.LIGHTGRAY);
+ DrawRectangleRec(toggleRecs[i], (i == (int)currentProcess) ? Color.SkyBlue : Color.LightGray);
DrawRectangleLines(
(int)toggleRecs[i].X,
(int)toggleRecs[i].Y,
(int)toggleRecs[i].Width,
(int)toggleRecs[i].Height,
- (i == (int)currentProcess) ? Color.BLUE : Color.GRAY
+ (i == (int)currentProcess) ? Color.Blue : Color.Gray
);
int labelX = (int)(toggleRecs[i].X + toggleRecs[i].Width / 2);
@@ -194,14 +194,14 @@ public class ImageProcessing
(int)(labelX - MeasureText(processText[i], 10) / 2),
(int)toggleRecs[i].Y + 11,
10,
- (i == (int)currentProcess) ? Color.DARKBLUE : Color.DARKGRAY
+ (i == (int)currentProcess) ? Color.DarkBlue : Color.DarkGray
);
}
int x = screenWidth - texture.Width - 60;
int y = screenHeight / 2 - texture.Height / 2;
- DrawTexture(texture, x, y, Color.WHITE);
- DrawRectangleLines(x, y, texture.Width, texture.Height, Color.BLACK);
+ DrawTexture(texture, x, y, Color.White);
+ DrawRectangleLines(x, y, texture.Width, texture.Height, Color.Black);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/ImageText.cs b/Examples/Textures/ImageText.cs
index faa1f8c..71fed41 100644
--- a/Examples/Textures/ImageText.cs
+++ b/Examples/Textures/ImageText.cs
@@ -38,7 +38,7 @@ public class ImageText
new Vector2(20, 20),
font.BaseSize,
0,
- Color.WHITE
+ Color.White
);
// Image converted to texture, uploaded to GPU memory (VRAM)
@@ -60,7 +60,7 @@ public class ImageText
{
// Update
//----------------------------------------------------------------------------------
- if (IsKeyDown(KeyboardKey.KEY_SPACE))
+ if (IsKeyDown(KeyboardKey.Space))
{
showFont = true;
}
@@ -73,23 +73,23 @@ public class ImageText
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
if (!showFont)
{
// Draw texture with text already drawn inside
- DrawTextureV(texture, position, Color.WHITE);
+ DrawTextureV(texture, position, Color.White);
// Draw text directly using sprite font
Vector2 textPosition = new(position.X + 20, position.Y + 20 + 280);
- DrawTextEx(font, "[Parrots font drawing]", textPosition, font.BaseSize, 0, Color.WHITE);
+ DrawTextEx(font, "[Parrots font drawing]", textPosition, font.BaseSize, 0, Color.White);
}
else
{
- DrawTexture(font.Texture, screenWidth / 2 - font.Texture.Width / 2, 50, Color.BLACK);
+ DrawTexture(font.Texture, screenWidth / 2 - font.Texture.Width / 2, 50, Color.Black);
}
- DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, Color.DARKGRAY);
+ DrawText("PRESS SPACE to SEE USED SPRITEFONT ", 290, 420, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/LogoRaylibTexture.cs b/Examples/Textures/LogoRaylibTexture.cs
index f5b6768..995c90e 100644
--- a/Examples/Textures/LogoRaylibTexture.cs
+++ b/Examples/Textures/LogoRaylibTexture.cs
@@ -39,16 +39,16 @@ public class LogoRaylibTexture
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawTexture(
texture,
screenWidth / 2 - texture.Width / 2,
screenHeight / 2 - texture.Height / 2,
- Color.WHITE
+ Color.White
);
- DrawText("this IS a texture!", 360, 370, 10, Color.GRAY);
+ DrawText("this IS a texture!", 360, 370, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/MousePainting.cs b/Examples/Textures/MousePainting.cs
index 8f57dfe..62f4692 100644
--- a/Examples/Textures/MousePainting.cs
+++ b/Examples/Textures/MousePainting.cs
@@ -29,29 +29,29 @@ public class MousePainting
// Colours to choose from
Color[] colors = new Color[] {
- Color.RAYWHITE,
- Color.YELLOW,
- Color.GOLD,
- Color.ORANGE,
- Color.PINK,
- Color.RED,
- Color.MAROON,
- Color.GREEN,
- Color.LIME,
- Color.DARKGREEN,
- Color.SKYBLUE,
- Color.BLUE,
- Color.DARKBLUE,
- Color.PURPLE,
- Color.VIOLET,
- Color.DARKPURPLE,
- Color.BEIGE,
- Color.BROWN,
- Color.DARKBROWN,
- Color.LIGHTGRAY,
- Color.GRAY,
- Color.DARKGRAY,
- Color.BLACK
+ Color.RayWhite,
+ Color.Yellow,
+ Color.Gold,
+ Color.Orange,
+ Color.Pink,
+ Color.Red,
+ Color.Maroon,
+ Color.Green,
+ Color.Lime,
+ Color.DarkGreen,
+ Color.SkyBlue,
+ Color.Blue,
+ Color.DarkBlue,
+ Color.Purple,
+ Color.Violet,
+ Color.DarkPurple,
+ Color.Beige,
+ Color.Brown,
+ Color.DarkBrown,
+ Color.LightGray,
+ Color.Gray,
+ Color.DarkGray,
+ Color.Black
};
// Define colorsRecs data (for every rectangle)
@@ -94,11 +94,11 @@ public class MousePainting
Vector2 mousePos = GetMousePosition();
// Move between colors with keys
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
colorSelected++;
}
- else if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ else if (IsKeyPressed(KeyboardKey.Left))
{
colorSelected--;
}
@@ -126,7 +126,7 @@ public class MousePainting
}
}
- if ((colorMouseHover >= 0) && IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON))
+ if ((colorMouseHover >= 0) && IsMouseButtonPressed(MouseButton.Left))
{
colorSelected = colorMouseHover;
colorSelectedPrev = colorSelected;
@@ -144,7 +144,7 @@ public class MousePainting
brushSize = 50;
}
- if (IsKeyPressed(KeyboardKey.KEY_C))
+ if (IsKeyPressed(KeyboardKey.C))
{
// Clear render texture to clear color
BeginTextureMode(target);
@@ -152,7 +152,7 @@ public class MousePainting
EndTextureMode();
}
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left))
{
// Paint circle into render texture
// NOTE: To avoid discontinuous circles, we could store
@@ -165,7 +165,7 @@ public class MousePainting
EndTextureMode();
}
- else if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
+ else if (IsMouseButtonDown(MouseButton.Right))
{
colorSelected = 0;
@@ -195,8 +195,8 @@ public class MousePainting
// Image saving logic
// NOTE: Saving painted texture to a default named image
- if ((btnSaveMouseHover && IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON)) ||
- IsKeyPressed(KeyboardKey.KEY_S))
+ if ((btnSaveMouseHover && IsMouseButtonReleased(MouseButton.Left)) ||
+ IsKeyPressed(KeyboardKey.S))
{
Image image = LoadImageFromTexture(target.Texture);
ImageFlipVertical(ref image);
@@ -220,16 +220,16 @@ public class MousePainting
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// NOTE: Render texture must be y-flipped due to default OpenGL coordinates (left-bottom)
Rectangle source = new(0, 0, target.Texture.Width, -target.Texture.Height);
- DrawTextureRec(target.Texture, source, new Vector2(0, 0), Color.WHITE);
+ DrawTextureRec(target.Texture, source, new Vector2(0, 0), Color.White);
// Draw drawing circle for reference
if (mousePos.Y > 50)
{
- if (IsMouseButtonDown(MouseButton.MOUSE_RIGHT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Right))
{
DrawCircleLines((int)mousePos.X, (int)mousePos.Y, brushSize, colors[colorSelected]);
}
@@ -240,8 +240,8 @@ public class MousePainting
}
// Draw top panel
- DrawRectangle(0, 0, GetScreenWidth(), 50, Color.RAYWHITE);
- DrawLine(0, 50, GetScreenWidth(), 50, Color.LIGHTGRAY);
+ DrawRectangle(0, 0, GetScreenWidth(), 50, Color.RayWhite);
+ DrawLine(0, 50, GetScreenWidth(), 50, Color.LightGray);
// Draw color selection rectangles
for (int i = 0; i < colors.Length; i++)
@@ -249,11 +249,11 @@ public class MousePainting
DrawRectangleRec(colorsRecs[i], colors[i]);
}
- DrawRectangleLines(10, 10, 30, 30, Color.LIGHTGRAY);
+ DrawRectangleLines(10, 10, 30, 30, Color.LightGray);
if (colorMouseHover >= 0)
{
- DrawRectangleRec(colorsRecs[colorMouseHover], ColorAlpha(Color.WHITE, 0.6f));
+ DrawRectangleRec(colorsRecs[colorMouseHover], ColorAlpha(Color.White, 0.6f));
}
Rectangle rec = new(
@@ -262,18 +262,18 @@ public class MousePainting
colorsRecs[colorSelected].Width + 4,
colorsRecs[colorSelected].Height + 4
);
- DrawRectangleLinesEx(rec, 2, Color.BLACK);
+ DrawRectangleLinesEx(rec, 2, Color.Black);
// Draw save image button
- DrawRectangleLinesEx(btnSaveRec, 2, btnSaveMouseHover ? Color.RED : Color.BLACK);
- DrawText("SAVE!", 755, 20, 10, btnSaveMouseHover ? Color.RED : Color.BLACK);
+ DrawRectangleLinesEx(btnSaveRec, 2, btnSaveMouseHover ? Color.Red : Color.Black);
+ DrawText("SAVE!", 755, 20, 10, btnSaveMouseHover ? Color.Red : Color.Black);
// Draw save image message
if (showSaveMessage)
{
- DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), ColorAlpha(Color.RAYWHITE, 0.8f));
- DrawRectangle(0, 150, GetScreenWidth(), 80, Color.BLACK);
- DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, Color.RAYWHITE);
+ DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), ColorAlpha(Color.RayWhite, 0.8f));
+ DrawRectangle(0, 150, GetScreenWidth(), 80, Color.Black);
+ DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, Color.RayWhite);
}
EndDrawing();
diff --git a/Examples/Textures/NpatchDrawing.cs b/Examples/Textures/NpatchDrawing.cs
index d304a4b..58315ca 100644
--- a/Examples/Textures/NpatchDrawing.cs
+++ b/Examples/Textures/NpatchDrawing.cs
@@ -50,7 +50,7 @@ public class NpatchDrawing
Top = 40,
Right = 12,
Bottom = 12,
- Layout = NPatchLayout.NPATCH_NINE_PATCH
+ Layout = NPatchLayout.NinePatch
};
NPatchInfo ninePatchInfo2 = new NPatchInfo
{
@@ -59,7 +59,7 @@ public class NpatchDrawing
Top = 16,
Right = 16,
Bottom = 16,
- Layout = NPatchLayout.NPATCH_NINE_PATCH
+ Layout = NPatchLayout.NinePatch
};
// A horizontal 3-patch (NPT_3PATCH_HORIZONTAL) changes its sizes along the x axis only
@@ -70,7 +70,7 @@ public class NpatchDrawing
Top = 8,
Right = 8,
Bottom = 8,
- Layout = NPatchLayout.NPATCH_THREE_PATCH_HORIZONTAL
+ Layout = NPatchLayout.ThreePatchHorizontal
};
// A vertical 3-patch (NPT_3PATCH_VERTICAL) changes its sizes along the y axis only
@@ -81,7 +81,7 @@ public class NpatchDrawing
Top = 6,
Right = 6,
Bottom = 6,
- Layout = NPatchLayout.NPATCH_THREE_PATCH_VERTICAL
+ Layout = NPatchLayout.ThreePatchVertical
};
SetTargetFPS(60);
@@ -114,20 +114,20 @@ public class NpatchDrawing
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw the n-patches
- DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, Color.WHITE);
- DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, Color.WHITE);
- DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, Color.WHITE);
- DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, Color.WHITE);
+ DrawTextureNPatch(nPatchTexture, ninePatchInfo2, dstRec2, origin, 0.0f, Color.White);
+ DrawTextureNPatch(nPatchTexture, ninePatchInfo1, dstRec1, origin, 0.0f, Color.White);
+ DrawTextureNPatch(nPatchTexture, h3PatchInfo, dstRecH, origin, 0.0f, Color.White);
+ DrawTextureNPatch(nPatchTexture, v3PatchInfo, dstRecV, origin, 0.0f, Color.White);
// Draw the source texture
- DrawRectangleLines(5, 88, 74, 266, Color.BLUE);
- DrawTexture(nPatchTexture, 10, 93, Color.WHITE);
- DrawText("TEXTURE", 15, 360, 10, Color.DARKGRAY);
+ DrawRectangleLines(5, 88, 74, 266, Color.Blue);
+ DrawTexture(nPatchTexture, 10, 93, Color.White);
+ DrawText("TEXTURE", 15, 360, 10, Color.DarkGray);
- DrawText("Move the mouse to stretch or shrink the n-patches", 10, 20, 20, Color.DARKGRAY);
+ DrawText("Move the mouse to stretch or shrink the n-patches", 10, 20, 20, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/ParticlesBlending.cs b/Examples/Textures/ParticlesBlending.cs
index 95618af..e011f44 100644
--- a/Examples/Textures/ParticlesBlending.cs
+++ b/Examples/Textures/ParticlesBlending.cs
@@ -60,7 +60,7 @@ public class ParticlesBlending
float gravity = 3.0f;
Texture2D smoke = LoadTexture("resources/spark_flame.png");
- BlendMode blending = BlendMode.BLEND_ALPHA;
+ BlendMode blending = BlendMode.Alpha;
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
@@ -102,15 +102,15 @@ public class ParticlesBlending
}
}
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
- if (blending == BlendMode.BLEND_ALPHA)
+ if (blending == BlendMode.Alpha)
{
- blending = BlendMode.BLEND_ADDITIVE;
+ blending = BlendMode.Additive;
}
else
{
- blending = BlendMode.BLEND_ALPHA;
+ blending = BlendMode.Alpha;
}
}
//----------------------------------------------------------------------------------
@@ -118,7 +118,7 @@ public class ParticlesBlending
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.DARKGRAY);
+ ClearBackground(Color.DarkGray);
BeginBlendMode(blending);
@@ -145,15 +145,15 @@ public class ParticlesBlending
EndBlendMode();
- DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, Color.BLACK);
+ DrawText("PRESS SPACE to CHANGE BLENDING MODE", 180, 20, 20, Color.Black);
- if (blending == BlendMode.BLEND_ALPHA)
+ if (blending == BlendMode.Alpha)
{
- DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, Color.BLACK);
+ DrawText("ALPHA BLENDING", 290, screenHeight - 40, 20, Color.Black);
}
else
{
- DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, Color.RAYWHITE);
+ DrawText("ADDITIVE BLENDING", 280, screenHeight - 40, 20, Color.RayWhite);
}
EndDrawing();
diff --git a/Examples/Textures/Polygon.cs b/Examples/Textures/Polygon.cs
index 2ab5abe..b9fb586 100644
--- a/Examples/Textures/Polygon.cs
+++ b/Examples/Textures/Polygon.cs
@@ -81,11 +81,11 @@ public class Polygon
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawText("Textured Polygon", 20, 20, 20, Color.DARKGRAY);
+ DrawText("Textured Polygon", 20, 20, 20, Color.DarkGray);
Vector2 center = new(screenWidth / 2, screenHeight / 2);
- DrawTexturePoly(texture, center, positions, texcoords, positions.Length, Color.WHITE);
+ DrawTexturePoly(texture, center, positions, texcoords, positions.Length, Color.White);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -116,7 +116,7 @@ public class Polygon
Rlgl.SetTexture(texture.Id);
// Texturing is only supported on RL_QUADS
- Rlgl.Begin(DrawMode.QUADS);
+ Rlgl.Begin(DrawMode.Quads);
Rlgl.Color4ub(tint.R, tint.G, tint.B, tint.A);
diff --git a/Examples/Textures/RawData.cs b/Examples/Textures/RawData.cs
index 9f11011..e1b162e 100644
--- a/Examples/Textures/RawData.cs
+++ b/Examples/Textures/RawData.cs
@@ -33,7 +33,7 @@ public class RawData
"resources/fudesumi.raw",
384,
512,
- PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ PixelFormat.UncompressedR8G8B8A8,
0
);
Texture2D fudesumi = LoadTextureFromImage(fudesumiRaw);
@@ -51,11 +51,11 @@ public class RawData
{
if (((x / 32 + y / 32) / 1) % 2 == 0)
{
- pixels[y * width + x] = Color.ORANGE;
+ pixels[y * width + x] = Color.Orange;
}
else
{
- pixels[y * width + x] = Color.GOLD;
+ pixels[y * width + x] = Color.Gold;
}
}
}
@@ -66,7 +66,7 @@ public class RawData
Data = pixels,
Width = width,
Height = height,
- Format = PixelFormat.PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ Format = PixelFormat.UncompressedR8G8B8A8,
Mipmaps = 1,
};
Texture2D checkedTex = LoadTextureFromImage(checkedIm);
@@ -84,18 +84,18 @@ public class RawData
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
int x = screenWidth / 2 - checkedTex.Width / 2;
int y = screenHeight / 2 - checkedTex.Height / 2;
- DrawTexture(checkedTex, x, y, ColorAlpha(Color.WHITE, 0.5f));
- DrawTexture(fudesumi, 430, -30, Color.WHITE);
+ DrawTexture(checkedTex, x, y, ColorAlpha(Color.White, 0.5f));
+ DrawTexture(fudesumi, 430, -30, Color.White);
- DrawText("CHECKED TEXTURE ", 84, 85, 30, Color.BROWN);
- DrawText("GENERATED by CODE", 72, 148, 30, Color.BROWN);
- DrawText("and RAW IMAGE LOADING", 46, 210, 30, Color.BROWN);
+ DrawText("CHECKED TEXTURE ", 84, 85, 30, Color.Brown);
+ DrawText("GENERATED by CODE", 72, 148, 30, Color.Brown);
+ DrawText("and RAW IMAGE LOADING", 46, 210, 30, Color.Brown);
- DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, Color.BROWN);
+ DrawText("(c) Fudesumi sprite by Eiden Marsal", 310, screenHeight - 20, 10, Color.Brown);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/SpriteAnim.cs b/Examples/Textures/SpriteAnim.cs
index 42dd968..4ae3759 100644
--- a/Examples/Textures/SpriteAnim.cs
+++ b/Examples/Textures/SpriteAnim.cs
@@ -64,11 +64,11 @@ public class SpriteAnim
frameRec.X = (float)currentFrame * (float)scarfy.Width / 6;
}
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
framesSpeed++;
}
- else if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ else if (IsKeyPressed(KeyboardKey.Left))
{
framesSpeed--;
}
@@ -79,34 +79,34 @@ public class SpriteAnim
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
- DrawTexture(scarfy, 15, 40, Color.WHITE);
- DrawRectangleLines(15, 40, scarfy.Width, scarfy.Height, Color.LIME);
+ DrawTexture(scarfy, 15, 40, Color.White);
+ DrawRectangleLines(15, 40, scarfy.Width, scarfy.Height, Color.Lime);
DrawRectangleLines(
15 + (int)frameRec.X,
40 + (int)frameRec.Y,
(int)frameRec.Width,
(int)frameRec.Height,
- Color.RED
+ Color.Red
);
- DrawText("FRAME SPEED: ", 165, 210, 10, Color.DARKGRAY);
- DrawText($"{framesSpeed:2F} FPS", 575, 210, 10, Color.DARKGRAY);
- DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, Color.DARKGRAY);
+ DrawText("FRAME SPEED: ", 165, 210, 10, Color.DarkGray);
+ DrawText($"{framesSpeed:2F} FPS", 575, 210, 10, Color.DarkGray);
+ DrawText("PRESS RIGHT/LEFT KEYS to CHANGE SPEED!", 290, 240, 10, Color.DarkGray);
for (int i = 0; i < MaxFrameSpeed; i++)
{
if (i < framesSpeed)
{
- DrawRectangle(250 + 21 * i, 205, 20, 20, Color.RED);
+ DrawRectangle(250 + 21 * i, 205, 20, 20, Color.Red);
}
- DrawRectangleLines(250 + 21 * i, 205, 20, 20, Color.MAROON);
+ DrawRectangleLines(250 + 21 * i, 205, 20, 20, Color.Maroon);
}
// Draw part of the texture
- DrawTextureRec(scarfy, frameRec, position, Color.WHITE);
- DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawTextureRec(scarfy, frameRec, position, Color.White);
+ DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/SpriteButton.cs b/Examples/Textures/SpriteButton.cs
index ae8bb97..c2de041 100644
--- a/Examples/Textures/SpriteButton.cs
+++ b/Examples/Textures/SpriteButton.cs
@@ -67,7 +67,7 @@ public class SpriteButton
// Check button state
if (CheckCollisionPointRec(mousePoint, btnBounds))
{
- if (IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonDown(MouseButton.Left))
{
btnState = 2;
}
@@ -76,7 +76,7 @@ public class SpriteButton
btnState = 1;
}
- if (IsMouseButtonReleased(MouseButton.MOUSE_LEFT_BUTTON))
+ if (IsMouseButtonReleased(MouseButton.Left))
{
btnAction = true;
}
@@ -99,10 +99,10 @@ public class SpriteButton
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw button frame
- DrawTextureRec(button, sourceRec, new Vector2(btnBounds.X, btnBounds.Y), Color.WHITE);
+ DrawTextureRec(button, sourceRec, new Vector2(btnBounds.X, btnBounds.Y), Color.White);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/SpriteExplosion.cs b/Examples/Textures/SpriteExplosion.cs
index 60cf560..f748686 100644
--- a/Examples/Textures/SpriteExplosion.cs
+++ b/Examples/Textures/SpriteExplosion.cs
@@ -62,7 +62,7 @@ public class SpriteExplosion
//----------------------------------------------------------------------------------
// Check for mouse button pressed and activate explosion (if not active)
- if (IsMouseButtonPressed(MouseButton.MOUSE_LEFT_BUTTON) && !active)
+ if (IsMouseButtonPressed(MouseButton.Left) && !active)
{
position = GetMousePosition();
active = true;
@@ -105,12 +105,12 @@ public class SpriteExplosion
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// Draw explosion required frame rectangle
if (active)
{
- DrawTextureRec(explosion, frameRec, position, Color.WHITE);
+ DrawTextureRec(explosion, frameRec, position, Color.White);
}
EndDrawing();
diff --git a/Examples/Textures/SrcRecDstRec.cs b/Examples/Textures/SrcRecDstRec.cs
index e71a9a5..dafc610 100644
--- a/Examples/Textures/SrcRecDstRec.cs
+++ b/Examples/Textures/SrcRecDstRec.cs
@@ -57,19 +57,19 @@ public class SrcRecDstRec
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
// NOTE: Using DrawTexturePro() we can easily rotate and scale the part of the texture we draw
// sourceRec defines the part of the texture we use for drawing
// destRec defines the rectangle where our texture part will fit (scaling it to fit)
// origin defines the point of the texture used as reference for rotation and scaling
// rotation defines the texture rotation (using origin as rotation point)
- DrawTexturePro(scarfy, sourceRec, destRec, origin, rotation, Color.WHITE);
+ DrawTexturePro(scarfy, sourceRec, destRec, origin, rotation, Color.White);
- DrawLine((int)destRec.X, 0, (int)destRec.X, screenHeight, Color.GRAY);
- DrawLine(0, (int)destRec.Y, screenWidth, (int)destRec.Y, Color.GRAY);
+ DrawLine((int)destRec.X, 0, (int)destRec.X, screenHeight, Color.Gray);
+ DrawLine(0, (int)destRec.Y, screenWidth, (int)destRec.Y, Color.Gray);
- DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, Color.GRAY);
+ DrawText("(c) Scarfy sprite by Eiden Marsal", screenWidth - 200, screenHeight - 20, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Examples/Textures/TexturedCurve.cs b/Examples/Textures/TexturedCurve.cs
index 81b28e5..44f16d0 100644
--- a/Examples/Textures/TexturedCurve.cs
+++ b/Examples/Textures/TexturedCurve.cs
@@ -34,12 +34,12 @@ public unsafe class TexturedCurve
const int screenWidth = 800;
const int screenHeight = 450;
- SetConfigFlags(ConfigFlags.FLAG_VSYNC_HINT | ConfigFlags.FLAG_MSAA_4X_HINT);
+ SetConfigFlags(ConfigFlags.VSyncHint | ConfigFlags.Msaa4xHint);
InitWindow(screenWidth, screenHeight, "raylib [textures] examples - textured curve");
// Load the road texture
texRoad = LoadTexture("resources/road.png");
- SetTextureFilter(texRoad, TextureFilter.TEXTURE_FILTER_BILINEAR);
+ SetTextureFilter(texRoad, TextureFilter.Bilinear);
// Setup the curve
curveStartPosition = new Vector2(80, 100);
@@ -63,14 +63,14 @@ public unsafe class TexturedCurve
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
DrawTexturedCurve();
DrawCurve();
- DrawText("Drag points to move curve, press SPACE to show/hide base curve", 10, 10, 10, Color.DARKGRAY);
- DrawText($"Curve width: {curveWidth} (Use + and - to adjust)", 10, 30, 10, Color.DARKGRAY);
- DrawText($"Curve segments: {curveSegments} (Use LEFT and RIGHT to adjust)", 10, 50, 10, Color.DARKGRAY);
+ DrawText("Drag points to move curve, press SPACE to show/hide base curve", 10, 10, 10, Color.DarkGray);
+ DrawText($"Curve width: {curveWidth} (Use + and - to adjust)", 10, 30, 10, Color.DarkGray);
+ DrawText($"Curve segments: {curveSegments} (Use LEFT and RIGHT to adjust)", 10, 50, 10, Color.DarkGray);
EndDrawing();
//----------------------------------------------------------------------------------
@@ -96,44 +96,44 @@ public unsafe class TexturedCurve
curveStartPositionTangent,
curveEndPositionTangent,
2,
- Color.BLUE
+ Color.Blue
);
}
// Draw the various control points and highlight where the mouse is
- DrawLineV(curveStartPosition, curveStartPositionTangent, Color.SKYBLUE);
- DrawLineV(curveEndPosition, curveEndPositionTangent, Color.PURPLE);
+ DrawLineV(curveStartPosition, curveStartPositionTangent, Color.SkyBlue);
+ DrawLineV(curveEndPosition, curveEndPositionTangent, Color.Purple);
Vector2 mouse = GetMousePosition();
if (CheckCollisionPointCircle(mouse, curveStartPosition, 6))
{
- DrawCircleV(curveStartPosition, 7, Color.YELLOW);
+ DrawCircleV(curveStartPosition, 7, Color.Yellow);
}
- DrawCircleV(curveStartPosition, 5, Color.RED);
+ DrawCircleV(curveStartPosition, 5, Color.Red);
if (CheckCollisionPointCircle(mouse, curveStartPositionTangent, 6))
{
- DrawCircleV(curveStartPositionTangent, 7, Color.YELLOW);
+ DrawCircleV(curveStartPositionTangent, 7, Color.Yellow);
}
- DrawCircleV(curveStartPositionTangent, 5, Color.MAROON);
+ DrawCircleV(curveStartPositionTangent, 5, Color.Maroon);
if (CheckCollisionPointCircle(mouse, curveEndPosition, 6))
{
- DrawCircleV(curveEndPosition, 7, Color.YELLOW);
+ DrawCircleV(curveEndPosition, 7, Color.Yellow);
}
- DrawCircleV(curveEndPosition, 5, Color.GREEN);
+ DrawCircleV(curveEndPosition, 5, Color.Green);
if (CheckCollisionPointCircle(mouse, curveEndPositionTangent, 6))
{
- DrawCircleV(curveEndPositionTangent, 7, Color.YELLOW);
+ DrawCircleV(curveEndPositionTangent, 7, Color.Yellow);
}
- DrawCircleV(curveEndPositionTangent, 5, Color.DARKGREEN);
+ DrawCircleV(curveEndPositionTangent, 5, Color.DarkGreen);
}
static void UpdateCurve()
{
// If the mouse is not down, we are not editing the curve so clear the selection
- if (!IsMouseButtonDown(MouseButton.MOUSE_LEFT_BUTTON))
+ if (!IsMouseButtonDown(MouseButton.Left))
{
return;
}
@@ -219,7 +219,7 @@ public unsafe class TexturedCurve
// Draw the segment as a quad
Rlgl.SetTexture(texRoad.Id);
- Rlgl.Begin(DrawMode.QUADS);
+ Rlgl.Begin(DrawMode.Quads);
Rlgl.Color4ub(255, 255, 255, 255);
Rlgl.Normal3f(0.0f, 0.0f, 1.0f);
@@ -247,17 +247,17 @@ public unsafe class TexturedCurve
static void UpdateOptions()
{
- if (IsKeyPressed(KeyboardKey.KEY_SPACE))
+ if (IsKeyPressed(KeyboardKey.Space))
{
showCurve = !showCurve;
}
// Update with
- if (IsKeyPressed(KeyboardKey.KEY_EQUAL))
+ if (IsKeyPressed(KeyboardKey.Equal))
{
curveWidth += 2;
}
- if (IsKeyPressed(KeyboardKey.KEY_MINUS))
+ if (IsKeyPressed(KeyboardKey.Minus))
{
curveWidth -= 2;
}
@@ -268,11 +268,11 @@ public unsafe class TexturedCurve
}
// Update segments
- if (IsKeyPressed(KeyboardKey.KEY_LEFT))
+ if (IsKeyPressed(KeyboardKey.Left))
{
curveSegments -= 2;
}
- if (IsKeyPressed(KeyboardKey.KEY_RIGHT))
+ if (IsKeyPressed(KeyboardKey.Right))
{
curveSegments += 2;
}
diff --git a/Examples/Textures/ToImage.cs b/Examples/Textures/ToImage.cs
index 94c242c..a0dbc32 100644
--- a/Examples/Textures/ToImage.cs
+++ b/Examples/Textures/ToImage.cs
@@ -50,13 +50,13 @@ public class ToImage
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
- ClearBackground(Color.RAYWHITE);
+ ClearBackground(Color.RayWhite);
int x = screenWidth / 2 - texture.Width / 2;
int y = screenHeight / 2 - texture.Height / 2;
- DrawTexture(texture, x, y, Color.WHITE);
+ DrawTexture(texture, x, y, Color.White);
- DrawText("this IS a texture loaded from an image!", 300, 370, 10, Color.GRAY);
+ DrawText("this IS a texture loaded from an image!", 300, 370, 10, Color.Gray);
EndDrawing();
//----------------------------------------------------------------------------------
diff --git a/Raylib-cs/types/Camera3D.cs b/Raylib-cs/types/Camera3D.cs
index ecb3c05..935f6fa 100644
--- a/Raylib-cs/types/Camera3D.cs
+++ b/Raylib-cs/types/Camera3D.cs
@@ -8,11 +8,11 @@ namespace Raylib_cs;
///
public enum CameraMode
{
- CAMERA_CUSTOM = 0,
- CAMERA_FREE,
- CAMERA_ORBITAL,
- CAMERA_FIRST_PERSON,
- CAMERA_THIRD_PERSON
+ Custom = 0,
+ Free,
+ Orbital,
+ FirstPerson,
+ ThirdPerson
}
///
@@ -20,8 +20,8 @@ public enum CameraMode
///
public enum CameraProjection
{
- CAMERA_PERSPECTIVE = 0,
- CAMERA_ORTHOGRAPHIC
+ Perspective = 0,
+ Orthographic
}
///
diff --git a/Raylib-cs/types/Color.cs b/Raylib-cs/types/Color.cs
index f41d29b..8a47d63 100644
--- a/Raylib-cs/types/Color.cs
+++ b/Raylib-cs/types/Color.cs
@@ -16,32 +16,32 @@ public partial struct Color
// Example - Color.RED instead of RED
// Custom raylib color palette for amazing visuals
- public static readonly Color LIGHTGRAY = new Color(200, 200, 200, 255);
- public static readonly Color GRAY = new Color(130, 130, 130, 255);
- public static readonly Color DARKGRAY = new Color(80, 80, 80, 255);
- public static readonly Color YELLOW = new Color(253, 249, 0, 255);
- public static readonly Color GOLD = new Color(255, 203, 0, 255);
- public static readonly Color ORANGE = new Color(255, 161, 0, 255);
- public static readonly Color PINK = new Color(255, 109, 194, 255);
- public static readonly Color RED = new Color(230, 41, 55, 255);
- public static readonly Color MAROON = new Color(190, 33, 55, 255);
- public static readonly Color GREEN = new Color(0, 228, 48, 255);
- public static readonly Color LIME = new Color(0, 158, 47, 255);
- public static readonly Color DARKGREEN = new Color(0, 117, 44, 255);
- public static readonly Color SKYBLUE = new Color(102, 191, 255, 255);
- public static readonly Color BLUE = new Color(0, 121, 241, 255);
- public static readonly Color DARKBLUE = new Color(0, 82, 172, 255);
- public static readonly Color PURPLE = new Color(200, 122, 255, 255);
- public static readonly Color VIOLET = new Color(135, 60, 190, 255);
- public static readonly Color DARKPURPLE = new Color(112, 31, 126, 255);
- public static readonly Color BEIGE = new Color(211, 176, 131, 255);
- public static readonly Color BROWN = new Color(127, 106, 79, 255);
- public static readonly Color DARKBROWN = new Color(76, 63, 47, 255);
- public static readonly Color WHITE = new Color(255, 255, 255, 255);
- public static readonly Color BLACK = new Color(0, 0, 0, 255);
- public static readonly Color BLANK = new Color(0, 0, 0, 0);
- public static readonly Color MAGENTA = new Color(255, 0, 255, 255);
- public static readonly Color RAYWHITE = new Color(245, 245, 245, 255);
+ public static readonly Color LightGray = new Color(200, 200, 200, 255);
+ public static readonly Color Gray = new Color(130, 130, 130, 255);
+ public static readonly Color DarkGray = new Color(80, 80, 80, 255);
+ public static readonly Color Yellow = new Color(253, 249, 0, 255);
+ public static readonly Color Gold = new Color(255, 203, 0, 255);
+ public static readonly Color Orange = new Color(255, 161, 0, 255);
+ public static readonly Color Pink = new Color(255, 109, 194, 255);
+ public static readonly Color Red = new Color(230, 41, 55, 255);
+ public static readonly Color Maroon = new Color(190, 33, 55, 255);
+ public static readonly Color Green = new Color(0, 228, 48, 255);
+ public static readonly Color Lime = new Color(0, 158, 47, 255);
+ public static readonly Color DarkGreen = new Color(0, 117, 44, 255);
+ public static readonly Color SkyBlue = new Color(102, 191, 255, 255);
+ public static readonly Color Blue = new Color(0, 121, 241, 255);
+ public static readonly Color DarkBlue = new Color(0, 82, 172, 255);
+ public static readonly Color Purple = new Color(200, 122, 255, 255);
+ public static readonly Color Violet = new Color(135, 60, 190, 255);
+ public static readonly Color DarkPurple = new Color(112, 31, 126, 255);
+ public static readonly Color Beige = new Color(211, 176, 131, 255);
+ public static readonly Color Brown = new Color(127, 106, 79, 255);
+ public static readonly Color DarkBrown = new Color(76, 63, 47, 255);
+ public static readonly Color White = new Color(255, 255, 255, 255);
+ public static readonly Color Black = new Color(0, 0, 0, 255);
+ public static readonly Color Blank = new Color(0, 0, 0, 0);
+ public static readonly Color Magenta = new Color(255, 0, 255, 255);
+ public static readonly Color RayWhite = new Color(245, 245, 245, 255);
public Color(byte r, byte g, byte b, byte a)
{
diff --git a/Raylib-cs/types/Core.cs b/Raylib-cs/types/Core.cs
index ada1a5f..e6d8e27 100644
--- a/Raylib-cs/types/Core.cs
+++ b/Raylib-cs/types/Core.cs
@@ -13,82 +13,82 @@ public enum ConfigFlags : uint
///
/// Set to try enabling V-Sync on GPU
///
- FLAG_VSYNC_HINT = 0x00000040,
+ VSyncHint = 0x00000040,
///
/// Set to run program in fullscreen
///
- FLAG_FULLSCREEN_MODE = 0x00000002,
+ FullscreenMode = 0x00000002,
///
/// Set to allow resizable window
///
- FLAG_WINDOW_RESIZABLE = 0x00000004,
+ ResizableWindow = 0x00000004,
///
/// Set to disable window decoration (frame and buttons)
///
- FLAG_WINDOW_UNDECORATED = 0x00000008,
+ UndecoratedWindow = 0x00000008,
///
/// Set to hide window
///
- FLAG_WINDOW_HIDDEN = 0x00000080,
+ HiddenWindow = 0x00000080,
///
/// Set to minimize window (iconify)
///
- FLAG_WINDOW_MINIMIZED = 0x00000200,
+ MinimizedWindow = 0x00000200,
///
/// Set to maximize window (expanded to monitor)
///
- FLAG_WINDOW_MAXIMIZED = 0x00000400,
+ MaximizedWindow = 0x00000400,
///
/// Set to window non focused
///
- FLAG_WINDOW_UNFOCUSED = 0x00000800,
+ UnfocusedWindow = 0x00000800,
///
/// Set to window always on top
///
- FLAG_WINDOW_TOPMOST = 0x00001000,
+ TopmostWindow = 0x00001000,
///
/// Set to allow windows running while minimized
///
- FLAG_WINDOW_ALWAYS_RUN = 0x00000100,
+ AlwaysRunWindow = 0x00000100,
///
/// Set to allow transparent framebuffer
///
- FLAG_WINDOW_TRANSPARENT = 0x00000010,
+ TransparentWindow = 0x00000010,
///
/// Set to support HighDPI
///
- FLAG_WINDOW_HIGHDPI = 0x00002000,
+ HighDpiWindow = 0x00002000,
///
/// Set to support mouse passthrough, only supported when FLAG_WINDOW_UNDECORATED
///
- FLAG_WINDOW_MOUSE_PASSTHROUGH = 0x00004000,
+ MousePassthroughWindow = 0x00004000,
///
/// Set to run program in borderless windowed mode
///
- FLAG_BORDERLESS_WINDOWED_MODE = 0x00008000,
+ BorderlessWindowMode = 0x00008000,
///
/// Set to try enabling MSAA 4X
///
- FLAG_MSAA_4X_HINT = 0x00000020,
+ Msaa4xHint = 0x00000020,
///
/// Set to try enabling interlaced video format (for V3D)
///
- FLAG_INTERLACED_HINT = 0x00010000,
+ InterlacedHint = 0x00010000,
}
///
@@ -100,42 +100,42 @@ public enum TraceLogLevel
///
/// Display all logs
///
- LOG_ALL = 0,
+ All = 0,
///
/// Trace logging, intended for internal use only
///
- LOG_TRACE,
+ Trace,
///
/// Debug logging, used for internal debugging, it should be disabled on release builds
///
- LOG_DEBUG,
+ Debug,
///
/// Info logging, used for program execution info
///
- LOG_INFO,
+ Info,
///
/// Warning logging, used on recoverable failures
///
- LOG_WARNING,
+ Warning,
///
/// Error logging, used on unrecoverable failures
///
- LOG_ERROR,
+ Error,
///
/// Fatal logging, used to abort program: exit(EXIT_FAILURE)
///
- LOG_FATAL,
+ Fatal,
///
/// Disable logging
///
- LOG_NONE
+ None
}
///
@@ -146,40 +146,40 @@ public enum BlendMode
///
/// Blend textures considering alpha (default)
///
- BLEND_ALPHA = 0,
+ Alpha = 0,
///
/// Blend textures adding colors
///
- BLEND_ADDITIVE,
+ Additive,
///
/// Blend textures multiplying colors
///
- BLEND_MULTIPLIED,
+ Multiplied,
///
/// Blend textures adding colors (alternative)
///
- BLEND_ADD_COLORS,
+ AddColors,
///
/// Blend textures subtracting colors (alternative)
///
- BLEND_SUBTRACT_COLORS,
+ SubtractColors,
///
/// Blend premultiplied textures considering alpha
///
- BLEND_ALPHA_PREMULTIPLY,
+ AlphaPremultiply,
///
/// Blend textures using custom src/dst factors (use rlSetBlendFactors())
///
- BLEND_CUSTOM,
+ Custom,
///
/// Blend textures using custom rgb/alpha separate src/dst factors (use rlSetBlendFactorsSeparate())
///
- BLEND_CUSTOM_SEPARATE
+ CustomSeparate
}
diff --git a/Raylib-cs/types/Font.cs b/Raylib-cs/types/Font.cs
index 081de3b..1b4ed41 100644
--- a/Raylib-cs/types/Font.cs
+++ b/Raylib-cs/types/Font.cs
@@ -10,17 +10,17 @@ public enum FontType
///
/// Default font generation, anti-aliased
///
- FONT_DEFAULT = 0,
+ Default = 0,
///
/// Bitmap font generation, no anti-aliasing
///
- FONT_BITMAP,
+ Bitmap,
///
/// SDF font generation, requires external shader
///
- FONT_SDF
+ Sdf
}
///
diff --git a/Raylib-cs/types/Image.cs b/Raylib-cs/types/Image.cs
index 74f6362..fb6f6f9 100644
--- a/Raylib-cs/types/Image.cs
+++ b/Raylib-cs/types/Image.cs
@@ -11,107 +11,107 @@ public enum PixelFormat
///
/// 8 bit per pixel (no alpha)
///
- PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1,
+ UncompressedGrayscale = 1,
///
/// 8*2 bpp (2 channels)
///
- PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA,
+ UncompressedGrayAlpha,
///
/// 16 bpp
///
- PIXELFORMAT_UNCOMPRESSED_R5G6B5,
+ UncompressedR5G6B5,
///
/// 24 bpp
///
- PIXELFORMAT_UNCOMPRESSED_R8G8B8,
+ UncompressedR8G8B8,
///
/// 16 bpp (1 bit alpha)
///
- PIXELFORMAT_UNCOMPRESSED_R5G5B5A1,
+ UncompressedR5G5B5A1,
///
/// 16 bpp (4 bit alpha)
///
- PIXELFORMAT_UNCOMPRESSED_R4G4B4A4,
+ UncompressedR4G4B4A4,
///
/// 32 bpp
///
- PIXELFORMAT_UNCOMPRESSED_R8G8B8A8,
+ UncompressedR8G8B8A8,
///
/// 32 bpp (1 channel - float)
///
- PIXELFORMAT_UNCOMPRESSED_R32,
+ UncompressedR32,
///
/// 32*3 bpp (3 channels - float)
///
- PIXELFORMAT_UNCOMPRESSED_R32G32B32,
+ UncompressedR32G32B32,
///
/// 32*4 bpp (4 channels - float)
///
- PIXELFORMAT_UNCOMPRESSED_R32G32B32A32,
+ UncompressedR32G32B32A32,
///
/// 4 bpp (no alpha)
///
- PIXELFORMAT_COMPRESSED_DXT1_RGB,
+ CompressedDxt1Rgb,
///
/// 4 bpp (1 bit alpha)
///
- PIXELFORMAT_COMPRESSED_DXT1_RGBA,
+ CompressedDxt1Rgba,
///
/// 8 bpp
///
- PIXELFORMAT_COMPRESSED_DXT3_RGBA,
+ CompressedDxt3Rgba,
///
/// 8 bpp
///
- PIXELFORMAT_COMPRESSED_DXT5_RGBA,
+ CompressedDxt5Rgba,
///
/// 4 bpp
///
- PIXELFORMAT_COMPRESSED_ETC1_RGB,
+ CompressedEtc1Rgb,
///
/// 4 bpp
///
- PIXELFORMAT_COMPRESSED_ETC2_RGB,
+ CompressedEtc2Rgb,
///
/// 8 bpp
///
- PIXELFORMAT_COMPRESSED_ETC2_EAC_RGBA,
+ CompressedEtc2EacRgba,
///
/// 4 bpp
///
- PIXELFORMAT_COMPRESSED_PVRT_RGB,
+ CompressedPvrtRgb,
///
/// 4 bpp
///
- PIXELFORMAT_COMPRESSED_PVRT_RGBA,
+ CompressedPvrtRgba,
///
/// 8 bpp
///
- PIXELFORMAT_COMPRESSED_ASTC_4x4_RGBA,
+ CompressedAstc4X4Rgba,
///
/// 2 bpp
///
- PIXELFORMAT_COMPRESSED_ASTC_8x8_RGBA
+ CompressedAstc8X8Rgba
}
///
diff --git a/Raylib-cs/types/Input.cs b/Raylib-cs/types/Input.cs
index 460d6f3..2770b5e 100644
--- a/Raylib-cs/types/Input.cs
+++ b/Raylib-cs/types/Input.cs
@@ -13,124 +13,124 @@ public enum KeyboardKey
///
/// NULL, used for no key pressed
///
- KEY_NULL = 0,
+ Null = 0,
// Alphanumeric keys
- KEY_APOSTROPHE = 39,
- KEY_COMMA = 44,
- KEY_MINUS = 45,
- KEY_PERIOD = 46,
- KEY_SLASH = 47,
- KEY_ZERO = 48,
- KEY_ONE = 49,
- KEY_TWO = 50,
- KEY_THREE = 51,
- KEY_FOUR = 52,
- KEY_FIVE = 53,
- KEY_SIX = 54,
- KEY_SEVEN = 55,
- KEY_EIGHT = 56,
- KEY_NINE = 57,
- KEY_SEMICOLON = 59,
- KEY_EQUAL = 61,
- KEY_A = 65,
- KEY_B = 66,
- KEY_C = 67,
- KEY_D = 68,
- KEY_E = 69,
- KEY_F = 70,
- KEY_G = 71,
- KEY_H = 72,
- KEY_I = 73,
- KEY_J = 74,
- KEY_K = 75,
- KEY_L = 76,
- KEY_M = 77,
- KEY_N = 78,
- KEY_O = 79,
- KEY_P = 80,
- KEY_Q = 81,
- KEY_R = 82,
- KEY_S = 83,
- KEY_T = 84,
- KEY_U = 85,
- KEY_V = 86,
- KEY_W = 87,
- KEY_X = 88,
- KEY_Y = 89,
- KEY_Z = 90,
+ Apostrophe = 39,
+ Comma = 44,
+ Minus = 45,
+ Period = 46,
+ Slash = 47,
+ Zero = 48,
+ One = 49,
+ Two = 50,
+ Three = 51,
+ Four = 52,
+ Five = 53,
+ Six = 54,
+ Seven = 55,
+ Eight = 56,
+ Nine = 57,
+ Semicolon = 59,
+ Equal = 61,
+ A = 65,
+ B = 66,
+ C = 67,
+ D = 68,
+ E = 69,
+ F = 70,
+ G = 71,
+ H = 72,
+ I = 73,
+ J = 74,
+ K = 75,
+ L = 76,
+ M = 77,
+ N = 78,
+ O = 79,
+ P = 80,
+ Q = 81,
+ R = 82,
+ S = 83,
+ T = 84,
+ U = 85,
+ V = 86,
+ W = 87,
+ X = 88,
+ Y = 89,
+ Z = 90,
// Function keys
- KEY_SPACE = 32,
- KEY_ESCAPE = 256,
- KEY_ENTER = 257,
- KEY_TAB = 258,
- KEY_BACKSPACE = 259,
- KEY_INSERT = 260,
- KEY_DELETE = 261,
- KEY_RIGHT = 262,
- KEY_LEFT = 263,
- KEY_DOWN = 264,
- KEY_UP = 265,
- KEY_PAGE_UP = 266,
- KEY_PAGE_DOWN = 267,
- KEY_HOME = 268,
- KEY_END = 269,
- KEY_CAPS_LOCK = 280,
- KEY_SCROLL_LOCK = 281,
- KEY_NUM_LOCK = 282,
- KEY_PRINT_SCREEN = 283,
- KEY_PAUSE = 284,
- KEY_F1 = 290,
- KEY_F2 = 291,
- KEY_F3 = 292,
- KEY_F4 = 293,
- KEY_F5 = 294,
- KEY_F6 = 295,
- KEY_F7 = 296,
- KEY_F8 = 297,
- KEY_F9 = 298,
- KEY_F10 = 299,
- KEY_F11 = 300,
- KEY_F12 = 301,
- KEY_LEFT_SHIFT = 340,
- KEY_LEFT_CONTROL = 341,
- KEY_LEFT_ALT = 342,
- KEY_LEFT_SUPER = 343,
- KEY_RIGHT_SHIFT = 344,
- KEY_RIGHT_CONTROL = 345,
- KEY_RIGHT_ALT = 346,
- KEY_RIGHT_SUPER = 347,
- KEY_KB_MENU = 348,
- KEY_LEFT_BRACKET = 91,
- KEY_BACKSLASH = 92,
- KEY_RIGHT_BRACKET = 93,
- KEY_GRAVE = 96,
+ Space = 32,
+ Escape = 256,
+ Enter = 257,
+ Tab = 258,
+ Backspace = 259,
+ Insert = 260,
+ Delete = 261,
+ Right = 262,
+ Left = 263,
+ Down = 264,
+ Up = 265,
+ PageUp = 266,
+ PageDown = 267,
+ Home = 268,
+ End = 269,
+ CapsLock = 280,
+ ScrollLock = 281,
+ NumLock = 282,
+ PrintScreen = 283,
+ Pause = 284,
+ F1 = 290,
+ F2 = 291,
+ F3 = 292,
+ F4 = 293,
+ F5 = 294,
+ F6 = 295,
+ F7 = 296,
+ F8 = 297,
+ F9 = 298,
+ F10 = 299,
+ F11 = 300,
+ F12 = 301,
+ LeftShift = 340,
+ LeftControl = 341,
+ LeftAlt = 342,
+ LeftSuper = 343,
+ RightShift = 344,
+ RightControl = 345,
+ RightAlt = 346,
+ RightSuper = 347,
+ KeyboardMenu = 348,
+ LeftBracket = 91,
+ Backslash = 92,
+ RightBracket = 93,
+ Grave = 96,
// Keypad keys
- KEY_KP_0 = 320,
- KEY_KP_1 = 321,
- KEY_KP_2 = 322,
- KEY_KP_3 = 323,
- KEY_KP_4 = 324,
- KEY_KP_5 = 325,
- KEY_KP_6 = 326,
- KEY_KP_7 = 327,
- KEY_KP_8 = 328,
- KEY_KP_9 = 329,
- KEY_KP_DECIMAL = 330,
- KEY_KP_DIVIDE = 331,
- KEY_KP_MULTIPLY = 332,
- KEY_KP_SUBTRACT = 333,
- KEY_KP_ADD = 334,
- KEY_KP_ENTER = 335,
- KEY_KP_EQUAL = 336,
+ Kp0 = 320,
+ Kp1 = 321,
+ Kp2 = 322,
+ Kp3 = 323,
+ Kp4 = 324,
+ Kp5 = 325,
+ Kp6 = 326,
+ Kp7 = 327,
+ Kp8 = 328,
+ Kp9 = 329,
+ KpDecimal = 330,
+ KpDivide = 331,
+ KpMultiply = 332,
+ KpSubtract = 333,
+ KpAdd = 334,
+ KpEnter = 335,
+ KpEqual = 336,
// Android key buttons
- KEY_BACK = 4,
- KEY_MENU = 82,
- KEY_VOLUME_UP = 24,
- KEY_VOLUME_DOWN = 25
+ Back = 4,
+ Menu = 82,
+ VolumeUp = 24,
+ VolumeDown = 25
}
///
@@ -141,41 +141,37 @@ public enum MouseButton
///
/// Mouse button left
///
- MOUSE_BUTTON_LEFT = 0,
+ Left = 0,
///
/// Mouse button right
///
- MOUSE_BUTTON_RIGHT = 1,
+ Right = 1,
///
/// Mouse button middle (pressed wheel)
///
- MOUSE_BUTTON_MIDDLE = 2,
+ Middle = 2,
///
/// Mouse button side (advanced mouse device)
///
- MOUSE_BUTTON_SIDE = 3,
+ Side = 3,
///
/// Mouse button extra (advanced mouse device)
///
- MOUSE_BUTTON_EXTRA = 4,
+ Extra = 4,
///
/// Mouse button forward (advanced mouse device)
///
- MOUSE_BUTTON_FORWARD = 5,
+ Forward = 5,
///
/// Mouse button back (advanced mouse device)
///
- MOUSE_BUTTON_BACK = 6,
-
- MOUSE_LEFT_BUTTON = MOUSE_BUTTON_LEFT,
- MOUSE_RIGHT_BUTTON = MOUSE_BUTTON_RIGHT,
- MOUSE_MIDDLE_BUTTON = MOUSE_BUTTON_MIDDLE,
+ Back = 6
}
///
@@ -186,57 +182,57 @@ public enum MouseCursor
///
/// Default pointer shape
///
- MOUSE_CURSOR_DEFAULT = 0,
+ Default = 0,
///
/// Arrow shape
///
- MOUSE_CURSOR_ARROW = 1,
+ Arrow = 1,
///
/// Text writing cursor shape
///
- MOUSE_CURSOR_IBEAM = 2,
+ IBeam = 2,
///
/// Cross shape
///
- MOUSE_CURSOR_CROSSHAIR = 3,
+ Crosshair = 3,
///
/// Pointing hand cursor
///
- MOUSE_CURSOR_POINTING_HAND = 4,
+ PointingHand = 4,
///
/// Horizontal resize/move arrow shape
///
- MOUSE_CURSOR_RESIZE_EW = 5,
+ ResizeEw = 5,
///
/// Vertical resize/move arrow shape
///
- MOUSE_CURSOR_RESIZE_NS = 6,
+ ResizeNs = 6,
///
/// Top-left to bottom-right diagonal resize/move arrow shape
///
- MOUSE_CURSOR_RESIZE_NWSE = 7,
+ ResizeNwse = 7,
///
/// The top-right to bottom-left diagonal resize/move arrow shape
///
- MOUSE_CURSOR_RESIZE_NESW = 8,
+ ResizeNesw = 8,
///
/// The omnidirectional resize/move cursor shape
///
- MOUSE_CURSOR_RESIZE_ALL = 9,
+ ResizeAll = 9,
///
/// The operation-not-allowed shape
///
- MOUSE_CURSOR_NOT_ALLOWED = 10
+ NotAllowed = 10
}
/// Gamepad axis
@@ -245,32 +241,32 @@ public enum GamepadAxis
///
/// Gamepad left stick X axis
///
- GAMEPAD_AXIS_LEFT_X = 0,
+ LeftX = 0,
///
/// Gamepad left stick Y axis
///
- GAMEPAD_AXIS_LEFT_Y = 1,
+ LeftY = 1,
///
/// Gamepad right stick X axis
///
- GAMEPAD_AXIS_RIGHT_X = 2,
+ RightX = 2,
///
/// Gamepad right stick Y axis
///
- GAMEPAD_AXIS_RIGHT_Y = 3,
+ RightY = 3,
///
/// Gamepad back trigger left, pressure level: [1..-1]
///
- GAMEPAD_AXIS_LEFT_TRIGGER = 4,
+ LeftTrigger = 4,
///
/// Gamepad back trigger right, pressure level: [1..-1]
///
- GAMEPAD_AXIS_RIGHT_TRIGGER = 5
+ RightTrigger = 5
}
///
@@ -281,92 +277,92 @@ public enum GamepadButton
///
/// Unknown button, just for error checking
///
- GAMEPAD_BUTTON_UNKNOWN = 0,
+ Unknown = 0,
///
/// Gamepad left DPAD up button
///
- GAMEPAD_BUTTON_LEFT_FACE_UP,
+ LeftFaceUp,
///
/// Gamepad left DPAD right button
///
- GAMEPAD_BUTTON_LEFT_FACE_RIGHT,
+ LeftFaceRight,
///
/// Gamepad left DPAD down button
///
- GAMEPAD_BUTTON_LEFT_FACE_DOWN,
+ LeftFaceDown,
///
/// Gamepad left DPAD left button
///
- GAMEPAD_BUTTON_LEFT_FACE_LEFT,
+ LeftFaceLeft,
///
/// Gamepad right button up (i.e. PS3: Triangle, Xbox: Y)
///
- GAMEPAD_BUTTON_RIGHT_FACE_UP,
+ RightFaceUp,
///
/// Gamepad right button right (i.e. PS3: Square, Xbox: X)
///
- GAMEPAD_BUTTON_RIGHT_FACE_RIGHT,
+ RightFaceRight,
///
/// Gamepad right button down (i.e. PS3: Cross, Xbox: A)
///
- GAMEPAD_BUTTON_RIGHT_FACE_DOWN,
+ RightFaceDown,
///
/// Gamepad right button left (i.e. PS3: Circle, Xbox: B)
///
- GAMEPAD_BUTTON_RIGHT_FACE_LEFT,
+ RightFaceLeft,
///
/// Gamepad top/back trigger left (first), it could be a trailing button
///
- GAMEPAD_BUTTON_LEFT_TRIGGER_1,
+ LeftTrigger1,
///
/// Gamepad top/back trigger left (second), it could be a trailing button
///
- GAMEPAD_BUTTON_LEFT_TRIGGER_2,
+ LeftTrigger2,
///
/// Gamepad top/back trigger right (first), it could be a trailing button
///
- GAMEPAD_BUTTON_RIGHT_TRIGGER_1,
+ RightTrigger1,
///
/// Gamepad top/back trigger right (second), it could be a trailing button
///
- GAMEPAD_BUTTON_RIGHT_TRIGGER_2,
+ RightTrigger2,
///
/// Gamepad center buttons, left one (i.e. PS3: Select)
///
- GAMEPAD_BUTTON_MIDDLE_LEFT,
+ MiddleLeft,
///
/// Gamepad center buttons, middle one (i.e. PS3: PS, Xbox: XBOX)
///
- GAMEPAD_BUTTON_MIDDLE,
+ Middle,
///
/// Gamepad center buttons, right one (i.e. PS3: Start)
///
- GAMEPAD_BUTTON_MIDDLE_RIGHT,
+ MiddleRight,
///
/// Gamepad joystick pressed button left
///
- GAMEPAD_BUTTON_LEFT_THUMB,
+ LeftThumb,
///
/// Gamepad joystick pressed button right
///
- GAMEPAD_BUTTON_RIGHT_THUMB
+ RightThumb
}
///
@@ -376,17 +372,17 @@ public enum GamepadButton
[Flags]
public enum Gesture : uint
{
- GESTURE_NONE = 0,
- GESTURE_TAP = 1,
- GESTURE_DOUBLETAP = 2,
- GESTURE_HOLD = 4,
- GESTURE_DRAG = 8,
- GESTURE_SWIPE_RIGHT = 16,
- GESTURE_SWIPE_LEFT = 32,
- GESTURE_SWIPE_UP = 64,
- GESTURE_SWIPE_DOWN = 128,
- GESTURE_PINCH_IN = 256,
- GESTURE_PINCH_OUT = 512
+ None = 0,
+ Tap = 1,
+ DoubleTap = 2,
+ Hold = 4,
+ Drag = 8,
+ SwipeRight = 16,
+ SwipeLeft = 32,
+ SwipeUp = 64,
+ SwipeDown = 128,
+ PinchIn = 256,
+ PinchOut = 512
}
///
diff --git a/Raylib-cs/types/Material.cs b/Raylib-cs/types/Material.cs
index 3ee4c5e..45de7c5 100644
--- a/Raylib-cs/types/Material.cs
+++ b/Raylib-cs/types/Material.cs
@@ -10,38 +10,38 @@ public enum MaterialMapIndex
///
/// NOTE: Same as MATERIAL_MAP_DIFFUSE
///
- MATERIAL_MAP_ALBEDO = 0,
+ Albedo = 0,
///
/// NOTE: Same as MATERIAL_MAP_SPECULAR
///
- MATERIAL_MAP_METALNESS,
+ Metalness,
- MATERIAL_MAP_NORMAL,
- MATERIAL_MAP_ROUGHNESS,
- MATERIAL_MAP_OCCLUSION,
- MATERIAL_MAP_EMISSION,
- MATERIAL_MAP_HEIGHT,
+ Normal,
+ Roughness,
+ Occlusion,
+ Emission,
+ Height,
///
/// NOTE: Uses GL_TEXTURE_CUBE_MAP
///
- MATERIAL_MAP_CUBEMAP,
+ Cubemap,
///
/// NOTE: Uses GL_TEXTURE_CUBE_MAP
///
- MATERIAL_MAP_IRRADIANCE,
+ Irradiance,
///
/// NOTE: Uses GL_TEXTURE_CUBE_MAP
///
- MATERIAL_MAP_PREFILTER,
+ Prefilter,
- MATERIAL_MAP_BRDF,
+ Brdf,
- MATERIAL_MAP_DIFFUSE = MATERIAL_MAP_ALBEDO,
- MATERIAL_MAP_SPECULAR = MATERIAL_MAP_METALNESS,
+ Diffuse = Albedo,
+ Specular = Metalness,
}
///
diff --git a/Raylib-cs/types/NPatchInfo.cs b/Raylib-cs/types/NPatchInfo.cs
index 7a94ca2..cee694b 100644
--- a/Raylib-cs/types/NPatchInfo.cs
+++ b/Raylib-cs/types/NPatchInfo.cs
@@ -10,17 +10,17 @@ public enum NPatchLayout
///
/// Npatch defined by 3x3 tiles
///
- NPATCH_NINE_PATCH = 0,
+ NinePatch = 0,
///
/// Npatch defined by 1x3 tiles
///
- NPATCH_THREE_PATCH_VERTICAL,
+ ThreePatchVertical,
///
/// Npatch defined by 3x1 tiles
///
- NPATCH_THREE_PATCH_HORIZONTAL
+ ThreePatchHorizontal
}
///
diff --git a/Raylib-cs/types/RenderBatch.cs b/Raylib-cs/types/RenderBatch.cs
index 43c1f90..c8e9b8e 100644
--- a/Raylib-cs/types/RenderBatch.cs
+++ b/Raylib-cs/types/RenderBatch.cs
@@ -140,37 +140,37 @@ public partial struct DrawCall
public enum GlVersion
{
- OPENGL_11 = 1,
- OPENGL_21,
- OPENGL_33,
- OPENGL_43,
- OPENGL_ES_20
+ OpenGl11 = 1,
+ OpenGl21,
+ OpenGl33,
+ OpenGl43,
+ OpenGlEs20
}
public enum FramebufferAttachType
{
- RL_ATTACHMENT_COLOR_CHANNEL0 = 0,
- RL_ATTACHMENT_COLOR_CHANNEL1,
- RL_ATTACHMENT_COLOR_CHANNEL2,
- RL_ATTACHMENT_COLOR_CHANNEL3,
- RL_ATTACHMENT_COLOR_CHANNEL4,
- RL_ATTACHMENT_COLOR_CHANNEL5,
- RL_ATTACHMENT_COLOR_CHANNEL6,
- RL_ATTACHMENT_COLOR_CHANNEL7,
- RL_ATTACHMENT_DEPTH = 100,
- RL_ATTACHMENT_STENCIL = 200,
+ ColorChannel0 = 0,
+ ColorChannel1,
+ ColorChannel2,
+ ColorChannel3,
+ ColorChannel4,
+ ColorChannel5,
+ ColorChannel6,
+ ColorChannel7,
+ Depth = 100,
+ Stencil = 200,
}
public enum FramebufferAttachTextureType
{
- RL_ATTACHMENT_CUBEMAP_POSITIVE_X = 0,
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_X,
- RL_ATTACHMENT_CUBEMAP_POSITIVE_Y,
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_Y,
- RL_ATTACHMENT_CUBEMAP_POSITIVE_Z,
- RL_ATTACHMENT_CUBEMAP_NEGATIVE_Z,
- RL_ATTACHMENT_TEXTURE2D = 100,
- RL_ATTACHMENT_RENDERBUFFER = 200,
+ CubemapPositiveX = 0,
+ CubemapNegativeX,
+ CubemapPositiveY,
+ CubemapNegativeY,
+ CubemapPositiveZ,
+ CubemapNegativeZ,
+ Texture2D = 100,
+ Renderbuffer = 200,
}
///
@@ -181,17 +181,17 @@ public enum MatrixMode
///
/// GL_MODELVIEW
///
- MODELVIEW = 0x1700,
+ ModelView = 0x1700,
///
/// GL_PROJECTION
///
- PROJECTION = 0x1701,
+ Projection = 0x1701,
///
/// GL_TEXTURE
///
- TEXTURE = 0x1702
+ Texture = 0x1702
}
///
@@ -202,17 +202,17 @@ public enum DrawMode
///
/// GL_LINES
///
- LINES = 0x0001,
+ Lines = 0x0001,
///
/// GL_TRIANGLES
///
- TRIANGLES = 0x0004,
+ Triangles = 0x0004,
///
/// GL_QUADS
///
- QUADS = 0x0007
+ Quads = 0x0007
}
///
@@ -225,49 +225,49 @@ public enum TextureFilters
///
/// GL_NEAREST
///
- NEAREST = 0x2600,
+ Nearest = 0x2600,
///
/// RL_TEXTURE_FILTER_LINEAR
///
/// GL_LINEAR
///
- LINEAR = 0x2601,
+ Linear = 0x2601,
///
/// RL_TEXTURE_FILTER_MIP_NEAREST
///
/// GL_NEAREST_MIPMAP_NEAREST
///
- MIP_NEAREST = 0x2700,
+ MipNearest = 0x2700,
///
/// RL_TEXTURE_FILTER_NEAREST_MIP_LINEAR
///
/// GL_NEAREST_MIPMAP_LINEAR
///
- NEAREST_MIP_LINEAR = 0x2702,
+ NearestMipLinear = 0x2702,
///
/// RL_TEXTURE_FILTER_LINEAR_MIP_NEAREST
///
/// GL_LINEAR_MIPMAP_NEAREST
///
- LINEAR_MIP_NEAREST = 0x2701,
+ LinearMipNearest = 0x2701,
///
/// RL_TEXTURE_FILTER_MIP_LINEAR
///
/// GL_LINEAR_MIPMAP_LINEAR
///
- MIP_LINEAR = 0x2703,
+ MipLinear = 0x2703,
///
/// RL_TEXTURE_FILTER_ANISOTROPIC
///
/// Anisotropic filter (custom identifier)
///
- ANISOTROPIC = 0x3000
+ Anisotropic = 0x3000
}
///
@@ -280,19 +280,19 @@ public enum ShaderType
///
/// GL_FRAGMENT_SHADER
///
- FRAGMENT = 0x8B30,
+ Fragment = 0x8B30,
///
/// RL_VERTEX_SHADER
///
/// GL_VERTEX_SHADER
///
- VERTEX = 0x8B31,
+ Vertex = 0x8B31,
///
/// RL_COMPUTE_SHADER
///
/// GL_COMPUTE_SHADER
///
- COMPUTE = 0x91b9
+ Compute = 0x91b9
}
diff --git a/Raylib-cs/types/Shader.cs b/Raylib-cs/types/Shader.cs
index e242da6..6b90cfa 100644
--- a/Raylib-cs/types/Shader.cs
+++ b/Raylib-cs/types/Shader.cs
@@ -7,35 +7,35 @@ namespace Raylib_cs;
///
public enum ShaderLocationIndex
{
- SHADER_LOC_VERTEX_POSITION = 0,
- SHADER_LOC_VERTEX_TEXCOORD01,
- SHADER_LOC_VERTEX_TEXCOORD02,
- SHADER_LOC_VERTEX_NORMAL,
- SHADER_LOC_VERTEX_TANGENT,
- SHADER_LOC_VERTEX_COLOR,
- SHADER_LOC_MATRIX_MVP,
- SHADER_LOC_MATRIX_VIEW,
- SHADER_LOC_MATRIX_PROJECTION,
- SHADER_LOC_MATRIX_MODEL,
- SHADER_LOC_MATRIX_NORMAL,
- SHADER_LOC_VECTOR_VIEW,
- SHADER_LOC_COLOR_DIFFUSE,
- SHADER_LOC_COLOR_SPECULAR,
- SHADER_LOC_COLOR_AMBIENT,
- SHADER_LOC_MAP_ALBEDO,
- SHADER_LOC_MAP_METALNESS,
- SHADER_LOC_MAP_NORMAL,
- SHADER_LOC_MAP_ROUGHNESS,
- SHADER_LOC_MAP_OCCLUSION,
- SHADER_LOC_MAP_EMISSION,
- SHADER_LOC_MAP_HEIGHT,
- SHADER_LOC_MAP_CUBEMAP,
- SHADER_LOC_MAP_IRRADIANCE,
- SHADER_LOC_MAP_PREFILTER,
- SHADER_LOC_MAP_BRDF,
+ VertexPosition = 0,
+ VertexTexcoord01,
+ VertexTexcoord02,
+ VertexNormal,
+ VertexTangent,
+ VertexColor,
+ MatrixMvp,
+ MatrixView,
+ MatrixProjection,
+ MatrixModel,
+ MatrixNormal,
+ VectorView,
+ ColorDiffuse,
+ ColorSpecular,
+ ColorAmbient,
+ MapAlbedo,
+ MapMetalness,
+ MapNormal,
+ MapRoughness,
+ MapOcclusion,
+ MapEmission,
+ MapHeight,
+ MapCubemap,
+ MapIrradiance,
+ MapPrefilter,
+ MapBrdf,
- SHADER_LOC_MAP_DIFFUSE = SHADER_LOC_MAP_ALBEDO,
- SHADER_LOC_MAP_SPECULAR = SHADER_LOC_MAP_METALNESS,
+ MapDiffuse = MapAlbedo,
+ MapSpecular = MapMetalness,
}
///
@@ -43,10 +43,10 @@ public enum ShaderLocationIndex
///
public enum ShaderAttributeDataType
{
- SHADER_ATTRIB_FLOAT = 0,
- SHADER_ATTRIB_VEC2,
- SHADER_ATTRIB_VEC3,
- SHADER_ATTRIB_VEC4
+ Float = 0,
+ Vec2,
+ Vec3,
+ Vec4
}
///
@@ -54,15 +54,15 @@ public enum ShaderAttributeDataType
///
public enum ShaderUniformDataType
{
- SHADER_UNIFORM_FLOAT = 0,
- SHADER_UNIFORM_VEC2,
- SHADER_UNIFORM_VEC3,
- SHADER_UNIFORM_VEC4,
- SHADER_UNIFORM_INT,
- SHADER_UNIFORM_IVEC2,
- SHADER_UNIFORM_IVEC3,
- SHADER_UNIFORM_IVEC4,
- SHADER_UNIFORM_SAMPLER2D
+ Float = 0,
+ Vec2,
+ Vec3,
+ Vec4,
+ Int,
+ IVec2,
+ IVec3,
+ IVec4,
+ Sampler2D
}
///
diff --git a/Raylib-cs/types/Texture2D.cs b/Raylib-cs/types/Texture2D.cs
index 911c86a..e5abcda 100644
--- a/Raylib-cs/types/Texture2D.cs
+++ b/Raylib-cs/types/Texture2D.cs
@@ -12,32 +12,32 @@ public enum TextureFilter
///
/// No filter, just pixel aproximation
///
- TEXTURE_FILTER_POINT = 0,
+ Point = 0,
///
/// Linear filtering
///
- TEXTURE_FILTER_BILINEAR,
+ Bilinear,
///
/// Trilinear filtering (linear with mipmaps)
///
- TEXTURE_FILTER_TRILINEAR,
+ Trilinear,
///
/// Anisotropic filtering 4x
///
- TEXTURE_FILTER_ANISOTROPIC_4X,
+ Anisotropic4X,
///
/// Anisotropic filtering 8x
///
- TEXTURE_FILTER_ANISOTROPIC_8X,
+ Anisotropic8X,
///
/// Anisotropic filtering 16x
///
- TEXTURE_FILTER_ANISOTROPIC_16X,
+ Anisotropic16X,
}
///
@@ -48,22 +48,22 @@ public enum TextureWrap
///
/// Repeats texture in tiled mode
///
- TEXTURE_WRAP_REPEAT = 0,
+ Repeat = 0,
///
/// Clamps texture to edge pixel in tiled mode
///
- TEXTURE_WRAP_CLAMP,
+ Clamp,
///
/// Mirrors and repeats the texture in tiled mode
///
- TEXTURE_WRAP_MIRROR_REPEAT,
+ MirrorRepeat,
///
/// Mirrors and clamps to border the texture in tiled mode
///
- TEXTURE_WRAP_MIRROR_CLAMP
+ MirrorClamp
}
///
@@ -74,32 +74,32 @@ public enum CubemapLayout
///
/// Automatically detect layout type
///
- CUBEMAP_LAYOUT_AUTO_DETECT = 0,
+ AutoDetect = 0,
///
/// Layout is defined by a vertical line with faces
///
- CUBEMAP_LAYOUT_LINE_VERTICAL,
+ LineVertical,
///
/// Layout is defined by a horizontal line with faces
///
- CUBEMAP_LAYOUT_LINE_HORIZONTAL,
+ LineHorizontal,
///
/// Layout is defined by a 3x4 cross with cubemap faces
///
- CUBEMAP_LAYOUT_CROSS_THREE_BY_FOUR,
+ CrossThreeByFour,
///
/// Layout is defined by a 4x3 cross with cubemap faces
///
- CUBEMAP_LAYOUT_CROSS_FOUR_BY_THREE,
+ CrossFourByThree,
///
/// Layout is defined by a panorama image (equirectangular map)
///
- CUBEMAP_LAYOUT_PANORAMA
+ Panorama
}
///