0

I'm running SDL2 with a c++ application over VcXsrv. I'm trying to take mouse input however the eventloop seems totaly unresponsive. My eventloop looks as following but whithout the mouse logic.

    bool quit = false;
    while (!quit){
        SDL_Event event;
        while (SDL_PollEvent(&event)){
            std::cout << "Event: " << event.type << std::endl;
            if (event.type == SDL_QUIT){
                quit = true;
            }
        }
        SDL_RenderClear(renderer);
        SDL_SetRenderDrawColor(renderer, 0, 255, 0, 255);
        SDL_RenderPresent(renderer);
    }

When running the program it outputs:

Event: 512
Event: 512
Event: 512
Event: 512
Event: 512
Event: 512

After that it is completely unresponsive. I cannot exit the window or even get it to poll any more events. To me the code seems completely fine and I don't see the problem.

I've tried to look old working examples that I've built and copy them but they are basically exactly the same.

EDIT: I tried running it on my Ubuntu laptop which worked fine. Maybe it's a windows specific problem?

genpfault
  • 51,148
  • 11
  • 85
  • 139
Villiam
  • 21
  • 3
  • 1
    Yes, probably a WSL issue. Check if other GUI apps work or not. But IMO developing natively on Windows would be less troublesome ([MSYS2](https://stackoverflow.com/q/30069830/2752075) will give you a decent emulation of the linux environment, if that's what you want; or use Visual Studio). – HolyBlackCat Dec 08 '22 at 22:40

0 Answers0