Commits

Anonymous committed f4dd74d Draft

init

Comments (0)

Files changed (16)

nme-stage3d-hello-cube/Assets/haxe-logo.png

Added
New image

nme-stage3d-hello-cube/Assets/insanity-wolf.jpg

Added
New image

nme-stage3d-hello-cube/Assets/nme.svg

+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
+<g transform="scale(.125,.125)">
+	<rect fill="#F05A22" width="256" height="256"/>
+	<rect x="198.4" y="89.6" fill="#FCB813" width="57.6" height="25.601"/>
+	<rect x="198.4" y="115.2" fill="#FFF100" width="57.6" height="25.601"/>
+	<rect x="198.4" y="140.801" fill="#FCB813" width="57.6" height="25.6"/>
+	<polygon fill="#FCB813" points="0,89.6 76.801,166.4 102.4,166.4 102.4,140.801 51.201,89.6 	"/>
+	<polygon fill="#FFF100" points="189.439,104.96 153.6,140.801 153.6,166.4 189.439,166.4 	"/>
+	<polygon fill="#FCB813" points="153.6,89.6 189.439,89.6 189.439,104.96 153.6,140.801 128,115.2 	"/>
+	<polygon fill="#FFF100" points="0,89.6 35.841,125.441 35.841,166.4 0,166.4 	"/>
+	<polygon fill="#FFF100" points="102.4,89.6 76.801,89.6 76.801,115.2 128,166.4 153.6,140.801 	"/>
+</g>
+</svg>

nme-stage3d-hello-cube/Assets/rock-smooth.jpg

Added
New image

nme-stage3d-hello-cube/Source/Main.hx

