-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LWJGL library requires porting of JNI component #32
Comments
Using |
Ok, that makes sense as I received this I notice in the stack trace it says |
In particular the function ``getJNIVersion In am renaming this bug report to better represent the problem. |
@HWilliams64 Have you found a work-around yet? I would love to see LWJGL in CheerpJ! 😄 |
I have something to add to the discussion. This demo loads a file named jni.js, and that file has a function named |
Interesting.. Any word on when they will release the source code?
…On Wed, Jun 17, 2020 at 3:18 PM sleirsgoevy ***@***.***> wrote:
I have something to add to the discussion. This demo
<https://cheerpjdemos.leaningtech.com/OpenAstexViewer.html> loads a file
named jni.js <https://cjrtnc.leaningtech.com/2.1/jni.js>, and that file
has a function named JNIGetEnv that returns a pointer onto the emulated
heap. This suggests that CheerpJ probably has a working JNI implementation
that is kept in private for some reason; it's hard to say anything specific
without seeing the source.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#32 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AH3V2DIACFI42FK6KRW666TRXE6LHANCNFSM4FEGCP3A>
.
|
CheerpJ includes an internal (partial) implementation of the JNI which itself is build with a modified version of our Cheerp compiler. We don't have plans to release this to the public due to lack of commercial interest for this feature. It would also not be useful to run LWJGL. LWJGL uses the JNI to access the native graphic libraries, such as GLX on X11/Linux. A special web enabled implementation would still be needed. CheerpJ makes it possible to directly implement Java native methods in JS (https://github.com/leaningtech/cheerpj-meta/wiki/Implementing-Java-native-methods-in-JS), that is the simplest way of implementing the JNI components of a library. |
I once tried to port LWJGL to CheerpJ, and I don't think that reimplementing the whole JNI part of it in JavaScript is a good idea. The reason is that most of LWJGL's native code isn't actually platform-specific. IMHO the proper way to do it is either using JNI (either the official one, or a clean-room reimplementation), or reimplementing the whole library, not just native code, directly in JS, which would allow to emulate the high-level API instead of the low-level OS-specific calls. |
I also discovered: https://cjrtnc.leaningtech.com/2.1/jni.wasm |
rip no lwjgl |
any updates on this? |
Not yet. With the new CJ3 architecture it will be easier to compile external JNI components, but as LWJGL depends not only on pure GL (which can be more-or-less directly mapped to WebGL) but also on X11, it will be a difficult project anyway. |
The system seems to get stuck on the screen that says “ Graphic system is initializing”
I am running it via a chrome web browser
My html file is specified below
In chrome I opened Inspector > Network Manager and was able to find this exception was being thrown
I read over this thread #30 and realized I didn’t add my main class. I subsequently added my main class to the html and produced what you see below
And now its throwing this exception and it does not even get past the “CheerpJ runtime ready page”
The text was updated successfully, but these errors were encountered: