Watch
2
0
Fork
You've already forked raylib-cs
0

Fix unfinished example

This commit is contained in:
Rgebee 2024-06-20 17:40:24 +01:00
commit 8263ab4e59

View file

@ -48,42 +48,49 @@ public class WriteDepth
SetTargetFPS(60); SetTargetFPS(60);
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------
UpdateCamera(ref camera, CameraMode.Orbital); // Main game loop
//---------------------------------------------------------------------------------- while (!WindowShouldClose())
{
// Update
//----------------------------------------------------------------------------------
UpdateCamera(ref camera, CameraMode.Orbital);
//----------------------------------------------------------------------------------
// Draw // Draw
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Draw into our custom render texture (framebuffer)
BeginTextureMode(target);
ClearBackground(Color.White);
BeginMode3D(camera); // Draw into our custom render texture (framebuffer)
BeginShaderMode(shader); BeginTextureMode(target);
ClearBackground(Color.White);
DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Red); BeginMode3D(camera);
DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Purple); BeginShaderMode(shader);
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(); DrawCubeWiresV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Red);
EndMode3D(); DrawCubeV(new Vector3(0.0f, 0.5f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), Color.Purple);
EndTextureMode(); 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);
// Draw custom render texture EndShaderMode();
BeginDrawing(); EndMode3D();
ClearBackground(Color.RayWhite); EndTextureMode();
DrawTextureRec( // Draw custom render texture
target.Texture, BeginDrawing();
new Rectangle(0, 0, screenWidth, -screenHeight), ClearBackground(Color.RayWhite);
Vector2.Zero,
Color.White
);
DrawFPS(10, 10);
EndDrawing(); DrawTextureRec(
//---------------------------------------------------------------------------------- target.Texture,
new Rectangle(0, 0, screenWidth, -screenHeight),
Vector2.Zero,
Color.White
);
DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization // De-Initialization
//-------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------