+package;
+
+import flash.geom.Vector3D;
+import nme.display.BitmapData;
+import nme.display3D.textures.Texture;
+import nme.events.Event;
+import nme.events.ErrorEvent;
+import nme.display.Sprite;
+
+import nme.display3D.IndexBuffer3D;
+import nme.display3D.shaders.glsl.GLSLFragmentShader;
+import nme.display3D.shaders.glsl.GLSLVertexShader;
+import nme.display3D.shaders.glsl.GLSLProgram;
+import nme.display3D.VertexBuffer3D;
+import nme.display3D.Context3DTextureFormat;
+import nme.display3D.Context3DBlendFactor;
+import nme.display3D.Context3DCompareMode;
+import nme.display3D.Context3DTriangleFace;
+
+using nme.geom.Matrix3D;
+
+using nme.Vector;
+using nme.display3D.Context3DUtils;
+
+class Main extends Sprite {
+
+
+    var stage3D:nme.display.Stage3D;
+    var context3D:flash.display3D.Context3D;
+
+    var vertexBuffer:VertexBuffer3D;
+    var indexBuffer:IndexBuffer3D;
+    var glslProgram:GLSLProgram;
+
+    var texture1:Texture;
+    var texture2:Texture;
+    var texture3:Texture;
+    var textures:Array<Texture>;
+
+
+    public function new() {
+
+        super();
+
+        addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
+//        addChild(new nme.display.FPS(0,0,0xffffff));
+
+    }
+
+    function onAddedToStage(event:Event):Void {
+        nme.Lib.current.stage.align = nme.display.StageAlign.TOP_LEFT;
+        nme.Lib.current.stage.scaleMode = nme.display.StageScaleMode.NO_SCALE;
+
+        stage3D = stage.stage3Ds[0];
+        stage3D.addEventListener(Event.CONTEXT3D_CREATE, onReady);
+        stage3D.addEventListener(ErrorEvent.ERROR, onError);
+        stage.addEventListener(Event.RESIZE, onResize);
+        stage3D.requestContext3D();
+    }
+
+    function onError(event:ErrorEvent):Void {
+        trace(event);
+    }
+
+
+    function onResize(_) {
+        if (context3D != null) {
+            context3D.configureBackBuffer(nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, false);
+        }
+    }
+
+    function onReady(_) {
+        context3D = stage3D.context3D;
+        context3D.configureBackBuffer(nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, false);
+        context3D.enableErrorChecking = true;
+
+        createProgram();
+
+        var vertices:Array<Float> = [
+
+// Front face
+        -1.0, -1.0,  1.0,  0, 0,
+         1.0, -1.0,  1.0,  1, 0,
+         1.0,  1.0,  1.0,  1, 1,
+        -1.0,  1.0,  1.0,  0, 1,
+
+// Back face
+        -1.0, -1.0, -1.0,  0, 0,
+        -1.0,  1.0, -1.0,  1, 0,
+         1.0,  1.0, -1.0,  1, 1,
+         1.0, -1.0, -1.0,  0, 1,
+
+// Top face
+        -1.0,  1.0, -1.0,  0, 0,
+        -1.0,  1.0,  1.0,  1, 0,
+         1.0,  1.0,  1.0,  1, 1,
+         1.0,  1.0, -1.0,  0, 1,
+
+// Bottom face
+        -1.0, -1.0, -1.0,  0, 0,
+         1.0, -1.0, -1.0,  1, 0,
+         1.0, -1.0,  1.0,  1, 1,
+        -1.0, -1.0,  1.0,  0, 1,
+
+// Right face
+        1.0, -1.0, -1.0,  0, 0,
+        1.0,  1.0, -1.0,  1, 0,
+        1.0,  1.0,  1.0,  1, 1,
+        1.0, -1.0,  1.0,  0, 1,
+
+// Left face
+        -1.0, -1.0, -1.0,  0, 0,
+        -1.0, -1.0,  1.0,  1, 0,
+        -1.0,  1.0,  1.0,  1, 1,
+        -1.0,  1.0, -1.0,  0, 1
+        ];
+
+
+//TODO deal with this in some way ? (note : can use ByteArray instead)
+        var indices:Array<#if flash UInt #else Int #end> = [
+        0,  1,  2,      0,  2,  3,    // front
+        4,  5,  6,      4,  6,  7,    // back
+        8,  9,  10,     8,  10, 11,   // top
+        12, 13, 14,     12, 14, 15,   // bottom
+        16, 17, 18,     16, 18, 19,   // right
+        20, 21, 22,     20, 22, 23    // left
+        ];
+
+        var vCount:Int = Std.int(vertices.length / 5);
+        vertexBuffer = context3D.createVertexBuffer(vCount, 5);
+        vertexBuffer.uploadFromVector(Vector.ofArray(vertices), 0, vCount);
+
+        var idxCount:Int = indices.length;
+        indexBuffer = context3D.createIndexBuffer(idxCount);
+        indexBuffer.uploadFromVector(Vector.ofArray(indices), 0, idxCount);
+
+        texture1 = createTexture("assets/insanity-wolf.jpg");
+        texture2 = createTexture("assets/rock-smooth.jpg");
+        texture3 = createTexture("assets/haxe-logo.png");
+        textures= [texture1,texture2,texture3];
+
+        context3D.setRenderCallback(update);
+    }
+
+    private function createTexture(assetName:String):Texture {
+        var bitmapData = nme.Assets.getBitmapData(assetName);
+        var texture = context3D.createTexture(bitmapData.width, bitmapData.height, Context3DTextureFormat.BGRA, false);
+        texture.uploadFromBitmapData(bitmapData);
+        return texture;
+    }
+
+    private function createProgram():Void {
+
+        glslProgram = new GLSLProgram(context3D);
+
+        var vertexShaderSource =
+
+        "
+        attribute vec3 vertexPosition;
+        attribute vec2 texCoord;
+
+        uniform mat4 mvpMatrix;
+
+        varying vec2 texture_coordinate;
+
+        void main(void) {
+            gl_Position = mvpMatrix * vec4(vertexPosition, 1.0);
+            texture_coordinate = texCoord;
+        }
+        ";
+
+        var vertexShader = new GLSLVertexShader(vertexShaderSource);
+
+
+        var fragmentShaderSource =
+#if !desktop
+        "precision mediump float;" +
+#end
+        "
+        uniform sampler2D colorTexture;
+        varying vec2 texture_coordinate;
+
+        void main(void) {
+            gl_FragColor = texture2D(colorTexture, texture_coordinate);
+        }
+        ";
+
+        var fragmentShader = new GLSLFragmentShader(fragmentShaderSource);
+
+        glslProgram.upload(vertexShader, fragmentShader);
+
+    }
+
+    var r1:Float = 0;
+    var r2:Float = 0;
+
+    function update() {
+
+        var positionX = nme.Lib.stage.stageWidth / (textures.length+1);
+        var positionY = nme.Lib.stage.stageHeight / 2;
+
+        var projectionMatrix = createOrtho(0, nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, 1000, -1000);
+        var modelViewMatrix = new Matrix3D();
+        modelViewMatrix.appendRotation(r1, new Vector3D(1,0,0,0));
+        modelViewMatrix.appendRotation(r2, new Vector3D(0,1,0,0));
+        modelViewMatrix.appendRotation(r2, new Vector3D(0,0,1,0));
+        modelViewMatrix.appendScale(100,100,100);
+        modelViewMatrix.appendTranslation(positionX, positionY, 100);
+
+        context3D.clear(0, 0, 0, 1.0, 1);
+        context3D.setBlendFactors(Context3DBlendFactor.SOURCE_ALPHA, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA);
+        context3D.setCulling(Context3DTriangleFace.BACK);
+        context3D.setDepthTest(true, Context3DCompareMode.GREATER_EQUAL);
+
+        glslProgram.attach();
+        glslProgram.setVertexBufferAt("vertexPosition", vertexBuffer, 0, nme.display3D.Context3DVertexBufferFormat.FLOAT_3);
+        glslProgram.setVertexBufferAt("texCoord", vertexBuffer, 3, nme.display3D.Context3DVertexBufferFormat.FLOAT_2);
+
+        for(texture in textures){
+            var mvpMatrix = modelViewMatrix.clone();
+            mvpMatrix.append(projectionMatrix);
+            glslProgram.setVertexUniformFromMatrix("mvpMatrix", mvpMatrix, true);
+            glslProgram.setTextureAt("colorTexture", texture);
+            context3D.drawTriangles(indexBuffer);
+            modelViewMatrix.appendTranslation(positionX, 0, 0) ;
+        }
+
+        context3D.present();
+        r1 += 0.2;
+        r2 += 0.4;
+
+    }
+
+
+    public static function create2D(x:Float, y:Float, scale:Float = 1, rotation:Float = 0):Matrix3D {
+//        #if (cpp || neko || js)
+//            return Matrix3D.create2D(x,y,scale,rotation);
+//        #else
+
+
+        var theta = rotation * Math.PI / 180.0;
+        var c = Math.cos(theta);
+        var s = Math.sin(theta);
+
+        return new Matrix3D(Vector.ofArray([
+        c * scale, -s * scale, 0, 0,
+        s * scale, c * scale, 0, 0,
+        0, 0, 1, 0,
+        x, y, 0, 1
+        ]));
+
+//        #end
+
+    }
+
+    // TODO fix me некорректно работает под flash для координаты z
+    public static function createOrtho(x0:Float, x1:Float, y0:Float, y1:Float, zNear:Float, zFar:Float):Matrix3D {
+//#if (cpp || neko || js)
+//            return Matrix3D.createOrtho(x0,x1,y0,y1,zNear,zFar);
+//        #else
+        var sx = 1.0 / (x1 - x0);
+        var sy = 1.0 / (y1 - y0);
+        var sz = 1.0 / (zFar - zNear);
+
+        return new Matrix3D(Vector.ofArray([
+        2.0 * sx, 0, 0, 0,
+        0, 2.0 * sy, 0, 0,
+        0, 0, -2.0 * sz, 0,
+        -(x0 + x1) * sx, -(y0 + y1) * sy, -(zNear + zFar) * sz, 1,
+        ]));
+//#end
+
+    }
+
+
+}

