baylej / tmx

C tmx map loader
http://libtmx.rtfd.io/
BSD 2-Clause "Simplified" License
241 stars 54 forks source link

Cannot load map: xml parser: an error occured in the delegated image loading function #82

Closed AdamOnAir closed 1 month ago

AdamOnAir commented 1 month ago

Cannot load map: xml parser: an error occured in the delegated image loading function when using the SDL example compiled with the CMakeLists.txt.

./sdl_example untitled.tmx

baylej commented 1 month ago

Hello,

There is too little context here for me to help you. Image loading does work, have you tried one of the examples shipped with this project ? (in folder examples/data)

eg: ./sdl_example ../data/csv.tmx

AdamOnAir commented 1 month ago

How to do it ?

baylej commented 1 month ago

If you investigate this error, you'll find that it is caused by the tmx_img_load_func callback, in the SDL example it's set to the SDL_tex_loader See: https://github.com/baylej/tmx/blob/11ffdcdc9bd65669f1a8dbd3a0362a324dda2e0c/examples/sdl/sdl.c#L12

For some reason, the image could not be loaded into a texture, but this is happening in SDL2, not in libTMX !

AdamOnAir commented 1 month ago

Euh, I know it's not approptiate, but could you help me fix it ?

baylej commented 1 month ago

Sorry, I can't help, I'm on my phone, I don't have your files, I'm not well-versed in SDL2 programming, ... You should ask for help on the discord of the SDL project, plus don't forget that Tiled has a discord as well where you can get help.

AdamOnAir commented 1 month ago

I'll try stackoverflow.