You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It runs on GNU/Linux and on Windows (MSYS2/MinGW or MSVC) and requires
Lua (>=5.3),
SDL2 (>= 2.26.0),
SDL_image (>= 2.6.3),
SDL_mixer (>= 2.6.0), and
SDL_ttf (>= 2.20.0).
Setup the build environment as described here, then:
$ git clone https://github.com/stetre/moonsdl2/
$ cd moonsdl2
moonsdl2$ make
moonsdl2$ sudo make install
On Windows Using Visual Studio
> git clone https://github.com/stetre/moonsdl2/
> cd moonsdl2\src
> mingw32-make -f Makefile.msvc ^
LUAVER=<lua version> ^
LUA_INCDIR=<path to directory containing lua.h> ^
LUA_LIBDIR=<path to directory containing lua5X.dll> ^
SDL_INCDIR=<path to directory containing SDL2.h, SDL2_image.h, etc.> ^
SDL_LIBDIR=<path to directory containing SDL2.lib, SDL2_image.lib, etc.>
<lua version> is in dotted notation, like "5.1" (no quotes).
Ensure all the other directories don't have spaces in their paths.
If you don't have access to mingw32-make, you can edit src\rebuild.bat to
suit your Lua version and paths, and then run it (from the src directory) to
perform a full rebuild.
Example
The example below creates a window and draws a triangle using SDL2's 2D renderer.
Other examples can be found in the examples/ directory contained in the release package.