Skip to main content
Commonmark migration
Source Link

Solution

##Solution## WellWell, the problem is that neither or the code snippets are synchronized. As mentioned before, I have two threads interacting with my grid: the updating/rendering threads. What appears to be the issue is that my rendering thread draws part of the grid (starting from the bottom-left). And then, the updater moves the grid while the grid is being drawn. After the grid is modified in the rendering thread completes the drawing, but at the new location. This causes the horizontal split to occur in the grid.

Corrected Functions

@Override public synchronized void move(double x, double y) { //... } public synchronized void render(GL2 gl){ //... } 

It makes sense that the movement of the grid never broke when using a movement speed of 2^x * FPS. This is because the grid location never ends up in the middle of the box with the corners (-1, -1) and (0, 0). While although the image is still not synchronized, it does not contain the horizontal line artifact.

##Solution## Well, the problem is that neither or the code snippets are synchronized. As mentioned before, I have two threads interacting with my grid: the updating/rendering threads. What appears to be the issue is that my rendering thread draws part of the grid (starting from the bottom-left). And then, the updater moves the grid while the grid is being drawn. After the grid is modified in the rendering thread completes the drawing, but at the new location. This causes the horizontal split to occur in the grid.

Corrected Functions

@Override public synchronized void move(double x, double y) { //... } public synchronized void render(GL2 gl){ //... } 

It makes sense that the movement of the grid never broke when using a movement speed of 2^x * FPS. This is because the grid location never ends up in the middle of the box with the corners (-1, -1) and (0, 0). While although the image is still not synchronized, it does not contain the horizontal line artifact.

Solution

Well, the problem is that neither or the code snippets are synchronized. As mentioned before, I have two threads interacting with my grid: the updating/rendering threads. What appears to be the issue is that my rendering thread draws part of the grid (starting from the bottom-left). And then, the updater moves the grid while the grid is being drawn. After the grid is modified in the rendering thread completes the drawing, but at the new location. This causes the horizontal split to occur in the grid.

Corrected Functions

@Override public synchronized void move(double x, double y) { //... } public synchronized void render(GL2 gl){ //... } 

It makes sense that the movement of the grid never broke when using a movement speed of 2^x * FPS. This is because the grid location never ends up in the middle of the box with the corners (-1, -1) and (0, 0). While although the image is still not synchronized, it does not contain the horizontal line artifact.

Source Link

##Solution## Well, the problem is that neither or the code snippets are synchronized. As mentioned before, I have two threads interacting with my grid: the updating/rendering threads. What appears to be the issue is that my rendering thread draws part of the grid (starting from the bottom-left). And then, the updater moves the grid while the grid is being drawn. After the grid is modified in the rendering thread completes the drawing, but at the new location. This causes the horizontal split to occur in the grid.

Corrected Functions

@Override public synchronized void move(double x, double y) { //... } public synchronized void render(GL2 gl){ //... } 

It makes sense that the movement of the grid never broke when using a movement speed of 2^x * FPS. This is because the grid location never ends up in the middle of the box with the corners (-1, -1) and (0, 0). While although the image is still not synchronized, it does not contain the horizontal line artifact.