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?