소스 검색

Fix engine null access in some drivers

TothBenoit 1 년 전
부모
커밋
11ac6f44e7
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      h3d/Engine.hx

+ 1 - 1
h3d/Engine.hx

@@ -78,6 +78,7 @@ class Engine {
 		realFps = hxd.System.getDefaultFrameRate();
 		lastTime = haxe.Timer.stamp();
 		window.addResizeEvent(onWindowResize);
+		setCurrent();
 		#if macro
 		driver = new h3d.impl.NullDriver();
 		#elseif (js || hlsdl || usegl)
@@ -100,7 +101,6 @@ class Engine {
 		#else
 		#if sys Sys.println #else trace #end("No output driver available." #if hl + " Compile with -lib hlsdl or -lib hldx" #end);
 		#end
-		setCurrent();
 	}
 
 	static var CURRENT : Engine = null;