Table of Contents

Namespace BSGameLib.Game

Classes

ContentPath

Resolves a content path that may not match the on-disk case of its folders or file name.

DisplayInfo

A display: its index, its bounds in desktop coordinates and the modes it supports.

DisplayManager

Lists the displays attached to the machine, and the fullscreen modes each supports. Read once, when created.

Game

The base class for a game. Subclass it, override the methods a game needs, such as Initialize and Update, and call Run() to start the game loop.

ImGuiTexture

Turns a ITexture into what ImGui.Image needs: a texture id, and the UV rectangle covering it.

InstanceCounter

Counts live instances of tracked types, so that a leak shows as a count that keeps rising. Code records each instance with Increment(Type) and Decrement(Type).

MathHelpers

Helpers for moving values towards a target, easing curves, and angles.

MessageBox

Shows native message boxes, which block until the player picks a button.

ResizeEventArgs

The new size of the window, after it was resized.

Resolution

A fullscreen video mode: a size and a refresh rate.

ServiceExtensions

Extension methods that register the framework's services with dependency injection.

ShaderManager

Holds the shader programs and the materials that use them. Disposing it disposes every shader it holds.

ShapeRenderer

Owns the built-in shape material and creates the batches that draw shapes.

SpriteRenderer

Begins the render encoders that draw sprites, shapes and text, and owns the sprite batch they use.

SystemThemeChangedEventArgs

The desktop's colour scheme changed while the game was running.

WindowOptions

Options for creating the game window. Pass them to the Game constructor.

Structs

LightCone

A spotlight's cone: the light shines only within Angle degrees around Direction, brightest along it.

LightPulse

A light's pulse: its intensity, and optionally its radius, swing either way along a sine.

Material

Identifies a material registered with ShaderManager. Custom materials can be created via Create(string).

MessageBoxResult

The button the player picked in a message box. Every button is false if the box was closed another way, or never appeared (Shown false).

PointLight

A light. Position is in the logical pixels sprites are drawn in, the ones a sprite's destination rectangle uses, so it stays put when the window or the render target is scaled.

PointLightHandle

Names a light added with AddPointLight(PointLight), to update or remove it by. The default handle names no light.

Interfaces

IAttachOnGameStart

A service that is attached to the game when it starts. The game calls Attach(IGame) once, after the services are built and the IRunOnInitialization services have run, and before the game's own initialize.

IContentManager

Loads, caches and finds the textures and fonts a game uses, by file name. Games reach it through ContentManager.

IDrawable

Something the game draws each frame. DrawableComponent is the usual implementation.

IGame

The running game, as its components and services see it.

IGameThread

Runs work on the game's thread, at the start of the next frame.

IGameTime

The time of the current frame.

IGameWindow

The game's window. The game creates it from its IWindowOptions, and it is reached through IGame.

IImGuiFonts

Chooses what ImGui can draw beyond its built-in font.

IInitializable

Something with a one-time setup step, Initialize().

ILightingManager

Sets the lighting for lit draws: the ambient colour, greyscale and point lights.

IRenderTargetFactory

Creates render targets, which are surfaces a frame can be drawn into and then shown or drawn from.

IRunOnInitialization

A service that the game runs once when it starts, before the IAttachOnGameStart services are attached and the game's own initialize runs.

ISystemThemeService

What colour scheme the desktop is set to, and a notification when the user changes it while the game is running.

IUpdateable

Something the game updates each frame. Component implements it.

IWindowOptions

The settings a game's window is created with.

Enums

MessageBoxButtons

The buttons a message box shows.

MessageBoxType

The kind of message a message box shows. It sets the icon.

RenderFlip

How a sprite is mirrored when drawn. The values can be combined as flags.

SystemTheme

The colour scheme the desktop is set to, as reported by the platform.