{"id":15207022,"url":"https://github.com/miho/nativefx","last_synced_at":"2025-10-29T08:33:57.486Z","repository":{"id":48010232,"uuid":"192116952","full_name":"miho/NativeFX","owner":"miho","description":"Native Rendering integration for JavaFX (13 and beyond)","archived":false,"fork":false,"pushed_at":"2021-09-03T16:37:44.000Z","size":1195,"stargazers_count":138,"open_issues_count":8,"forks_count":14,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-02-02T00:24:26.595Z","etag":null,"topics":["html5","javafx","native-rendering","qt5","scene-graph","webgl"],"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/miho.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-15T19:33:35.000Z","updated_at":"2025-01-15T03:35:19.000Z","dependencies_parsed_at":"2022-08-12T16:31:12.721Z","dependency_job_id":null,"html_url":"https://github.com/miho/NativeFX","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FNativeFX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FNativeFX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FNativeFX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/miho%2FNativeFX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/miho","download_url":"https://codeload.github.com/miho/NativeFX/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238795461,"owners_count":19531748,"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":["html5","javafx","native-rendering","qt5","scene-graph","webgl"],"created_at":"2024-09-28T06:06:06.421Z","updated_at":"2025-10-29T08:33:51.338Z","avatar_url":"https://github.com/miho.png","language":"C++","readme":"# NativeFX (WIP)\n\n[![Build Status](https://mihosoft.visualstudio.com/VRL/_apis/build/status/miho.NativeFX?branchName=master)](https://mihosoft.visualstudio.com/VRL/_build/latest?definitionId=8\u0026branchName=master)\n\u003ca href=\"https://foojay.io/today/works-with-openjdk\"\u003e\n   \u003cimg align=\"right\" \n        src=\"https://github.com/foojayio/badges/raw/main/works_with_openjdk/Works-with-OpenJDK.png\"   \n        width=\"100\"\u003e\n\u003c/a\u003e\n\n\u003cbr\u003e\n\nNative Rendering integration for JavaFX (13 and beyond)\n\n\u003cimg src=\"resources/img/screenshot-macos.jpg\"\u003e\n\n## Why?\nNativeFX adds native rendering support to the JavaFX scene graph. It uses [Boost IPC](https://www.boost.org/doc/libs/1_63_0/doc/html/interprocess.html) to share memory among multiple processes. In contrast to other solutions it runs with the official APIs. No workarounds necessary. And since the native rendering is done in a seperate process it won't crash your JVM if something goes wrong. That's ideal if you are interesed in a robust solution.\n\nWhy should you use it? Ever wanted to integrate native applications into the scene graph? Maybe you want to add OpenGL support, a Qt application or Blink/WebKit. All of this will be possible with NativeFX!\n\n## WIP\n\nGot curious? This project is still WIP. But it comes with a sample server that shows how to use it. We run it on Linux, macOS and Windows (on x64). There's a good chance it will work for you as well. If not, create an issue and let us know!\n\nMany features are still missing. But this project is already compatible with JDK13 and JavaFX 13.\n\n## Performance\n\nThere have been efforts to do this before. Why should this approach be any better? \n\nGood question! We started with a direct buffer and used the PixelWriter interface to update a WritableImage that displays the content. With JavaFX 13 we added support for the new PixelBuffer API. Early tests show that we can expect a performance boost of around 50%. For our use cases this is a game changer!\n\nIf you are willing to use internal APIs you can try [DriftFX](https://github.com/eclipse-efx/efxclipse-drift). Which will work with direct texture sharing instead of slow CPU based buffers. NativeFX is a more conservative approach.\n\n## Building NativeFX\n\n### Requirements\n\n- Java \u003e= 11\n- C++11 compliant compiler (GCC, Clang, Visual Studio 2017-19)\n- CMake \u003e= 3.9\n- Internet connection (dependencies are downloaded automatically)\n- IDE: [Gradle](http://www.gradle.org/) Plugin (not necessary for command line usage)\n\n### IDE\n\nOpen the `NativeFX` [Gradle](http://www.gradle.org/) project in your favourite IDE (tested with VSCode) and build it\nby calling following tasks `clean assemble`.\n\n### Command Line\n\nNavigate to the `NativeFX` [Gradle](http://www.gradle.org/) project (i.e., `path/to/NativeFX/`) and enter the following command\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew clean assemble\n    \n#### Windows (CMD)\n\n    gradlew clean assemble\n\nOn Windows, make sure the environment is configured for development (MSBuild.exe must be on the path).\n\n## Testing NativeFX\n\n### Step 1 (compile and run the sample-server)\n\nTo compile and run the sample-server, do the following (relative to the previous project folder):\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    cd sample-servers/sample-server/\n    mkdir build\n    cd build\n    cmake ..\n    make\n    ./sample-server -n _mem_1\n    \n#### Windows (CMD)\n\n    cd sample-servers/sample-server/\n    mkdir build\n    cd build\n    cmake .. -DCMAKE_GENERATOR_PLATFORM=x64\n    MSBuild.exe sample-server.sln /property:Configuration=Release /property:Platform=x64\n    Release\\x64\\sample-server.exe -n _mem_1\n    \nIf the last command doesn't work, then check whether the executable is located in `Release\\sample-server.exe` without `x64`.    \n\n### Step 2 (run the sample JavaFX application)\n\nNavigate back to the NativeFX project folder (i.e., `path/to/NativeFX/`) and do the following:\n\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew run\n    \n#### Windows (CMD)\n\n    gradlew run\n    \nNow, click the Connect button.    \n    \nThat's it!\n\n## Testing the Qt sample server:\n\n### Requirements\n\n- Qt 5.x (tested with 5.12 and 5.13.1)\n- Internet connection\n\n### Step 1 (compile and run the sample-server)\n\nMake sure Qt is installed properly (libs must be on the PATH). To compile and run the sample-server, do the following (relative to the previous project folder):\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    cd sample-servers/nativefx-qt/\n    mkdir build\n    cd build\n    cmake ..\n    make\n    ./nativefx-qt -n _mem_1\n  \n#### Windows (CMD)\n\n    cd sample-servers/nativefx-qt/\n    mkdir build\n    cd build\n    cmake .. -DCMAKE_GENERATOR_PLATFORM=x64\n    MSBuild.exe nativefx-qt.sln /property:Configuration=Release /property:Platform=x64\n    Release\\nativefx-qt.exe -n _mem_1\n    \nIf Qt5 cannot be found, let CMake know where to search for Qt, e.g.,\n\n    cmake .. -DCMAKE_GENERATOR_PLATFORM=x64 -DQt5_DIR=C:\\Qt\\5.13.1\\msvc2017_64\\lib\\cmake\\Qt5\\\n\nHint: Qt5_Dir has to point to a directory containing 'Qt5Config.cmake' or 'qt5-config.cmake'.\n    \nIf the last command doesn't work, then check whether the executable is located in `Release\\nativefx-qt.exe` without `x64`.     \n    \n### Step 2 (run the sample JavaFX application)\n\nNavigate back to the NativeFX project folder (i.e., `path/to/NativeFX/`) and do the following:\n\n#### Bash (Linux/macOS/Cygwin/other Unix shell)\n\n    bash gradlew run\n    \n#### Windows (CMD)\n\n    gradlew run\n    \nNow, click the Connect button. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiho%2Fnativefx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmiho%2Fnativefx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmiho%2Fnativefx/lists"}