Changing examples to use makefile
- Testing a modified version of the makefile from raylib Instead of multiple project files for examples. - Fixed readme example
This commit is contained in:
parent
89983d7b4a
commit
bdf17a2101
364 changed files with 979 additions and 9077 deletions
7
Examples/models/models_geometric_shapes.cs
Normal file
7
Examples/models/models_geometric_shapes.cs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
using Raylib;
|
||||
using static Raylib.Raylib;
|
||||
|
||||
public partial class Examples
|
||||
{
|
||||
/*******************************************************************************************
*
* raylib [models] example - Draw some basic geometric shapes (cube, sphere, cylinder...)
*
* This example has been created using raylib 1.0 (www.raylib.com)
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
*
* Copyright (c) 2014 Ramon Santamaria (@raysan5)
*
********************************************************************************************/
public static void Main()
{
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "raylib [models] example - geometric shapes");
// Define the camera to look into our 3d world
Camera camera = { 0 };
camera.position = new Vector3( 0.0f, 10.0f, 10.0f );;
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.type = CAMERA_PERSPECTIVE;
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
BeginMode3D(camera);
DrawCube(new Vector3(-4.0f, 0.0f, 2.0f);, 2.0f, 5.0f, 2.0f, RED);
DrawCubeWires(new Vector3(-4.0f, 0.0f, 2.0f);, 2.0f, 5.0f, 2.0f, GOLD);
DrawCubeWires(new Vector3(-4.0f, 0.0f, -2.0f);, 3.0f, 6.0f, 2.0f, MAROON);
DrawSphere(new Vector3(-1.0f, 0.0f, -2.0f);, 1.0f, GREEN);
DrawSphereWires(new Vector3(1.0f, 0.0f, 2.0f);, 2.0f, 16, 16, LIME);
DrawCylinder(new Vector3(4.0f, 0.0f, -2.0f);, 1.0f, 2.0f, 3.0f, 4, SKYBLUE);
DrawCylinderWires(new Vector3(4.0f, 0.0f, -2.0f);, 1.0f, 2.0f, 3.0f, 4, DARKBLUE);
DrawCylinderWires(new Vector3(4.5f, -1.0f, 2.0f);, 1.0f, 1.0f, 2.0f, 6, BROWN);
DrawCylinder(new Vector3(1.0f, 0.0f, -4.0f);, 0.0f, 1.5f, 3.0f, 8, GOLD);
DrawCylinderWires(new Vector3(1.0f, 0.0f, -4.0f);, 0.0f, 1.5f, 3.0f, 8, PINK);
DrawGrid(10, 1.0f); // Draw a grid
EndMode3D();
DrawFPS(10, 10);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//--------------------------------------------------------------------------------------
return 0;
}
|
||||
}
|
||||
Loading…
Reference in a new issue