A way to make keyboard event queue both responsive and not take whole CPU power

前端 未结 4 636
迷失自我
迷失自我 2021-01-06 03:56

I am making an Sdl game, it\'s 2d shooter. I am using SDL to import surfaces and OpenGL to draw them on the screen (doing so because it works way faster than just SDL). I\'v

4条回答
  •  一生所求
    2021-01-06 04:04

    I'd suggest looking into SDL_EventFilter and the related functions. It's not a polling queue input method, so it doesn't require stalling, although, if I remember correctly, it doesn't happen on the main thread, which may be exactly what you need for performance, but might complicate the code.

提交回复
热议问题