Bladeren bron

fixed Texture.fromPixels : should use pixels format unless explicit set to another format

Nicolas Cannasse 4 jaren geleden
bovenliggende
commit
78fe510a7c
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      h3d/mat/Texture.hx

+ 2 - 2
h3d/mat/Texture.hx

@@ -414,8 +414,8 @@ class Texture {
 		return t;
 		return t;
 	}
 	}
 
 
-	public static function fromPixels( pixels : hxd.Pixels ) {
-		var t = new Texture(pixels.width, pixels.height);
+	public static function fromPixels( pixels : hxd.Pixels, ?format ) {
+		var t = new Texture(pixels.width, pixels.height, null, format != null ? format : pixels.format);
 		t.uploadPixels(pixels);
 		t.uploadPixels(pixels);
 		return t;
 		return t;
 	}
 	}