2
0
mirror of https://github.com/raylib-cs/raylib-cs synced 2025-09-09 03:01:41 -04:00

Added raylib-example project

- Separate project to test raylib on its own.
-
This commit is contained in:
2018-07-28 09:26:59 +01:00
parent 1a814e124f
commit fdb3541f44
9 changed files with 8595 additions and 11 deletions

57
Raylib-example/Program.cs Normal file
View File

@@ -0,0 +1,57 @@
using raylib;
using static raylib.raylib;
namespace Raylibexample
{
class Program
{
static void Main(string[] args)
{
Test();
}
public static int Test()
{
var RAYWHITE = new Color { R = 255, G = 255, B = 255, A = 255 };
var MAROON = new Color { R = 0, G = 0, B = 0, A = 255 };
// Initialization
//--------------------------------------------------------------------------------------
int screenWidth = 800;
int screenHeight = 450;
InitWindow(screenWidth, screenHeight, "Raylib-cs [core] example - basic window");
SetTargetFPS(60);
//--------------------------------------------------------------------------------------
// Main game loop
while (!WindowShouldClose()) // Detect window close button or ESC key
{
// Update
//----------------------------------------------------------------------------------
// TODO: Update your variables here
//----------------------------------------------------------------------------------
// Draw
//----------------------------------------------------------------------------------
BeginDrawing();
ClearBackground(RAYWHITE);
DrawText("Congrats! You created your first window!", 190, 200, 20, MAROON);
DrawFPS(0, 0);
EndDrawing();
//----------------------------------------------------------------------------------
}
// De-Initialization
//--------------------------------------------------------------------------------------
CloseWindow(); // Close window and OpenGL context
//-----------------------------
return 0;
}
}
}