baylej / tmx

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

Example for rendering in OpenGL #74

Closed ConnorRigby closed 1 year ago

ConnorRigby commented 1 year ago

i know this is probably a little out of the scope of this project and it's documentation, but i thought i'd drop this here for any onlookers in the future. it's not complete in that it doesn't implement polylines, objects, standalone images or really anything else other than the basic base tile map exported from tiled but nonetheless it does seem to work for what it is implemented for.

Anyway, here's a single file example of using this library with GLFW, Glad, GLM, stb_image and modern opengl for rendering. It's NOT production ready, i just used this to validate my knowledge of the datastructure provided by the TMX library. Leaving as an issue because i don't believe it to be suitable for a pull request due to how many missing features and poor code quality.

I do hope this helps someone in the future. Here's the gist

ConnorRigby commented 1 year ago

By the way i want to say a huge thank you for this library, it saved me a lot of work and from having to use C++ in my "real" project.