jhasse / poly2tri

2D constrained Delaunay triangulation library
BSD 3-Clause "New" or "Revised" License
429 stars 89 forks source link

Is there a guide on integrating this with game engines #35

Open EmmanuelMess opened 2 years ago

EmmanuelMess commented 2 years ago

I am using Godot right now.

jhasse commented 2 years ago

This is the only one I know of: https://github.com/jhasse/poly2tri/wiki/Examples-C%23

Feel free to add one for Godot to the Wiki.

EmmanuelMess commented 2 years ago

I am getting:

g++ -o demo/bin/x11/libgdexample.so -shared godot-cpp/src/gdexample.os godot-cpp/src/gdlibrary.os -Lgodot-cpp/bin -Lpoly2tri/build -lgodot-cpp.linux.debug.64 -lpoly2tri
/bin/ld: poly2tri/build/libpoly2tri.a(shapes.cc.o): relocation R_X86_64_PC32 against symbol `_ZSt4cout@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: bad value
collect2: error: ld returned 1 exit status
scons: *** [demo/bin/x11/libgdexample.so] Error 1
scons: building terminated because of errors.

Is there an option to add a compilation setting for Godot that has -fPIC?

Adding set(CMAKE_POSITION_INDEPENDENT_CODE ON) to CMakeLists.txt works.