nme-stage3d-hello-cube/agalminiassembler.swf

Binary file added.

nme-stage3d-hello-cube/glsl2agal.swf

Binary file added.

nme-stage3d-hello-cube/project.nmml

+<?xml version="1.0" encoding="utf-8"?>
+<project>
+	
+	<meta title="Stage3D Test Hello Cube!" package="io.nme.samples.stage3dtesthellocube" version="1.0.0" company="NME" />
+	<app main="Main" path="Export" file="Stage3DTestHelloCube" />
+    <window require-shaders="true" orientation="landscape"/>
+
+	<source path="Source" />
+
+    <!-- TODO add this only if you use glsl2agal directive -->
+    <haxeflag name="-swf-lib" value="glsl2agal.swf" if="flash" />
+    <haxedef name="glsl2agal" if="flash" />
+
+    <haxeflag name="-swf-lib" value="agalminiassembler.swf" if="flash" />
+
+    <!-- HXCPP DEBUGGING -->
+    <haxedef name="HXCPP_DEBUG_LINK" />
+    <haxedef name="DHXCPP_STACK_TRACE" />
+    <haxedef name="HXCPP_STACK_LINE" />
+    <haxedef name="HXCPP_CHECK_POINTER" />
+    <haxedef name="HXCPP_DEBUGGER" />
+    <haxedef name="stage3d" />
+	
+	<haxelib name="nme" />
+
+	<assets path="Assets" rename="assets" exclude="nme.svg" />
+	<icon path="Assets/nme.svg" />
+	
+</project>

