-
Notifications
You must be signed in to change notification settings - Fork 4
Guide: Loading textures
Alan Stagner edited this page Jun 9, 2020
·
1 revision
BNA wraps FNA3D internally, which includes the stb_image library, so BNA can load any image format that stb_image supports (PNG, JPG, GIF, TGA, etc). Loading 2D textures is simple:
using BNA.Graphics;
// ...
Texture2D myTexture;
if(Texture2D.Load(graphicsDevice, "./Content/Images/myTexture.jpg") case .Ok(let texture))
{
// texture is loaded!
myTexture = texture;
}
You can optionally pass a "mipmap" param. If true, BNA will automatically generate mipmap levels for that texture.
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