mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-25 10:22:33 -05:00
Page:
Visual Studio C# Setup
Pages
CMake Build Options
Community Resources
Compile for OSX
Create Visual Studio 2019 Project
Create Visual Studio Project
Creating Discord Activities with raylib
Frequently Asked Questions
Home
Install and configure Touchscreen Drivers (RPi)
Quick Setup for Windows with Visual Studio 2022, GCC, or MinGW
Redirect raylib output to Framebuffer 1
Screen Recording
Use multiple windows
Use raylib with Code Blocks
Use raylib with Eclipse
Use raylib with Sublime Text
Using BMFonts
Using SPI Displays with raylib
Using raylib in VSCode
Using raylib with Cpp
Visual Studio C# Setup
Working for Android (on Linux)
Working for Android (on macOS)
Working for Android
Working for Web (HTML5)
Working on Chrome OS
Working on FreeBSD
Working on GNU Linux
Working on Raspberry Pi
Working on Windows
Working on exaequOS
Working on macOS
Working with CMake
raylib GLFW dependency
raylib architecture
raylib coding conventions
raylib data structures
raylib default shader
raylib dependencies
raylib enumerated types
raylib generic uber shader and custom shaders
raylib input system
raylib integration with other libraries
raylib libc dependency
raylib platforms and graphics
raylib syntax analysis
raylib templates
Clone
5
Visual Studio C# Setup
Jeffery Myers edited this page 2021-09-06 11:09:08 -07:00
Setting up raylib in Visual Studio is very simple.
- Download and install Visual Studio (note, if you have used unity in the past, you probably have this already)
- Create a new C# Console Application Project from the File -> New -> Project Menu
- Select .net Core 3.1 for your target framework
- If you do not have .net Core 3.1 download an install it.
- After the project is created, Right click on the project and choose "managed nuget projects"
- Choose the Browse tab and type in "Raylib".
- Select the "raylib-cs" package from the list and choose 'install' from the panel on the right.
- Build your raylib game in C# by using the Raylib_cs library.
A simple main program looks like this
using System;
using Raylib_cs;
namespace ConsoleApp
{
class Program
{
static void Main(string[] args)
{
Raylib.InitWindow(800, 600, "TEST");
while (!Raylib.WindowShouldClose())
{
Raylib.BeginDrawing();
Raylib.ClearBackground(Color.RAYWHITE);
Raylib.DrawText("Hello C# Window", 10, 10, 20, Color.RED);
Raylib.EndDrawing();
}
Raylib.CloseWindow();
}
}
}
Frequently Asked Questions
Library Design
- Architecture
- Syntax analysis
- Data structures
- Enumerated types
- External dependencies
- GLFW dependency
- libc dependency
- Platforms and graphics
- Input system
- Default shader
- Custom shaders
- Coding conventions
- Integration with other libs
Development Platforms
- Working on Windows
- Working on macOS
- Working on GNU Linux
- Working on Chrome OS
- Working on FreeBSD
- Working on Raspberry Pi
- Working for Android
- Working for Web (HTML5)
- Working on exaequOS Web Computer
- Creating Discord Activities
- Working anywhere with CMake
- CMake Build Options
IDE Configurations
- raylib templates: Get started easily
- How To: Quick C/C++ Setup in Visual Studio 2022, GCC or MinGW
- How To: C# Visual Studio Setup
- How To: VSCode
- How To: Eclipse
- How To: Sublime Text
- How To: Code::Blocks
Misc Help
www.raylib.com | itch.io | GitHub | Discord | YouTube