nme-stage3d-hello-quad/Assets/haxe-logo.png

Added
New image

nme-stage3d-hello-quad/Assets/insanity-wolf.jpg

Added
New image

nme-stage3d-hello-quad/Assets/nme.svg

+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" id="Ebene_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 width="32px" height="32px" viewBox="0 0 32 32" enable-background="new 0 0 32 32" xml:space="preserve">
+<g transform="scale(.125,.125)">
+	<rect fill="#F05A22" width="256" height="256"/>
+	<rect x="198.4" y="89.6" fill="#FCB813" width="57.6" height="25.601"/>
+	<rect x="198.4" y="115.2" fill="#FFF100" width="57.6" height="25.601"/>
+	<rect x="198.4" y="140.801" fill="#FCB813" width="57.6" height="25.6"/>
+	<polygon fill="#FCB813" points="0,89.6 76.801,166.4 102.4,166.4 102.4,140.801 51.201,89.6 	"/>
+	<polygon fill="#FFF100" points="189.439,104.96 153.6,140.801 153.6,166.4 189.439,166.4 	"/>
+	<polygon fill="#FCB813" points="153.6,89.6 189.439,89.6 189.439,104.96 153.6,140.801 128,115.2 	"/>
+	<polygon fill="#FFF100" points="0,89.6 35.841,125.441 35.841,166.4 0,166.4 	"/>
+	<polygon fill="#FFF100" points="102.4,89.6 76.801,89.6 76.801,115.2 128,166.4 153.6,140.801 	"/>
+</g>
+</svg>

nme-stage3d-hello-quad/Assets/rock-smooth.jpg

Added
New image

nme-stage3d-hello-quad/Source/Main.hx

