├── .clang-format ├── .github └── workflows │ ├── bloom.yml │ ├── build.yml │ └── colcon-workspace.yml ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENCE ├── README.md ├── cmake ├── AndroidUtils.cmake ├── CreateMethodCallFile.cmake ├── EmbedBinaryFiles.cmake ├── EmbedShaderFiles.cmake ├── EmscriptenUtils.cmake ├── FindDC1394.cmake ├── FindDepthSense.cmake ├── FindFFMPEG.cmake ├── FindGLEW.cmake ├── FindGLUES.cmake ├── FindLibraw.cmake ├── FindLz4.cmake ├── FindMediaFoundation.cmake ├── FindOculus.cmake ├── FindOpenEXR.cmake ├── FindOpenNI.cmake ├── FindOpenNI2.cmake ├── FindPleora.cmake ├── FindRealSense.cmake ├── FindRealSense2.cmake ├── FindTeliCam.cmake ├── FindTooN.cmake ├── FindXrandr.cmake ├── Findepoxy.cmake ├── Findlibusb1.cmake ├── Findpthread.cmake ├── Finduvc.cmake ├── Findzstd.cmake ├── MakePythonWheel.cmake ├── PangolinConfig.cmake.in ├── PangolinConfigVersion.cmake.in ├── PangolinFactory.cmake ├── SetPlatformVars.cmake ├── cmake_uninstall.cmake.in └── wheel-dist-info │ ├── METADATA │ ├── WHEEL │ └── top_level.txt ├── components ├── pango_core │ ├── CMakeLists.txt │ ├── include │ │ ├── NaturalSort │ │ │ ├── LICENSE.md │ │ │ ├── README.md │ │ │ └── natural_sort.hpp │ │ ├── dynalo │ │ │ ├── detail │ │ │ │ ├── config.hpp │ │ │ │ ├── linux │ │ │ │ │ └── dynalo.hpp │ │ │ │ ├── macos │ │ │ │ │ └── dynalo.hpp │ │ │ │ └── windows │ │ │ │ │ └── dynalo.hpp │ │ │ ├── dynalo.hpp │ │ │ └── symbol_helper.hpp │ │ ├── pangolin │ │ │ ├── compat │ │ │ │ ├── glutbitmap.h │ │ │ │ └── type_traits.h │ │ │ ├── factory │ │ │ │ ├── factory.h │ │ │ │ ├── factory_help.h │ │ │ │ └── factory_registry.h │ │ │ ├── pangolin.h │ │ │ ├── platform.h │ │ │ └── utils │ │ │ │ ├── argagg.hpp │ │ │ │ ├── assert.h │ │ │ │ ├── avx_math.h │ │ │ │ ├── bitmask.h │ │ │ │ ├── compontent_cast.h │ │ │ │ ├── file_extension.h │ │ │ │ ├── file_utils.h │ │ │ │ ├── fix_size_buffer_queue.h │ │ │ │ ├── format_string.h │ │ │ │ ├── is_streamable.h │ │ │ │ ├── log.h │ │ │ │ ├── memstreambuf.h │ │ │ │ ├── param_set.h │ │ │ │ ├── params.h │ │ │ │ ├── parse.h │ │ │ │ ├── picojson.h │ │ │ │ ├── posix │ │ │ │ ├── condition_variable.h │ │ │ │ ├── semaphore.h │ │ │ │ └── shared_memory_buffer.h │ │ │ │ ├── range.h │ │ │ │ ├── signal_slot.h │ │ │ │ ├── sigstate.h │ │ │ │ ├── simple_math.h │ │ │ │ ├── threadedfilebuf.h │ │ │ │ ├── timer.h │ │ │ │ ├── transform.h │ │ │ │ ├── true_false_toggle.h │ │ │ │ ├── type_convert.h │ │ │ │ ├── uri.h │ │ │ │ ├── variadic_all.h │ │ │ │ └── xml │ │ │ │ ├── license.txt │ │ │ │ ├── rapidxml.hpp │ │ │ │ ├── rapidxml_iterators.hpp │ │ │ │ ├── rapidxml_print.hpp │ │ │ │ └── rapidxml_utils.hpp │ │ └── sigslot │ │ │ ├── LICENCE │ │ │ ├── README.md │ │ │ └── signal.hpp │ ├── src │ │ ├── avx_math.cpp │ │ ├── dummy.cpp │ │ ├── factory │ │ │ ├── factory_help.cpp │ │ │ └── factory_registry.cpp │ │ ├── file_extension.cpp │ │ ├── file_utils.cpp │ │ ├── param_set.cpp │ │ ├── posix │ │ │ ├── condition_variable.cpp │ │ │ ├── semaphore.cpp │ │ │ └── shared_memory_buffer.cpp │ │ ├── sigstate.cpp │ │ ├── threadedfilebuf.cpp │ │ └── uri.cpp │ └── tests │ │ └── tests_uri.cpp ├── pango_display │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ ├── console │ │ │ ├── ConsoleView.h │ │ │ └── InterpreterInterface.h │ │ │ ├── display │ │ │ ├── attach.h │ │ │ ├── default_font.h │ │ │ ├── display.h │ │ │ ├── display.hpp │ │ │ ├── image_view.h │ │ │ ├── process.h │ │ │ ├── user_app.h │ │ │ ├── view.h │ │ │ └── widgets.h │ │ │ └── handler │ │ │ ├── handler.h │ │ │ ├── handler_glbuffer.h │ │ │ └── handler_image.h │ └── src │ │ ├── ConsoleView.cpp │ │ ├── default_font.cpp │ │ ├── display.cpp │ │ ├── handler.cpp │ │ ├── handler_glbuffer.cpp │ │ ├── handler_image.cpp │ │ ├── image_view.cpp │ │ ├── pangolin_gl.cpp │ │ ├── pangolin_gl.h │ │ ├── process.cpp │ │ ├── view.cpp │ │ └── widgets.cpp ├── pango_geometry │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── geometry │ │ │ ├── geometry.h │ │ │ ├── geometry_obj.h │ │ │ └── geometry_ply.h │ └── src │ │ ├── geometry.cpp │ │ ├── geometry_obj.cpp │ │ └── geometry_ply.cpp ├── pango_glgeometry │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── geometry │ │ │ └── glgeometry.h │ └── src │ │ └── glgeometry.cpp ├── pango_image │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── image │ │ │ ├── copy.h │ │ │ ├── image.h │ │ │ ├── image_convert.h │ │ │ ├── image_io.h │ │ │ ├── image_utils.h │ │ │ ├── managed_image.h │ │ │ ├── memcpy.h │ │ │ ├── pixel_format.h │ │ │ ├── shared_image.h │ │ │ └── typed_image.h │ └── src │ │ ├── image_io.cpp │ │ ├── image_io_bmp.cpp │ │ ├── image_io_exr.cpp │ │ ├── image_io_jpg.cpp │ │ ├── image_io_libraw.cpp │ │ ├── image_io_lz4.cpp │ │ ├── image_io_packed12bit.cpp │ │ ├── image_io_pango.cpp │ │ ├── image_io_png.cpp │ │ ├── image_io_ppm.cpp │ │ ├── image_io_raw.cpp │ │ ├── image_io_tga.cpp │ │ ├── image_io_tiff.cpp │ │ ├── image_io_zstd.cpp │ │ └── pixel_format.cpp ├── pango_opengl │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── gl │ │ │ ├── cg.h │ │ │ ├── colour.h │ │ │ ├── compat │ │ │ ├── gl2engine.h │ │ │ └── gl_es_compat.h │ │ │ ├── gl.h │ │ │ ├── gl.hpp │ │ │ ├── glchar.h │ │ │ ├── glcuda.h │ │ │ ├── gldraw.h │ │ │ ├── glfont.h │ │ │ ├── glformattraits.h │ │ │ ├── glinclude.h │ │ │ ├── glpangoglu.h │ │ │ ├── glpixformat.h │ │ │ ├── glplatform.h │ │ │ ├── glsl.h │ │ │ ├── glsl.hpp │ │ │ ├── glsl_utilities.h │ │ │ ├── glstate.h │ │ │ ├── gltext.h │ │ │ ├── gltexturecache.h │ │ │ ├── glvbo.h │ │ │ ├── opengl_render_state.h │ │ │ └── viewport.h │ ├── shaders │ │ ├── colormaps.glsl.h │ │ ├── font.glsl.h │ │ ├── main_experiments.glsl │ │ ├── main_text.glsl │ │ ├── main_widgets.glsl │ │ ├── matcap.glsl.h │ │ ├── noise.glsl.h │ │ ├── sdf.glsl.h │ │ └── utils.glsl.h │ └── src │ │ ├── compat │ │ └── gl2engine.cpp │ │ ├── fonts │ │ ├── AnonymousPro.ttf │ │ └── AnonymousPro.txt │ │ ├── glchar.cpp │ │ ├── gldraw.cpp │ │ ├── glfont.cpp │ │ ├── glpangoglu.cpp │ │ ├── gltext.cpp │ │ ├── gltexturecache.cpp │ │ ├── opengl_render_state.cpp │ │ ├── stb_truetype.h │ │ └── viewport.cpp ├── pango_packetstream │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── log │ │ │ ├── packet.h │ │ │ ├── packetstream.h │ │ │ ├── packetstream_reader.h │ │ │ ├── packetstream_source.h │ │ │ ├── packetstream_tags.h │ │ │ ├── packetstream_writer.h │ │ │ ├── playback_session.h │ │ │ └── sync_time.h │ └── src │ │ ├── packet.cpp │ │ ├── packetstream.cpp │ │ ├── packetstream_reader.cpp │ │ ├── packetstream_writer.cpp │ │ └── playback_session.cpp ├── pango_plot │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── plot │ │ │ ├── datalog.h │ │ │ ├── loaders │ │ │ ├── csv_table_loader.h │ │ │ └── table_loader.h │ │ │ └── plotter.h │ └── src │ │ ├── datalog.cpp │ │ ├── loaders │ │ └── csv_table_loader.cpp │ │ └── plotter.cpp ├── pango_python │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── python │ │ │ └── pyinterpreter.h │ └── src │ │ ├── pyinterpreter.cpp │ │ ├── pypangolin │ │ ├── attach.cpp │ │ ├── attach.hpp │ │ ├── colour.cpp │ │ ├── colour.hpp │ │ ├── datalog.cpp │ │ ├── datalog.hpp │ │ ├── display.cpp │ │ ├── display.hpp │ │ ├── gl.cpp │ │ ├── gl.hpp │ │ ├── gl_draw.cpp │ │ ├── gl_draw.hpp │ │ ├── glfont.cpp │ │ ├── glfont.hpp │ │ ├── glsl.cpp │ │ ├── glsl.hpp │ │ ├── gltext.cpp │ │ ├── gltext.hpp │ │ ├── glvbo.cpp │ │ ├── glvbo.hpp │ │ ├── handler.cpp │ │ ├── handler.hpp │ │ ├── image.cpp │ │ ├── image.hpp │ │ ├── image_view.cpp │ │ ├── image_view.hpp │ │ ├── opengl_render_state.cpp │ │ ├── opengl_render_state.hpp │ │ ├── params.cpp │ │ ├── params.hpp │ │ ├── pixel_format.cpp │ │ ├── pixel_format.hpp │ │ ├── plotter.cpp │ │ ├── plotter.hpp │ │ ├── pypangoio.cpp │ │ ├── pypangoio.h │ │ ├── pypangolin.h │ │ ├── var.cpp │ │ ├── var.hpp │ │ ├── video.cpp │ │ ├── video.hpp │ │ ├── view.cpp │ │ ├── view.hpp │ │ ├── viewport.cpp │ │ ├── viewport.hpp │ │ ├── widget.cpp │ │ ├── widget.hpp │ │ ├── window.cpp │ │ └── window.hpp │ │ ├── pypangolin_embed.cpp │ │ └── pypangolin_module.cpp ├── pango_scene │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── scene │ │ │ ├── axis.h │ │ │ ├── interactive.h │ │ │ ├── interactive_index.h │ │ │ ├── renderable.h │ │ │ ├── scenehandler.h │ │ │ └── tree.h │ └── src │ │ └── renderable.cpp ├── pango_tools │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── tools │ │ │ └── video_viewer.h │ └── src │ │ └── video_viewer.cpp ├── pango_vars │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── var │ │ │ ├── var.h │ │ │ ├── varextra.h │ │ │ ├── varinit.h │ │ │ ├── varstate.h │ │ │ ├── varvalue.h │ │ │ ├── varvaluegeneric.h │ │ │ ├── varvaluet.h │ │ │ └── varwrapper.h │ ├── src │ │ ├── vars.cpp │ │ └── varstate.cpp │ └── tests │ │ └── test_all.cpp ├── pango_video │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── video │ │ │ ├── drivers │ │ │ ├── debayer.h │ │ │ ├── deinterlace.h │ │ │ ├── depthsense.h │ │ │ ├── ffmpeg.h │ │ │ ├── ffmpeg_common.h │ │ │ ├── ffmpeg_convert.h │ │ │ ├── ffmpeg_output.h │ │ │ ├── firewire.h │ │ │ ├── gamma.h │ │ │ ├── images.h │ │ │ ├── images_out.h │ │ │ ├── join.h │ │ │ ├── merge.h │ │ │ ├── mjpeg.h │ │ │ ├── openni.h │ │ │ ├── openni2.h │ │ │ ├── openni_common.h │ │ │ ├── pack.h │ │ │ ├── pango.h │ │ │ ├── pango_video_output.h │ │ │ ├── pleora.h │ │ │ ├── realsense.h │ │ │ ├── realsense2.h │ │ │ ├── shared_memory.h │ │ │ ├── shift.h │ │ │ ├── split.h │ │ │ ├── teli.h │ │ │ ├── test.h │ │ │ ├── thread.h │ │ │ ├── transform.h │ │ │ ├── truncate.h │ │ │ ├── unpack.h │ │ │ ├── uvc.h │ │ │ ├── uvc_mediafoundation.h │ │ │ └── v4l.h │ │ │ ├── iostream_operators.h │ │ │ ├── stream_encoder_factory.h │ │ │ ├── stream_info.h │ │ │ ├── video.h │ │ │ ├── video_exception.h │ │ │ ├── video_help.h │ │ │ ├── video_input.h │ │ │ ├── video_interface.h │ │ │ ├── video_output.h │ │ │ ├── video_output_interface.h │ │ │ └── video_record_repeat.h │ ├── src │ │ ├── drivers │ │ │ ├── debayer.cpp │ │ │ ├── deinterlace.cpp │ │ │ ├── depthsense.cpp │ │ │ ├── ffmpeg.cpp │ │ │ ├── ffmpeg_convert.cpp │ │ │ ├── ffmpeg_output.cpp │ │ │ ├── firewire.cpp │ │ │ ├── gamma.cpp │ │ │ ├── images.cpp │ │ │ ├── images_out.cpp │ │ │ ├── join.cpp │ │ │ ├── json.cpp │ │ │ ├── merge.cpp │ │ │ ├── mjpeg.cpp │ │ │ ├── openni.cpp │ │ │ ├── openni2.cpp │ │ │ ├── pack.cpp │ │ │ ├── pango.cpp │ │ │ ├── pango_video_output.cpp │ │ │ ├── pleora.cpp │ │ │ ├── realsense.cpp │ │ │ ├── realsense2.cpp │ │ │ ├── shared_memory.cpp │ │ │ ├── shift.cpp │ │ │ ├── split.cpp │ │ │ ├── teli.cpp │ │ │ ├── test.cpp │ │ │ ├── thread.cpp │ │ │ ├── transform.cpp │ │ │ ├── truncate.cpp │ │ │ ├── unpack.cpp │ │ │ ├── uvc.cpp │ │ │ ├── uvc_mediafoundation.cpp │ │ │ └── v4l.cpp │ │ ├── stream_encoder_factory.cpp │ │ ├── video.cpp │ │ ├── video_help.cpp │ │ ├── video_input.cpp │ │ └── video_output.cpp │ └── tests │ │ ├── tests_video_loading.cpp │ │ └── tests_video_uri.cpp ├── pango_windowing │ ├── CMakeLists.txt │ ├── include │ │ └── pangolin │ │ │ └── windowing │ │ │ ├── EmscriptenWindow.h │ │ │ ├── OsxWindow.h │ │ │ ├── PangolinNSApplication.h │ │ │ ├── PangolinNSGLView.h │ │ │ ├── WinWindow.h │ │ │ ├── X11Window.h │ │ │ ├── display_android.h │ │ │ ├── handler_bitsets.h │ │ │ ├── handler_enums.h │ │ │ └── window.h │ └── src │ │ ├── PangolinNSApplication.mm │ │ ├── PangolinNSGLView.mm │ │ ├── display_android.cpp │ │ ├── display_emscripten.cpp │ │ ├── display_headless.cpp │ │ ├── display_osx.mm │ │ ├── display_wayland.cpp │ │ ├── display_win.cpp │ │ ├── display_x11.cpp │ │ └── window.cpp └── tinyobj │ ├── CMakeLists.txt │ ├── include │ └── tinyobj │ │ └── tiny_obj_loader.h │ └── src │ └── tinyobj.cpp ├── examples ├── BasicOpenGL │ ├── 1_gl_intro_classic_triangle.cpp │ ├── 1_gl_intro_pango_triangle.cpp │ ├── 2_gl_intro_classic_triangle_vbo.cpp │ ├── 2_gl_intro_pango_triangle_vbo.cpp │ ├── 3_gl_intro_classic_triangle_vbo_shader.cpp │ ├── 3_gl_intro_pango_triangle_vbo_shader.cpp │ ├── 4_gl_intro_viewport.cpp │ ├── 5_gl_intro_view_transforms.cpp │ ├── CMakeLists.txt │ └── README.md ├── CMakeLists.txt ├── HelloPangolin │ ├── CMakeLists.txt │ └── main.cpp ├── HelloPangolinOffscreen │ ├── CMakeLists.txt │ └── main.cpp ├── HelloPangolinThreads │ ├── CMakeLists.txt │ └── main.cpp ├── PythonExamples │ ├── SimpleDisplay.py │ ├── SimplePlot.py │ └── SimpleVideo.py ├── SharedMemoryCamera │ ├── CMakeLists.txt │ └── main.cpp ├── SimpleDisplay │ ├── CMakeLists.txt │ ├── app.cfg │ └── main.cpp ├── SimpleDisplayImage │ ├── CMakeLists.txt │ └── main.cpp ├── SimpleMultiDisplay │ ├── CMakeLists.txt │ ├── app.cfg │ └── main.cpp ├── SimplePlot │ ├── CMakeLists.txt │ └── main.cpp ├── SimpleRecord │ ├── CMakeLists.txt │ └── main.cpp ├── SimpleScene │ ├── CMakeLists.txt │ └── main.cpp ├── SimpleVideo │ ├── CMakeLists.txt │ └── main.cpp └── VBODisplay │ ├── CMakeLists.txt │ ├── kernal.cu │ └── main.cpp ├── package.xml ├── scripts ├── install_prerequisites.sh └── utils │ └── ansi2html.sh └── tools ├── CMakeLists.txt ├── ModelViewer ├── CMakeLists.txt ├── main.cpp ├── rendertree.h ├── shader.h └── util.h ├── Plotter ├── CMakeLists.txt ├── application-x-pangoplot.xml └── main.cpp ├── VideoConvert ├── CMakeLists.txt └── main.cpp ├── VideoJson ├── CMakeLists.txt ├── main-print.cpp └── main-transform.cpp └── VideoViewer ├── CMakeLists.txt ├── application-x-pango.svg ├── application-x-pango.xml └── main.cpp /.clang-format: -------------------------------------------------------------------------------- 1 | DisableFormat: true 2 | SortIncludes: false 3 | -------------------------------------------------------------------------------- /.github/workflows/bloom.yml: -------------------------------------------------------------------------------- 1 | name: bloom 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build_linux: 7 | name: "Ubuntu (${{ matrix.ros_distribution }})" 8 | 9 | runs-on: ubuntu-latest 10 | 11 | strategy: 12 | matrix: 13 | include: 14 | - docker_image: ubuntu:22.04 15 | ros_distribution: humble 16 | 17 | - docker_image: ubuntu:24.04 18 | ros_distribution: jazzy 19 | 20 | container: 21 | image: ${{ matrix.docker_image }} 22 | 23 | env: 24 | DEBIAN_FRONTEND: noninteractive 25 | 26 | steps: 27 | - name: install core dependencies 28 | run: | 29 | apt update 30 | apt install -y --no-install-recommends git ca-certificates 31 | 32 | - uses: actions/checkout@v4 33 | 34 | - uses: ros-tooling/setup-ros@v0.7 35 | 36 | - name: install build tool dependencies 37 | run: | 38 | apt install -y --no-install-recommends devscripts equivs python3-bloom 39 | 40 | - name: bloom 41 | run: | 42 | rosdep update 43 | bloom-generate rosdebian --ros-distro ${{ matrix.ros_distribution }} 44 | mk-build-deps 45 | apt install -y --no-install-recommends ./ros-${{ matrix.ros_distribution }}-*-build-deps_*_all.deb 46 | dpkg-buildpackage -b 47 | 48 | - name: install bloomed packages 49 | run: | 50 | apt install -y --no-install-recommends ../ros-${{ matrix.ros_distribution }}-*_*.deb ../ros-${{ matrix.ros_distribution }}-*-dbgsym_*.ddeb 51 | -------------------------------------------------------------------------------- /.github/workflows/colcon-workspace.yml: -------------------------------------------------------------------------------- 1 | name: colcon workspace 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | build: 7 | # test multiple Ubuntu and ROS distributions 8 | # https://github.com/ros-tooling/setup-ros#iterating-on-all-ros-distributions-for-all-platforms 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | include: 13 | - docker_image: ubuntu:20.04 14 | ros_distribution: noetic 15 | ros_version: 1 16 | 17 | - docker_image: ubuntu:22.04 18 | ros_distribution: humble 19 | ros_version: 2 20 | 21 | - docker_image: ubuntu:24.04 22 | ros_distribution: jazzy 23 | ros_version: 2 24 | 25 | container: 26 | image: ${{ matrix.docker_image }} 27 | 28 | steps: 29 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 30 | - uses: actions/checkout@v4 31 | 32 | - name: Setup ROS environment 33 | uses: ros-tooling/setup-ros@v0.7 34 | 35 | - name: ROS 1 CI Action 36 | if: ${{ matrix.ros_version == 1 }} 37 | uses: ros-tooling/action-ros-ci@v0.4 38 | with: 39 | package-name: pangolin 40 | target-ros1-distro: ${{ matrix.ros_distribution }} 41 | 42 | - name: ROS 2 CI Action 43 | if: ${{ matrix.ros_version == 2 }} 44 | uses: ros-tooling/action-ros-ci@v0.4 45 | with: 46 | package-name: pangolin 47 | target-ros2-distro: ${{ matrix.ros_distribution }} 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | CMakeLists.txt.user 3 | build* 4 | _builds 5 | _logs 6 | .vscode 7 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "scripts/vcpkg"] 2 | path = scripts/vcpkg 3 | url = https://github.com/microsoft/vcpkg.git 4 | [submodule "components/pango_python/pybind11"] 5 | path = components/pango_python/pybind11 6 | url = https://github.com/pybind/pybind11.git 7 | -------------------------------------------------------------------------------- /LICENCE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 Steven Lovegrove and Richard Newcombe 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /cmake/CreateMethodCallFile.cmake: -------------------------------------------------------------------------------- 1 | macro( CreateMethodCallFile filename namespace function symbols) 2 | file(WRITE ${filename} "// CMake generated file. Do Not Edit.\n\n#pragma once\n\nnamespace ${namespace} {\n\n") 3 | foreach( symbol ${symbols} ) 4 | file(APPEND ${filename} "void ${symbol}();\n") 5 | endforeach() 6 | file(APPEND ${filename} "\ninline bool ${function}()\n{\n") 7 | foreach( symbol ${symbols} ) 8 | file(APPEND ${filename} " ${symbol}();\n") 9 | endforeach() 10 | file(APPEND ${filename} " return true;\n}\n\n} // ${namespace}\n") 11 | endmacro() 12 | -------------------------------------------------------------------------------- /cmake/EmbedBinaryFiles.cmake: -------------------------------------------------------------------------------- 1 | # Creates C resources file from specified files 2 | # Based on http://stackoverflow.com/a/27206982 3 | function(embed_binary_files_now output binary_files) 4 | # Create empty output file 5 | file(WRITE ${output} "") 6 | # Iterate through input files 7 | foreach(bin ${binary_files}) 8 | # Get short filename 9 | string(REGEX MATCH "([^/]+)$" filename ${bin}) 10 | # Replace filename spaces & extension separator for C compatibility 11 | string(REGEX REPLACE "\\.| " "_" filename ${filename}) 12 | # Read hex data from file 13 | file(READ ${bin} filedata HEX) 14 | # Convert hex data for C compatibility 15 | string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," filedata ${filedata}) 16 | # Append data to output file 17 | file(APPEND ${output} "extern const unsigned char ${filename}[] = {${filedata}};\nextern const unsigned ${filename}_size = sizeof(${filename});\n") 18 | endforeach() 19 | endfunction() 20 | 21 | # Sets up rule for embedding files when they are newer than the output file (or it doesn't exist yet) 22 | function(embed_binary_files_rule output binary_files) 23 | add_custom_command( 24 | OUTPUT ${output} 25 | DEPENDS ${binary_files} 26 | COMMAND 27 | ${CMAKE_COMMAND} -DINPUT_BINARY_FILES=${binary_files} 28 | -DOUTPUT_SRC_FILE=${output} 29 | -P ${PROJECT_SOURCE_DIR}/cmake/EmbedBinaryFiles.cmake 30 | COMMENT "Embedding ${binary_files} into ${output}" 31 | ) 32 | endfunction() 33 | 34 | if(CMAKE_SCRIPT_MODE_FILE AND NOT CMAKE_PARENT_LIST_FILE) 35 | # Running in script mode as part of build-time procedure to actually to the embedding 36 | embed_binary_files_now(${OUTPUT_SRC_FILE} ${INPUT_BINARY_FILES} ) 37 | endif() -------------------------------------------------------------------------------- /cmake/EmscriptenUtils.cmake: -------------------------------------------------------------------------------- 1 | if(EMSCRIPTEN) 2 | macro( create_host_index_html filename prog_name) 3 | file( WRITE ${filename} 4 | " 5 |
6 | 7 |