sdl

package module
v0.0.0-...-806d990 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2019 License: MIT Imports: 1 Imported by: 0

README

SDL2 bindings

To play WAV:

package main

import (
	"github.com/dgorohov/sdl-bindings"
	"github.com/dgorohov/sdl-bindings/audio/wav"
	"log"
	"os"
	"path/filepath"
)

func main() {
	sdl.Init(sdl.SDL_AUDIO)
	defer sdl.Quit()

	path, err := filepath.Abs(os.Args[1])
	if err != nil {
		panic(err)
	}

	log.Printf("Playing WAV: %s\n", path)
	if err := wav.PlayWAV(path); err != nil {
		panic(err)
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(mode Mode)

func Quit

func Quit()

Types

type Mode

type Mode uint32
const (
	Audio Mode = C.SDL_INIT_AUDIO
)

Directories

Path Synopsis
audio
wav
cmd
wav command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL