To write a bgfx sample app in C#, follow these steps:
Download the latest version of bgfx C# wrapper from the GitHub repository: https://github.com/bkaradzic/bgfx.csharp
Create a new C# console application in your preferred IDE.
Add the downloaded bgfx C# wrapper to your project's references.
Create a new static class called Program
and add the following code to the Main
method:
main.cs1868 chars62 lines
This sample code initializes bgfx, creates a new window, sets clear values and viewport, creates a single triangle with a vertex buffer, and submits it to bgfx for rendering. The main game loop updates the bgfx frame each frame.
gistlibby LogSnag