Skip to content

mewspring/sdl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • sdl
    • audio: provides support for audio playback.
    • font: handles text rendering based on the size, style and color of fonts.
      • fontutil: provides font utility functions for word wrapping.
    • win: handles window creation, drawing and events.
  • we: specifies the types and constants commonly used for window events.

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.

About

This project handles window creation, event handling and image drawing using SDL version 2.0.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages