Skip to content

Commit c5dbb4d

Browse files
Apply suggestions from code review
Co-authored-by: Alessandro Pignotti <alessandro@leaningtech.com>
1 parent 2a7d873 commit c5dbb4d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

content/blog/CJ-3-1-roadmap.mdx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,30 +123,30 @@ To keep things simple let’s focus on the Minecraft 1.0 release. It was compose
123123

124124
LWJGL, on the other hand, it’s only superficially Java. Most of its value comes from JNI methods which provide direct access to each and every method exposed by OpenGL. These methods are written in C and automatically generated by the LWJGL build system from a declarative representation of the OpenGL API.
125125

126-
As of the 3.0 release we could get Minecraft to partially work by manually implementing a small subset of the LWJGL [JNI methods](https://cheerpj.com/docs/guides/implementing-native-methods) directly in JavaScript, but this method turned out to be extremely time consuming. Moreover, Minecraft is built on legacy OpenGL techniques which do not directly map to WebGL capabilities. The end result was promising but underwhelming, with lots of manual effort required to achieve a poorly rendered and slow version of the game.
126+
As of the 3.0 release we could get Minecraft to partially work by manually implementing a small subset of the LWJGL [JNI methods](https://github.com/leaningtech/cheerpj-natives) directly in JavaScript, but this method turned out to be extremely time consuming. Moreover, Minecraft is built on legacy OpenGL techniques which do not directly map to WebGL capabilities. The end result was promising but underwhelming, with lots of manual effort required to achieve a poorly rendered and slow version of the game.
127127

128-
The solution to all these problems is to simply compile more things to Wasm. CheerpJ 4.0 will support loading of WebAssembly modules at runtime. These modules can be generated from C/C++ code coming from either JNI modules or arbitrary libraries required by Java applications.
128+
The solution to all these problems is to simply compile even more things to Wasm. CheerpJ 4.0 will support loading of WebAssembly modules at runtime. These modules can be generated from C/C++ code coming from either JNI modules or arbitrary libraries required by Java applications.
129129

130-
In the case of Minecraft there are several moving parts
130+
In the case of Minecraft there are several components:
131131

132132
- **lwjgl2.wasm**: Is generated from the unmodified C code generated by the LWJGL build system. It exposes all the native methods of LWJGL, completely removing the need to manually write any code in JavaScript.
133-
- **gl4es.wasm**: Is a WebAssembly build of gl4es [LINK], a FOSS library that implements legacy GL on top of GLES
133+
- **gl4es.wasm**: Is a WebAssembly build of [gl4es](https://github.com/ptitSeb/gl4es/), a FOSS library that implements legacy GL on top of GLES.
134134
- **gles.wasm**: A WebAssembly module mapping GLES APIs to WebGL, which will be automatically provided by CheerpJ.
135-
- **X11.wasm**: A background process providing X11 emulation to integrate native Java windows and windows created for OpenGL rendering.
135+
- **X11.wasm**: A background process providing X11 emulation to integrate Java windows and windows created for OpenGL rendering.
136136

137137
The end result of this stack is Minecraft rendering correctly in the browser via CheerpJ, with the level of performance being already quite good and with more improvements planned before CheerpJ 4.0 is released.
138138

139-
All these WebAssembly modules can be generated without any change to the original code using Cheerp, our C/C++ to WebAssembly/JavaScript compiler. This is possible thanks to new Cheerp features that will soon support compiling any unmodified Linux C/C++ applications to WebAssembly. Stay tuned for more information and join our [Discord server](https://discord.leaningtech.com/) to be always updated on all our products.
139+
All these WebAssembly modules can be generated without any change to the original code using Cheerp, our C/C++ to WebAssembly/JavaScript compiler. This is possible thanks to new [Cheerp](https://cheerp.io) features that will soon support compiling any unmodified Linux C/C++ applications to WebAssembly. Stay tuned for more information and join our [Discord server](https://discord.leaningtech.com/) to be always updated on all our products.
140140

141141
### All of this, only for Minecraft?
142142

143143
As it often happens with our [development tools](https://labs.leaningtech.com/), solutions might be inspired by a specific use case, but are always designed to be generic.
144144

145145
Popular toolkits such as SWT and JavaFX, that are also not currently supported by CheerpJ, have very similar characteristics to the Minecraft/LWJGL use case:
146146

147-
- **Shallow Java surface** with lots of C/C++ JNI logic;
148-
- **Dependency on large C libraries**, GTK in particular;
149-
- **X11 requirement**, particularly for SWT;
147+
- **Shallow Java surface** with lots of C/C++ JNI logic
148+
- **Dependency on large C libraries**, GTK in particular
149+
- **X11 requirement**, particularly for SWT
150150
- **OpenGL requirement**, particularly for JavaFX
151151

152152
It is clear that the building blocks to successfully run Minecraft in CheerpJ are the same required to achieve SWT and JavaFX support.
@@ -192,7 +192,7 @@ For questions, discussion, and support, [join our Discord](https://discord.leani
192192

193193
---
194194

195-
CheerpJ is a product built with passion and a lot of coffee by Leaning Technologies, an international team of WebAssembly hackers based in Amsterdam (NL) and Leeds (UK). We hope you’ll find it as exciting as we do.
195+
CheerpJ is a product built with passion and a lot of coffee by Leaning Technologies, an international team of WebAssembly hackers based in Amsterdam (NL) and Leeds (UK). We hope you’ll love it as much as we do.
196196

197197
<LinkButton
198198
href="https://github.com/leaningtech/cheerpj-meta"

0 commit comments

Comments
 (0)