+package;
+
+import nme.display.BitmapData;
+import nme.display3D.textures.Texture;
+import nme.events.Event;
+import nme.events.ErrorEvent;
+import nme.display.Sprite;
+
+import nme.display3D.IndexBuffer3D;
+import nme.display3D.shaders.glsl.GLSLFragmentShader;
+import nme.display3D.shaders.glsl.GLSLVertexShader;
+import nme.display3D.shaders.glsl.GLSLProgram;
+import nme.display3D.VertexBuffer3D;
+import nme.display3D.Context3DTextureFormat;
+import nme.display3D.Context3DBlendFactor;
+
+using nme.geom.Matrix3D;
+
+using nme.Vector;
+using nme.display3D.Context3DUtils;
+
+class Main extends Sprite {
+
+
+    var stage3D:nme.display.Stage3D;
+    var context3D:flash.display3D.Context3D;
+
+    var vertexBuffer:VertexBuffer3D;
+    var indexBuffer:IndexBuffer3D;
+    var glslProgram:GLSLProgram;
+
+    var texture1:Texture;
+    var texture2:Texture;
+    var texture3:Texture;
+    var textures:Array<Texture>;
+
+
+    public function new() {
+
+        super();
+
+        addEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
+//        addChild(new nme.display.FPS(0,0,0xffffff));
+
+    }
+
+    function onAddedToStage(event:Event):Void {
+        nme.Lib.current.stage.align = nme.display.StageAlign.TOP_LEFT;
+        nme.Lib.current.stage.scaleMode = nme.display.StageScaleMode.NO_SCALE;
+
+        stage3D = stage.stage3Ds[0];
+        stage3D.addEventListener(Event.CONTEXT3D_CREATE, onReady);
+        stage3D.addEventListener(ErrorEvent.ERROR, onError);
+        stage.addEventListener(Event.RESIZE, onResize);
+        stage3D.requestContext3D();
+    }
+
+    function onError(event:ErrorEvent):Void {
+        trace(event);
+    }
+
+
+    function onResize(_) {
+        if (context3D != null) {
+            context3D.configureBackBuffer(nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, false);
+        }
+    }
+
+    function onReady(_) {
+        context3D = stage3D.context3D;
+        context3D.configureBackBuffer(nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, false);
+        context3D.enableErrorChecking = true;
+
+        createProgram();
+
+        var vertices:Array<Float> = [
+
+        50.0, 50.0, 0.0, 1.0, 1.0,
+        -50, 50.0, 0.0, 0.0, 1.0,
+        50.0, -50, 0.0, 1.0, 0.0,
+        -50.0, -50.0, 0.0, 0.0, 0.0
+
+        ];
+
+
+//TODO deal with this in some way ? (note : can use ByteArray instead)
+        var indices:Array<#if flash UInt #else Int #end> = [0, 1, 2, 2, 3, 1];
+
+        vertexBuffer = context3D.createVertexBuffer(4, 5);
+        vertexBuffer.uploadFromVector(Vector.ofArray(vertices), 0, 4);
+
+        indexBuffer = context3D.createIndexBuffer(6);
+        indexBuffer.uploadFromVector(Vector.ofArray(indices), 0, 6);
+
+        texture1 = createTexture("assets/insanity-wolf.jpg");
+        texture2 = createTexture("assets/rock-smooth.jpg");
+        texture3 = createTexture("assets/haxe-logo.png");
+        textures= [texture1,texture2,texture3];
+
+        context3D.setRenderCallback(update);
+    }
+
+    private function createTexture(assetName:String):Texture {
+        var bitmapData = nme.Assets.getBitmapData(assetName);
+        var texture = context3D.createTexture(bitmapData.width, bitmapData.height, Context3DTextureFormat.BGRA, false);
+        texture.uploadFromBitmapData(bitmapData);
+        return texture;
+    }
+
+    private function createProgram():Void {
+
+        glslProgram = new GLSLProgram(context3D);
+
+        var vertexShaderSource =
+
+        "
+        attribute vec3 vertexPosition;
+        attribute vec2 texCoord;
+
+        uniform mat4 mvpMatrix;
+
+        varying vec2 texture_coordinate;
+
+        void main(void) {
+            gl_Position = mvpMatrix * vec4(vertexPosition, 1.0);
+            texture_coordinate = texCoord;
+        }
+        ";
+
+        var vertexShader = new GLSLVertexShader(vertexShaderSource);
+
+
+        var fragmentShaderSource =
+#if !desktop
+        "precision mediump float;" +
+#end
+        "
+        uniform sampler2D colorTexture;
+        varying vec2 texture_coordinate;
+
+        void main(void) {
+            gl_FragColor = texture2D(colorTexture, texture_coordinate);
+        }
+        ";
+
+        var fragmentShader = new GLSLFragmentShader(fragmentShaderSource);
+
+        glslProgram.upload(vertexShader, fragmentShader);
+
+    }
+
+    var r:Float = 0;
+
+    function update() {
+
+        var positionX = nme.Lib.stage.stageWidth / 2;
+        var positionY = nme.Lib.stage.stageHeight / 2;
+
+        var projectionMatrix = createOrtho(0, nme.Lib.stage.stageWidth, nme.Lib.stage.stageHeight, 0, 1000, -1000);
+        var modelViewMatrix = create2D(positionX, positionY, 1, r);
+        r += 0.1;
+        var mvpMatrix = modelViewMatrix.clone();
+        mvpMatrix.append(projectionMatrix);
+
+        context3D.clear(0, 0, 0, 1.0);
+        context3D.setBlendFactors(Context3DBlendFactor.SOURCE_ALPHA, Context3DBlendFactor.ONE_MINUS_SOURCE_ALPHA);
+
+        glslProgram.attach();
+        glslProgram.setVertexBufferAt("vertexPosition", vertexBuffer, 0, nme.display3D.Context3DVertexBufferFormat.FLOAT_3);
+        glslProgram.setVertexBufferAt("texCoord", vertexBuffer, 3, nme.display3D.Context3DVertexBufferFormat.FLOAT_2);
+
+        for(texture in textures){
+            glslProgram.setVertexUniformFromMatrix("mvpMatrix", mvpMatrix, true);
+            glslProgram.setTextureAt("colorTexture", texture);
+            context3D.drawTriangles(indexBuffer);
+            mvpMatrix.appendTranslation(0.15, 0, 0) ;
+        }
+
+        context3D.present();
+
+    }
+
+
+    public static function create2D(x:Float, y:Float, scale:Float = 1, rotation:Float = 0):Matrix3D {
+#if (cpp || neko || js)
+            return Matrix3D.create2D(x,y,scale,rotation);
+        #else
+
+
+        var theta = rotation * Math.PI / 180.0;
+        var c = Math.cos(theta);
+        var s = Math.sin(theta);
+
+        return new Matrix3D(Vector.ofArray([
+        c * scale, -s * scale, 0, 0,
+        s * scale, c * scale, 0, 0,
+        0, 0, 1, 0,
+        x, y, 0, 1
+        ]));
+
+#end
+
+    }
+
+
+    public static function createOrtho(x0:Float, x1:Float, y0:Float, y1:Float, zNear:Float, zFar:Float):Matrix3D {
+#if (cpp || neko || js)
+            return Matrix3D.createOrtho(x0,x1,y0,y1,zNear,zFar);
+        #else
+        var sx = 1.0 / (x1 - x0);
+        var sy = 1.0 / (y1 - y0);
+        var sz = 1.0 / (zFar - zNear);
+
+        return new Matrix3D(Vector.ofArray([
+        2.0 * sx, 0, 0, 0,
+        0, 2.0 * sy, 0, 0,
+        0, 0, -2.0 * sz, 0,
+        -(x0 + x1) * sx, -(y0 + y1) * sy, -(zNear + zFar) * sz, 1,
+        ]));
+#end
+
+    }
+
+
+}

