瀏覽代碼

added sentinel_is_paused

Nicolas Cannasse 8 年之前
父節點
當前提交
90b5a8f55d
共有 2 個文件被更改,包括 6 次插入1 次删除
  1. 1 1
      libs/sdl/sdl/Sdl.hx
  2. 5 0
      libs/ui/ui_win.c

+ 1 - 1
libs/sdl/sdl/Sdl.hx

@@ -36,7 +36,7 @@ class Sdl {
 		var flags = new haxe.EnumFlags<hl.UI.DialogFlags>();
 		flags.set(IsError);
 		var msg = 'The application was unable to create an OpenGL context\nfor your $device video card.\nOpenGL $requiredGLMajor.$requiredGLMinor+ is required, please update your driver.';
-		#if (haxe_ver >= "3.4.1") sentinel.setPause(true); #end
+		sentinel.pause = true;
 		hl.UI.dialog("OpenGL Error", msg, flags);
 		Sys.exit( -1);
 	}

+ 5 - 0
libs/ui/ui_win.c

@@ -252,6 +252,10 @@ HL_PRIM void HL_NAME(ui_sentinel_pause)( vsentinel *s, bool pause ) {
 	s->pause = pause;
 }
 
+HL_PRIM bool HL_NAME(ui_sentinel_is_paused)( vsentinel *s ) {
+	return s->pause;
+}
+
 HL_PRIM void HL_NAME(ui_close_console)() {
 	FreeConsole();
 }
@@ -274,3 +278,4 @@ DEFINE_PRIM(_VOID, ui_close_console, _NO_ARG);
 DEFINE_PRIM(_SENTINEL, ui_start_sentinel, _F64 _FUN(_VOID,_NO_ARG));
 DEFINE_PRIM(_VOID, ui_sentinel_tick, _SENTINEL);
 DEFINE_PRIM(_VOID, ui_sentinel_pause, _SENTINEL _BOOL);
+DEFINE_PRIM(_BOOL, ui_sentinel_is_paused, _SENTINEL);