So I installed OpenJDK 16.0.2 Aarch64 Windows version (that was the only ARM Java I could find) and told Minecraft launcher to use the OpenJDKs javaw.exe. The cleanup method will also be simplified since the Mesh class already provides one for freeing VAO and VBO resources. Since Minecraft JE is a Java program, I thought that I can somehow manage to run Minecraft but bypassing the x86 emulation, using the Aarch64 ported version of Java Runtime, JVM or whatever. I hope you can understand me and know what i want. If you change the scale factor and rerun the example you will see that performance problem starts to arise and the movement through the 3D world is not smooth. Let’s scale the size of the skybox by a factor of 50 so the world will be composed by 40,000 GameItem instances (cubes). But i don't want to change the values every time when i wan't a other window size. So, ok, let’s increase the skybox size and the size of our world. OpenGL will create a new name for that VAO and fill in the array with the name (OpenGL uses numbers for names - one of the many strange things about OpenGL). Our render method in the Renderer class will accept also a Mesh instance to render. As you can see it just looks good when the window size is 1080x1080 Pixel. But basically you allocate an int array on the java side.
We will create our Mesh instance in our DummyGame class, removing the VAO and VBO code from Renderer init method. GlVertexAttribPointer( 0, 3, GL_FLOAT, false, 0, 0) If you come from previous versions of LWJGL it's important to stress out a few topics. The only way of sharing memory data between Java and native code is by directly allocating memory in Java. GlBufferData(GL_ARRAY_BUFFER, verticesBuffer, GL_STATIC_DRAW) Memory stored in the heap cannot be accessed by native code (JNI, the mechanism that allows calling native code from Java does not allow that). VerticesBuffer = mAllocFloat(positions.length)
In order to tidy up our code a little bit let’s create a new class called Mesh which, taking as an input an array of positions, creates the VBO and VAO objects needed to load that model into the graphics card. the equivalent of glViewport(0,0,width,height).
In this chapter we will continue talking about how OpenGL renders things. When a context is first attached to a window, the viewport will be set to the dimensions of the window, i.e.