For my project I was searching for the simple, cross-platform and complete example how to download map tiles and visualize them using C++. The closest thing I found was the Qt-based demo. Since I am not using Qt in my project I decide to create my own example. I think what comes out could be useful for someone else trying to write similar application so I decide to announce this example here. The source code and brief description is available here.
In this application map tiles are downloaded from openstreetmap.org. For the visualization, this application uses OpenGL with texture mapped on the simple quad. Texture is updated every time the new tile is completely downloaded. Simple caching mechanism is implemented by saving tiles on the hard disk. This visualization technique could be used to integrate map visualization into more advanced 3D scene. In addition, this example illustrates how to use advanced features of the CURL library to handle multiple http requests simultaneously.
I would be glad to hear any comments about the code.
AndreyNech, hello! I tried to compile your project with MinGW on Windows 7. Some libraries are absent. I found these libraries are necessary:
-lmingw32 -lGL -lopengl32 -lGLU -lSDLmain -lSDL -lSDL_image -lws2_32 -llibcurl
So could your upload correct version of OpenGl, SDL and curl libraries for your project?
sorry for slow reaction - I am not monitoring this forum on the regular base. Regarding your request for libraries - there are two things to mention.
The first one - it seams like you are trying to compile it with MinGW on Windows. I’ve never try this configuration myself. I am currently using Linux and VC Express 2010 for relevant development. However, I do not see any reasons why it should not work on MinGW because I’ve also tested this demo on Linux. So chances are good.
The second point is - the missing libraries you mentioned are “standard” SDL, CURL and OpenGL libraries. Which one is the “correct” one is highly dependent on your environment such as MinGW, compiler, graphic card driver versions, etc. So I do not see any point (and it is actually almost impossible) to provide these libraries for download together with my sources. I assume that the proper library (and header files) are already installed in your development environment.