nme-stage3d-hello-quad/agalminiassembler.swf

Binary file added.

nme-stage3d-hello-quad/glsl2agal.swf

Binary file added.

nme-stage3d-hello-quad/project.nmml

+<?xml version="1.0" encoding="utf-8"?>
+<project>
+	
+	<meta title="Stage3D Test Hello Quad!" package="io.nme.samples.stage3dtesthelloquad" version="1.0.0" company="NME" />
+	<app main="Main" path="Export" file="Stage3DTestHelloQuad" />
+    <window require-shaders="true" />
+
+	<source path="Source" />
+
+    <!-- TODO add this only if you use glsl2agal directive -->
+    <haxeflag name="-swf-lib" value="glsl2agal.swf" if="flash" />
+    <haxedef name="glsl2agal" if="flash" />
+
+    <haxeflag name="-swf-lib" value="agalminiassembler.swf" if="flash" />
+
+    <!-- HXCPP DEBUGGING -->
+    <haxedef name="HXCPP_DEBUG_LINK" />
+    <haxedef name="DHXCPP_STACK_TRACE" />
+    <haxedef name="HXCPP_STACK_LINE" />
+    <haxedef name="HXCPP_CHECK_POINTER" />
+    <haxedef name="HXCPP_DEBUGGER" />
+    <haxedef name="stage3d" />
+	
+	<haxelib name="nme" />
+
+	<assets path="Assets" rename="assets" exclude="nme.svg" />
+	<icon path="Assets/nme.svg" />
+	
+</project>