瀏覽代碼

some blocking api calls

ncannasse 7 年之前
父節點
當前提交
e2f8143e0e
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      libs/sdl/sdl.c

+ 5 - 0
libs/sdl/sdl.c

@@ -247,7 +247,9 @@ HL_PRIM void HL_NAME(quit)() {
 }
 
 HL_PRIM void HL_NAME(delay)( int time ) {
+	hl_blocking(true);
 	SDL_Delay(time);
+	hl_blocking(false);
 }
 
 HL_PRIM int HL_NAME(get_screen_width)() {
@@ -264,9 +266,12 @@ HL_PRIM int HL_NAME(get_screen_height)() {
 
 
 HL_PRIM void HL_NAME(message_box)(vbyte *title, vbyte *text, bool error) {
+	hl_blocking(true);
 	SDL_ShowSimpleMessageBox(error ? SDL_MESSAGEBOX_ERROR : 0, (char*)title, (char*)text, NULL);
+	hl_blocking(false);
 }
 
+
 HL_PRIM void HL_NAME(set_vsync)(bool v) {
 	SDL_GL_SetSwapInterval(v ? 1 : 0);
 }