{"id":20649546,"url":"https://github.com/leapmotion/leapcxx","last_synced_at":"2025-04-17T01:25:41.516Z","repository":{"id":151171926,"uuid":"130763624","full_name":"leapmotion/LeapCxx","owner":"leapmotion","description":"Implementation of older C++ API using LeapC","archived":false,"fork":false,"pushed_at":"2018-08-20T20:30:56.000Z","size":413,"stargazers_count":52,"open_issues_count":3,"forks_count":18,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-29T05:51:15.862Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leapmotion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-04-23T22:23:07.000Z","updated_at":"2025-03-23T00:26:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"aa83eb21-2fa4-4a6d-b1cf-4e51bf5cbd72","html_url":"https://github.com/leapmotion/LeapCxx","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2FLeapCxx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2FLeapCxx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2FLeapCxx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leapmotion%2FLeapCxx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leapmotion","download_url":"https://codeload.github.com/leapmotion/LeapCxx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249296870,"owners_count":21246309,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T17:14:45.757Z","updated_at":"2025-04-17T01:25:41.500Z","avatar_url":"https://github.com/leapmotion.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeapCxx\nImplementation of LeapAPI (1.0-3.0) using LeapC\n\n### Introduction\nLeap SDK 4.0 deprecates the older LeapAPI, which was C++ natively. To help ease the transition, we are providing\nthis wrapper which implements the old API (with a few minor edits) and the various SWIG-based language bindings \nusing LeapC. Users should be aware that the primary motivation for removing the C++ API was that it had \narchitectural constraints that made it inherently slow and difficult to maintain, so this should **NOT** be taken\nas an example of how to create a good language binding. For that, we recommend the referencing LeapCSharp binding \nin the UnityModules project that was designed from the ground up to take advantage of LeapC's performance.\n\n### Migration from LeapAPI\nLeapCxx is nearly identical to the old LeapAPI with a few notable exceptions:\n - The configuration API is signifigantly different\n - Several fields which had been deprecated have been removed, including gestures and the interaction box\n - Static linkage is now recommended for C++\n\nBecause this is a binding layer on top of LeapC, we recommend that users link with LeapCxx statically,\nthen ship only LeapC.dll with their application.\n\n### Requirements\n  * LeapSDK 4.0.0\n  * CMake 3.10+\n  * C++11 compliant compiler\n\n  In addition, the Swig language bindings require\n    * Swig 3.0.12+\n    * Python 3.6+\n    * JDK 8+\n\n### Building LeapCxx\nLeapCxx builds using CMake 3.10 or higher. See the [CMake documentation](https://cmake.org/cmake/help/latest/)\nfor more information on using CMake, and the LeapSDK Readme for information specific to using the SDK with \nCMake. CMake must know where to find the LeapSDK, so either set `CMAKE_PREFIX_PATH` to the directory containing\nthe LeapSDK, or set `LeapSDK_DIR` to `.../LeapSDK/lib/cmake/LeapSDK`. For just LeapCxx, no additional configuration is\nneeded.\n\n### Building SWIG bindings\nTo build the SWIG bindings, set the cmake variables `BUILD_SHARED_LIBS` and `BUILD_SWIG` to `ON`, then regenerate\nthe solution files via CMake. The targets `LeapJava` and `LeapPython` should now be available, along with the\nsamples for each.\n\n### Building Samples\nAll the samples have build steps defined as part of the cmake projects. If you'd like to build the swig\nsamples manually, follow the steps below.\n\nJava\n```\ncd LeapCxx/samples\njavac -cp .;\u003cLeapCxx_build_dir\u003e/bin/\u003cconfig_subdir\u003e/LeapJava.jar Sample.java\njava -Djava.library.path=\"\u003cLeapCxx_build_dir\u003e/bin/\u003cconfig_subdir\u003e\" -cp .;\u003cLeapCxx_build_dir\u003e/bin/\u003cconfig_subdir\u003eLeapJava.jar Sample\n```\nPython\n```\ncp LeapCxx/samples/Sample.py \u003cLeapCxx_build_dir/bin/\u003cconfig_subdir\u003e/\ncd \u003cLeapCxx_build_dir/bin/\u003cconfig_subdir\u003e\npython Sample.py\n```\n\n### Suggestions for future work\nThe current API, for the sake of compatibility, uses reference counting and a PIMPL idiom quite extensively. \nNeither of those are strictly necessary in a wrapper layer, and it should be possible to create a much faster,\nlighterweight C++ and even SWIG binding layer which more directly maps to the LeapC idioms and allows a more\nobject oriented approach, for example allowing\n\n```\nauto connection = LeapCreateConnection(...);\nconnection.open();\nLeapEvent event = connection.poll(...);\n```\ninstead of\n```\n  LEAP_CONNECTION connection;\n  LeapCreateConnection(cfg, \u0026connection);\n  LeapOpenConnection(connection);\n```\n\nUsers wanting to implement such a wrapper should consult the LeapC documentation\nfor more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapmotion%2Fleapcxx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleapmotion%2Fleapcxx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleapmotion%2Fleapcxx/lists"}