Hello stackoverflow! I come to ask you for help with the famous SDL2.
As you know the pile where the events are stored grows and grows constantly unless it is released for example in the following way:
SDL_Event ev;
...
while(continuarJugando){
while(SDL_PollEvent(&ev) continue;
}
Something like that I do in my gameloop. The problem is that until the execution of my game does not reach the gameloop is loaded some images with IMG_LoadTexture, which I imagine can not be done until the SDL initialization with SDL_INIT_VIDEO. And what happens if you start the video system? that the event system is activated automatically.
So what I suffer is that my stack of events grows and grows until it overflows and crashes my executable because I am not collecting the events when loading the images.
I suppose that between load and resource load could include a loop like the one in SDL_PollEvent that I put above. But would not it be better to disable the subsystem of events until I want to use it, or something like that? Do you know of any other solution that I do not know?
Thank you very much