tangram-es
tangram-es copied to clipboard
Is it possible we could port this application to a Windows 10 UWP Application? I'm willing to help out.
Hey, yeah a Windows port would be great! Not many of us working on tangram use Windows regularly so it just hasn't been a high priority. The code is pretty portable and @tallytalwar spent some time on a Windows build in the past, but there are a few difficulties:
- MSVC doesn't have the same level of support as GCC and LLVM for features of C++11 and C++14, which tangram uses in many places (though the new Visual Studio 2015 is supposedly better in this regard).
- Windows OpenGL requires loading any functions that aren't part of the 'core profile', so that means adding a library like GLEW or GLAD (or maybe we should use ANGLE and just work around OpenGL completely).
- Network requests are implemented differently on each of our platforms; we had hoped to use libcurl the same way that the linux build does, but integrating that turned out more difficult than expected
None of these should be show-stoppers, there's just been more effort focused on Android and iOS so far.
How far did @tallytalwar get with the Windows port? Was it a Windows 10 UWP (Universal Windows Platform) Application? Yes, Visual Studio 2015 and ANGLE make sense. I already have a proof of concept Windows 10 UWP application completed with Visual Studio 2015 using ANGLE and SDL. Has GLEW or GLAD been ported over for WinRT and ANGLE? As for libcurl, the Windows 10 API uses a socket broker. Perhaps libcurl could be ported over to utilize Winsock for UWP.
Hi William
Thanks for showing interest in our project and offer to help with the windows build.
As @blair1618 already mentioned, no one on the Tangram team works on windows on a regularly basis, and along with priority to focus on iOS and android platforms, we have not gotten around to building tangram-es on windows.
That being said, one fine weekend I started to poke around windows build, using Visual Studio 2015 RC and latest c++ library patch from microsoft. You can refer this work here. My main goal was to get a working visual studio project (make sure a sln file can be build and compiled from the source and cmake).
I do not have any experience with building UWP apps, but have some experience using visual studio to build windows applications. Will surely appreciate all the help you can offer here. I recently did the setup for Visual Studio Community IDE 2015 and can get back to windows setup in a couple of weeks.
- My biggest concern when I started playing around with this was partial support for c++11 features in MSVC. Since then we have moved tangram-es project to c++14, for which MSVC has even less support.
- For windowing environment, I was able to get glfw working (by simply adding it as a submodule and making it a dependency of tangram-es).
- With respect to gl headers. WIndows by default only has opengl 1.x (fixed function pipeline) headers. We need to include opengl 3.x+ headers using glew, glad or glbinding. Or just go ANGLE route. But I think it might be easier to just use something like glBindings to start with. More about glbinding, here and here.
- For libcurl, I think I did manage to hook up libcurl libraries with windows config. But I never got to test it. So possible it might need more work.
- More c++14 and pthread features. Recently we added more c++14 features to tangram-es project along with usage of pthread library for handling thread priority. Will need to do some more work for windows on this end.
- I also want to try out visual studio 2015 support for building android and ios applications. And have a "universal" package of building tangram-es on "all" mobile platform. (Did someone say blackberry :P).
Hope this helps. Please feel free to contact us for any query or any help wrt getting a UWP build setup.
Thanks
vs 2015 are support for C++14 very well, we could consider this again.
Please give me permission to commit codes to tangram-es, so I could able to getting tangram-es could be able to compiled with vs 2015. ( Not commit codes to tagram-es) but other third-party projects.
Hey @lygstate
You can fork tangram-es project as your repository and create a pull request using that.
@tallytalwar Yes, I am forking tangram-es, I have modifications on external projects. And creating pull-request for alfons is too deep, So I am think if that's possible to push it directly.
All these projects are changed.
external\alfons
external\css-color-parser-cpp
external\geojson-vt-cpp
external\yaml-cpp
Currently, I could be able to build tangram-es with Visual Studio + Angle OpenGL ES. It's seems Angle doesn't support for glMapBuffer. So I have linkage error
Severity Code Description Project File Line Suppression State
Error LNK1120 1 unresolved externals tangram C:\CI-Cor\tangram-es\build\windows\bin\Debug\tangram.exe 1
Error LNK2019 unresolved external symbol glMapBuffer referenced in function "public: void __cdecl Tangram::MeshBase::subDataUpload(signed char *)" (?subDataUpload@MeshBase@Tangram@@QEAAXPEAC@Z) tangram C:\CI-Cor\tangram-es\build\windows\core.lib(mesh.obj) 1
How to getting glMapBuffer to be lazy loaded.
@lygstate It sounds like you're making good progress on the Windows build, that's great! However, it's very important that we maintain clear and consistent source control for tangram-es and the projects we depend on.
The projects in the "external" folder are incorporated as submodules. Changes to submodules cannot be directly committed to the parent repository, any changes to those should be submitted to the upstream repository (like https://github.com/hjanetzek/alfons). If the necessary changes are small, you could suggest a patch in a github issue rather than making a pull request.
Once the changes you need in the submodules are addressed, submitting your changes to tangram-es as a pull request will be pretty simple!
@lygstate You have reached far, great job here.
With respect to glMapBuffer issues, it seems ANGLE has full support on desktop. (https://github.com/google/angle).
In my initial evaluation I was inclined to use glBindings instead of ANGLE since it will be better supported (refer comments above). Did you try with any other gl helper libraries?
glbinding does not support for OpenGL es, for glMapBuffer, I have already solved, now the problem comes out to be do running properly
Now opengles are running, but I have the following warnings
WARNING C:\CI-Cor\tangram-es\core\src\scene\sceneLoader.cpp:1528: Can't find data source touch for layer touch
`
After that, I also have warnings that raised at this place:
void message::skipValue(uint64_t val)
{
switch (val & 0x7) {
case 0: // varint
varint();
break;
case 1: // 64 bit
skipBytes(8);
break;
case 2: // string/message
skipBytes(varint());
break;
case 5: // 32 bit
skipBytes(4);
break;
default:
char msg[80];
snprintf(msg, 80, "cannot skip unknown type %lld", (unsigned long long)(val & 0x7));
throw std::runtime_error(msg);
}
}
char msg[80]; snprintf(msg, 80, "cannot skip unknown type %lld", (unsigned long long)(val & 0x7)); throw std::runtime_error(msg);
What's this error means?
OK, the curl on windows do not support for gzip yet
core/src/scene/stops.cpp | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/core/src/scene/stops.cpp b/core/src/scene/stops.cpp
index 515115e..1c14eb6 100644
--- a/core/src/scene/stops.cpp
+++ b/core/src/scene/stops.cpp
@@ -208,14 +208,15 @@ auto Stops::evalWidth(float _key) const -> float {
if (frames.empty()) { return 0; }
auto upper = nearestHigherFrame(_key);
+ if (upper == frames.begin()) {
+ return upper->value.get<float>();
+ }
+
auto lower = upper - 1;
if (upper == frames.end()) {
return lower->value.get<float>();
}
- if (lower < frames.begin()) {
- return upper->value.get<float>();
- }
if (upper->key <= _key) {
return upper->value.get<float>();
On Visual Studio, except the iterator bound would raise exception, Does this change are OK?
@lygstate if you build curl on windows there is most likely an option to enable gzip. Did you check configure options for 'zlib'?
What @hjanetzek said or you can also look at this project for getting/building and configuring libcurl: https://github.com/peters/curl-for-windows.
@hjanetzek I've already disable gzip first. That's not my first priority, now I can running tangram-es on windows. Now the problem turn out to be, the rendering is not that correct, and I don't know why。 I need someone IRC/chat with me
We have a gitter setup for tangram related chats. You can join here and we can discuss the issues.
Really well done on getting tangram working on windows.
Old thread but i thought i will mentioned that we have tangram working nicely on winUI3 and MAUI. The bindings are very premature but it works okay, performance is good as well, all the capabilities are exposed as well. Using the latest ANGLE lib. Kudos for the very easy portability ^^
https://github.com/1SpatialGroupLtd/tangram-es
I did not really update the main readme-s as it is for now just for our use, but at some point probably will be done. you can find it in the platforms/winui.
Cheerio!
WE also have many other changes if you are interested in it :D