2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-06-30 19:03:42 -04:00

Initial example update

- Updating examples with new changes.
This commit is contained in:
2019-02-11 11:30:02 +00:00
parent f4ef94d63f
commit a01efa4a09
45 changed files with 419 additions and 389 deletions

View File

@ -32,7 +32,7 @@ public partial class shaders_custom_uniform
int screenWidth = 800;
int screenHeight = 450;
SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
SetConfigFlags(ConfigFlag.FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - custom uniform variable");
@ -63,7 +63,7 @@ public partial class shaders_custom_uniform
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
// Setup orbital camera
SetCameraMode(camera, (int)CAMERA_ORBITAL); // Set an orbital camera mode
SetCameraMode(camera, CameraMode.CAMERA_ORBITAL); // Set an orbital camera mode
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -91,6 +91,7 @@ public partial class shaders_custom_uniform
ClearBackground(RAYWHITE);
BeginTextureMode(target); // Enable drawing to texture
ClearBackground(RAYWHITE);
BeginMode3D(camera);

View File

@ -32,7 +32,7 @@ public partial class shaders_model_shader
int screenWidth = 800;
int screenHeight = 450;
SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
SetConfigFlags(ConfigFlag.FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - model shader");
@ -54,7 +54,7 @@ public partial class shaders_model_shader
Vector3 position = new Vector3( 0.0f, 0.0f, 0.0f ); // Set model position
SetCameraMode(camera, (int)CAMERA_FREE); // Set an orbital camera mode
SetCameraMode(camera, CameraMode.CAMERA_FREE); // Set an orbital camera mode
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------

View File

@ -70,7 +70,7 @@ public partial class shaders_postprocessing
int screenWidth = 800;
int screenHeight = 450;
SetConfigFlags(FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
SetConfigFlags(ConfigFlag.FLAG_MSAA_4X_HINT); // Enable Multi Sampling Anti Aliasing 4x (if available)
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - postprocessing shader");
@ -108,7 +108,7 @@ public partial class shaders_postprocessing
RenderTexture2D target = LoadRenderTexture(screenWidth, screenHeight);
// Setup orbital camera
SetCameraMode(camera, (int)CAMERA_ORBITAL); // Set an orbital camera mode
SetCameraMode(camera, CameraMode.CAMERA_ORBITAL); // Set an orbital camera mode
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
@ -120,8 +120,8 @@ public partial class shaders_postprocessing
//----------------------------------------------------------------------------------
UpdateCamera(ref camera); // Update camera
if (IsKeyPressed(KEY_RIGHT)) currentShader++;
else if (IsKeyPressed(KEY_LEFT)) currentShader--;
if (IsKeyPressed(KeyboardKey.KEY_RIGHT)) currentShader++;
else if (IsKeyPressed(KeyboardKey.KEY_LEFT)) currentShader--;
if (currentShader >= MAX_POSTPRO_SHADERS) currentShader = 0;
else if (currentShader < 0) currentShader = MAX_POSTPRO_SHADERS - 1;
@ -134,8 +134,9 @@ public partial class shaders_postprocessing
ClearBackground(RAYWHITE);
BeginTextureMode(target); // Enable drawing to texture
ClearBackground(RAYWHITE);
BeginMode3D(camera);
BeginMode3D(camera);
DrawModel(model, position, 0.1f, WHITE); // Draw 3d model with texture