In my game, there is a map (2D array) represented by tiles some of which are walls and each on of them I draw with SDL\_RenderFillRect(), but for some reason when moving the camera (the position of each rect is determined by camera offset) I get light lines appearing on the screen (like seams between the tiles maybe) and something like tearing. I don't understand where this would come from, because I first render everything and SDL\_RenderPresent() it once. These bugs are most noticeable on Android, perhaps because of the CPU/GPU being slower or something. I did try to enable Vsync/cap FPS, but that didn't help much.

Here is a piece of code where I draw the tiles (the entire source code can be found [here](https://github.com/postmodernist1488/Cants)):

```c
//only iterate over walls that are on the screen
for (int i = g_camera.y / CELL_SIZE; i < (g_camera.y + g_camera.h + CELL_SIZE) / CELL_SIZE && i < g_map.height; i++) {
    for (int j = g_camera.x / CELL_SIZE; j < (g_camera.x + g_camera.w + CELL_SIZE) / CELL_SIZE && j < g_map.width; j++) {
        if (g_map.matrix[i][j] == MAP_WALL) {
            SDL_Rect coords = {
                j * CELL_SIZE - g_camera.x,
                i * CELL_SIZE - g_camera.y,
                CELL_SIZE,
                CELL_SIZE
            };
            SDL_RenderFillRect(g_renderer, &coords);
        }
        else if (g_map.matrix[i][j] == MAP_FOOD) {
            render_texture(g_leaf_texture, j * CELL_SIZE - g_camera.x, i * CELL_SIZE - g_camera.y);
        }
    }
}

```

This is what the result looks like, though it's very hard to capture the graphical bugs:

[![screenshot](https://i.stack.imgur.com/egOAk.png)](https://i.stack.imgur.com/egOAk.png)