-
Notifications
You must be signed in to change notification settings - Fork 56
Home
Bayle Jonathan edited this page Sep 26, 2015
·
24 revisions
A portable C library to load tiled maps in your games.
This project depends on LibXml2 and Zlib(optional).
See the TMX map format reference page.
View fullres.
#include <tmx.h>
int main(void) {
tmx_map *map = tmx_load("path/map.tmx");
if (!map) {
tmx_perror("tmx_load");
return 1;
}
/* ... */
tmx_free(map);
return 0;
}
See the dumper example (examples/dumper/dumper.c
) for an in-depth usage of TMX.
This project uses cmake as a build system builder. You can either use cmake, ccmake or cmake-gui.
You can disable ZLIB(compression) support by setting WANT_ZLIB
to off.
mkdir build
cd build
cmake ..
make && make install
See the Building on windows wiki page.
Both LibXML2 and Zlib are thread safe.
TMX is thread safe except its tmx_strerr
function, which uses a global to store the error message.
Need more help?
Talk with me on Tiled's discord server, my nick is Mr-Hide