-
Notifications
You must be signed in to change notification settings - Fork 4
Getting Started
Alan Stagner edited this page Jun 9, 2020
·
1 revision
- In your workspace, choose Add From Installed -> SDL2
- Choose Add Existing Project -> BNA/BeefProj.toml
- Add BNA dependency to your project
- (Optional) set your project's application type to GUI Application
- Copy the BNA/Content folder to your project's folder. Note that in final distributed builds this should also be copied next to the executable, but there's a bug in the CopyToDependents command preventing me from automating this as a post-build step.
In a new file:
using System;
using BNA;
namespace MyProgram
{
public class MyGame : Game
{
public this(StringView title, int windowWidth, int windowHeight, bool fullscreen = false)
: base(title, windowWidth, windowHeight, fullscreen)
{
}
}
}
In your main program class:
class Program
{
public static void Main(String[] args)
{
using(let game = scope MyGame("Hello, world!", 1280, 720))
{
game.Run();
}
}
}
Hit F5 to compile and run. You should see a black window:
You're ready to start using BNA!
Getting Started
Drawing Sprites
Loading & Applying Effects
Loading Textures
Creating vertex & index buffers and drawing geometry
Using render buffers
Playing sound effects & music
Routing sound through buses & applying filters
Game
GameWindow
GraphicsDevice
SpriteBatch
Audio
Keyboard
Mouse
GamepadDevice