[英]I had an issue with SDL_Delay() in MacOS 10.14.6
似乎 SDL_Delay() 在 macOS 中有一些問題,我們可以使用:
bool is_running = true;
SDL_Event event;
while (is_running) {
while (SDL_PollEvent(&event)) {
if (event.type == SDL_QUIT) {
is_running = false;
}
}
SDL_Delay(16);
}
但是當我想讓我的程序停止2秒時我應該使用什么。
我找到了答案: https://discourse.libsdl.org/t/sdl2-cant-see-the-window/25835
好的,我發現了問題。 window 不會出現在 OS X 上,除非我有一個事件循環(在我有一個 SDL_Delay 調用之前)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.