SDL2 renderer not rendering on Raspberry Pi 3 model B

Hi, I cloned, built and installed libsdl2 on Raspberry Pi 3 running Kano OS using these instructions:

hg clone https://hg.libsdl.org/SDL SDL
cd SDL
mkdir build
cd build
../configure
make
sudo make install

I then tried to run a simple “Hello World” SDL app where I’m just clearing the screen but it doesn’t work properly. As shown in the picture below:

As you can see, instead of clearing the window the renderer of the “Hello World” SDL Window does nothing. And all we see it everything that is behind the SDL Window. I moved the SDL “Hello World” window before taking the screenshot. That’s why things look like they are out of place.

Here is the code for the simple SDL Hello World app:

#include <SDL2/SDL.h>

int main(int argc, char *argv[]) {
    SDL_Window *win = NULL;
    SDL_Renderer *renderer = NULL;
    int posX = 100, posY = 100, width = 640, height = 480;

    SDL_Init(SDL_INIT_VIDEO);

    win = SDL_CreateWindow("Hello World", posX, posY, width, height, 0);

    renderer = SDL_CreateRenderer(win, -1, SDL_RENDERER_ACCELERATED);

	SDL_SetRenderDrawColor(renderer, 255, 0, 0, 255);
    while (1) {
        SDL_Event e;
        if (SDL_PollEvent(&e)) {
            if (e.type == SDL_QUIT) {
                break;
            }
        }

        SDL_RenderClear(renderer);
        SDL_RenderPresent(renderer);
    }

    SDL_DestroyRenderer(renderer);
    SDL_DestroyWindow(win);

    SDL_Quit();

    return 0;
}

Can you please help me make it work properly? Thanks in advance!