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

Separated example from generator

- Renamed Raylib-example to ExampleApplication.
- Example removed from Raylib-cs. It now only contains the generator. Use the current bindings in ExampleApplication/Raylib-cs.
This commit is contained in:
2018-07-31 13:33:19 +01:00
parent 64dafc2196
commit 86ab319ab9
13 changed files with 760 additions and 17402 deletions

View File

@@ -1,7 +1,5 @@
using System;
using CppSharp;
using raylib;
using static raylib.raylib;
namespace Raylibcs
{
@@ -9,73 +7,10 @@ namespace Raylibcs
{
static void Main(string[] args)
{
Console.WriteLine("Raylib-cs generator");
while (true)
{
Console.WriteLine();
Console.WriteLine("1. Genertate c# binding code");
Console.WriteLine("2. Run test example, requires raylib.dll in .exe folder");
Console.WriteLine("3. Exit");
var choice = Console.ReadLine();
if (choice == "1")
{
ConsoleDriver.Run(new SampleLibrary());
}
else if (choice == "2")
{
Test();
}
else if (choice == "3")
{
break;
}
}
}
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;
Console.WriteLine("Raylib-cs binding generator");
ConsoleDriver.Run(new SampleLibrary());
Console.WriteLine("Press enter to exit");
Console.ReadLine();
}
}
}