Documentation ¶
Overview ¶
Package engine contains bindings to SDL for rendering graphics. Support for audio, input, and networking will be added as needed. Integration with OpenGL contexts may also be added for 3D rendering.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrQuitting error = errors.New("quitting")
)
Functions ¶
This section is empty.
Types ¶
type Camera ¶
type SDLEngine ¶
type SDLEngine interface { Window() *sdl.Window Surface() *sdl.Surface Renderer() *sdl.Renderer Camera() Camera ProcessTextures(Spritesheet) error ClearScreen() error FillWindow(uint32) error Gradient(*sdl.Rect, uint32, uint32) error DrawRect(*sdl.Rect, uint32) error DrawIsometricRect(*sdl.Rect, uint32) error DrawLabel(string, *sdl.Rect, *ttf.Font) error DrawTexture(*sdl.Texture) error UpdateSurface() error Events() []sdl.Event PauseRendering(uint32) DestroyWindow() }
SDLEngine is our interface to SDL2.
func NewSDLEngine ¶
NewSDLEngine creates an SDL window, surface, and renderer with the given title. Implements and returns the SDLEngine interface.
type Scene ¶
Scene is a generic interface for types which interact with SDLEngine. They may resize the game window, make draw calls, interact with the event loop, and more.
type Spritesheet ¶
type Spritesheet interface { Image() image.Image Width() int Height() int SpriteWidth() int SpriteHeight() int Sprites() []image.Image AddSprite(image.Image) LoadImage(string) error PopulateDimensions(string) error PopulateSprites() Textures() []*sdl.Texture CreateTexture(image.Image, *sdl.Renderer) (*sdl.Texture, error) AddTexture(*sdl.Texture) DestroyTextures() }
Spritesheet is the interface for an image containing a grid of smaller images. Its interface allows us to carve up the image, and convert each one into an SDL texture.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package input handles keyboard and mouse input with SDL.
|
Package input handles keyboard and mouse input with SDL. |
Package menu provides various ways to draw a main menu and handle user input.
|
Package menu provides various ways to draw a main menu and handle user input. |