Sfoglia il codice sorgente

nme opengl fixes, samples working

Nicolas Cannasse 11 anni fa
parent
commit
cf949ae987

+ 6 - 1
h3d/impl/GlDriver.hx

@@ -615,8 +615,13 @@ class GlDriver extends Driver {
 
 	static var FACES = [
 		0,
-		GL.FRONT, // front/back reversed wrt stage3d
+		#if js
+		GL.FRONT, // front/back reversed in WebGL
+		GL.BACK,
+		#else
 		GL.BACK,
+		GL.FRONT,
+		#end
 		GL.FRONT_AND_BACK,
 	];
 

+ 12 - 1
h3d/pass/Params.hx

@@ -2,6 +2,17 @@ package h3d.pass;
 
 class Params {
 
-	public static var shadowShader : hxsl.Shader = new h3d.shader.Shadow();
+	@:isVar public static var shadowShader(get, set) : hxsl.Shader;
+
+	// delay initialization if needed only
+	static function get_shadowShader() {
+		var s = shadowShader;
+		if( s == null ) shadowShader = s = new h3d.shader.Shadow();
+		return s;
+	}
+
+	static function set_shadowShader(s) {
+		return shadowShader = s;
+	}
 
 }

+ 7 - 0
samples/lights/lights.hxml

@@ -9,3 +9,10 @@
 -dce full
 -main Main
 -lib heaps
+--next
+-cpp bin
+-dce full
+-main Main
+-lib heaps
+-lib nme
+--remap flash:nme

+ 1 - 1
samples/lights/lights.hxproj

@@ -24,7 +24,7 @@
     <option noInlineOnDebug="False" />
     <option mainClass="Main" />
     <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf lights.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:1024:60&#xA;-dce full&#xA;-main Main&#xA;-lib heaps" />
+    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf lights.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:1024:60&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;&#xA;--next&#xA;-cpp bin&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;-lib nme&#xA;--remap flash:nme" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>

+ 7 - 0
samples/shadows/shadows.hxml

@@ -9,3 +9,10 @@
 -swf-version 11.8
 -swf-header 1024:768:60
 -main Main
+--next
+-cpp bin
+-dce full
+-main Main
+-lib heaps
+-lib nme
+--remap flash:nme

+ 1 - 1
samples/shadows/shadows.hxproj

@@ -24,7 +24,7 @@
     <option noInlineOnDebug="False" />
     <option mainClass="Main" />
     <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf shadows.swf&#xA;-lib heaps&#xA;-dce full&#xA;-swf-version 11.8&#xA;-swf-header 1024:768:60&#xA;-main Main" />
+    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf shadows.swf&#xA;-lib heaps&#xA;-dce full&#xA;-swf-version 11.8&#xA;-swf-header 1024:768:60&#xA;-main Main&#xA;&#xA;--next&#xA;-cpp bin&#xA;-dce full&#xA;-main Main&#xA;-lib heaps&#xA;-lib nme&#xA;--remap flash:nme" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>

+ 7 - 0
samples/skin/skin.hxml

@@ -9,3 +9,10 @@
 -main Main
 -lib heaps
 -dce full
+--next
+-cpp bin
+-main Main
+-lib heaps
+-lib nme
+--remap flash:nme
+-debug

+ 1 - 1
samples/skin/skin.hxproj

@@ -24,7 +24,7 @@
     <option noInlineOnDebug="False" />
     <option mainClass="Main" />
     <option enabledebug="False" />
-    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf skin.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:900:60&#xA;-main Main&#xA;-lib heaps&#xA;-dce full" />
+    <option additional="-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-swf skin.swf&#xA;-swf-version 11.8&#xA;-swf-header 1280:900:60&#xA;-main Main&#xA;-lib heaps&#xA;-dce full&#xA;&#xA;--next&#xA;-cpp bin&#xA;-main Main&#xA;-lib heaps&#xA;-lib nme&#xA;--remap flash:nme&#xA;-debug" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>