New answers tagged

0

A guess as to why that line is there is that your flipping algorithm doesn't handle odd/middle lines well. I recommend the classical algorithm for flipping, for(int i = 0;i<length/2;i++) array[i] = array[array.length-i - 1] (psuedocode).


-1

They added it to build 79, the method is called: glfwSetWindowIcon(long window, Buffer images);


0

From my own personal experiences, you can't really add the res folder into the jar file unless you use InputStreams (this is so that the game can read the res files inside the jar file and not in the same folder), however, you can add the native files into the jar. With JarSplice, there is a tab called "Add Natives," you use that tab to locate the natives ...


-1

The reason why your game takes up 15% CPU is because of your map size, which is 1024*768, and the game constantly has to run this map several times each second in the render() method, which of course would take up memory. I would suggest following this tutorial on TiledMap rendering (https://www.youtube.com/watch?v=0BivL6Carh4), start watching at around 6 ...


0

To fix the aspect ratio (and speed up the shader a bit): void main() { vec2 diff = (v_position + 1.0) * 0.5 - u_mousePosition; diff.x *= u_aspect; // e.g.: (16.0 / 9.0) for 16:9 float distance = dot(diff, diff); // square of distance, saves a square-root if(distance > u_lightRadius_squared)) { discard; } outColor = ...


0

How do I know what the camera distance is from the image plane? I'm not sure if this is a meaningful question to ask - what is the image plane? A real camera has a plane on which an image is formed, but in OpenGL there is no such thing. If you need this for some physics-based calculation, you could possibly use the near clipping plane distance (third ...



Top 50 recent answers are included