nim-lang / sdl1 Goto Github PK
View Code? Open in Web Editor NEWSDL v1.2 wrapper for Nim.
License: GNU Lesser General Public License v2.1
SDL v1.2 wrapper for Nim.
License: GNU Lesser General Public License v2.1
I'm not 100% sure this is related to the binding, but I'm also not really sure why I can't get this to work.
When I use https://github.com/nim-lang/sdl2/blob/master/src/sdl2/mixer.nim, I am able to play an mp3 file. With the exact same code, but using the sdl_mixer in this repository, I get Unrecognized music format
printed out. I believe this means I have all of the dynamic libraries properly installed and configured, otherwise I wouldn't be able to get SDL2 to work.
import sdl
import sdl_mixer
discard sdl.init(INIT_EVERYTHING)
discard openAudio(22050, AUDIO_S16SYS, 2, 640)
var music = loadMus("music.mp3")
echo getError()
discard music.playMusic(1)
EDIT:
I tried reproducing a similar example in C, and noticed the Mix_Init
function (which this wrapper omits, but the SDL2 wrapper has this function). After running that and checking for errors, I get Mix_Init: Mixer not built with MP3 support
. Not sure if this is solvable on the end of this wrapper, but I'm also not sure if the Mix_Init
function needs to be wrapped.
/home/david/.nimble/pkgs/sdl1-1.0.0/sdl.nim(1064, 27) Error: undeclared identifier: 'expr'
I think it comes from use of 'expr' in this template:
template evconv(procName: expr, ptrName: typedesc, assertions: EventSeq): stmt {.immediate.} =
proc `procName`*(event: PEvent): ptrName =
assert(contains(assertions, event.kind))
result = cast[ptrName](event)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.