mewspring / sdl

This project handles window creation, event handling and image drawing using SDL version 2.0.
4 stars 1 forks source link

WIP

This project is a work in progress. The implementation is incomplete and subject to change. The documentation can be inaccurate.

win

Package win provides the core functionality required for window creation, drawing and event handling. The window events are defined in a dedicated package located at:

The library uses a small subset of the features provided by SDL version 2.0. Support for multiple windows has intentionally been left out to simplify the API.

Documentation

Documentation provided by GoDoc.

Installation

Install the SDL library version 2.0 and run:

go get github.com/mewmew/sdl/win

Install the SDL_ttf library version 2.0 and run:

go get github.com/mewmew/sdl/font

Install the SDL_mixer library version 2.0 and run:

go get github.com/mewmew/sdl/audio

Examples

The simple command demonstrates how to draw surfaces using the Draw and DrawRect methods. It also gives an example of a basic event loop.

go get github.com/mewmew/sdl/examples/simple

Screenshot - simple

The fonts command demonstrates how to render text using TTF fonts.

go get github.com/mewmew/sdl/examples/fonts

Screenshot - fonts

The boxes command demonstrates how to render text within the confines of a fixed width box.

go get github.com/mewmew/sdl/examples/boxes

Screenshot - boxes

The play command demonstrates how to open audio files and play sounds.

go get github.com/mewmew/sdl/examples/play

public domain

This code is hereby released into the public domain.