This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import js.Browser; | |
import js.html.StyleElement; | |
import js.html.DivElement; | |
import js.html.BodyElement; | |
import js.html.CSSStyleDeclaration; | |
class Main{ | |
public static function main(){ | |
var body: BodyElement = cast Browser.document.body; | |
var doc = js.Browser.window.document; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package justTrianglesDemo; | |
import js.Browser; | |
import khaMath.Matrix4; | |
import justTrianglesDemo.WebGLDrawing; | |
import justTriangles.Triangle; | |
import justTriangles.Draw; | |
import justTriangles.Point; | |
import justTriangles.ShapePoints; | |
import htmlHelper.tools.CSSEnterFrame; | |
@:enum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package justTrianglesDemo; | |
import js.Browser; | |
import khaMath.Matrix4; | |
import justTrianglesDemo.WebGLDrawing; | |
import justTriangles.Triangle; | |
import justTriangles.Draw; | |
import justTriangles.Point; | |
import justTriangles.PathContext; | |
import justTriangles.ShapePoints; | |
import htmlHelper.tools.CSSEnterFrame; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if poly2trihx | |
import org.poly2tri.SweepContext; | |
import org.poly2tri.Sweep; | |
//import org.poly2tri.Point; | |
#end | |
#if poly2trihx | |
var sweepContext = new SweepContext(); | |
var sweep = new Sweep( sweepContext ); | |
var p: Point; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static var nearest = [10,12,14,15,16,18,20,21,24,25,28,30,32,35,36,40,42,48,50,56,60,64,70,72,75,80,84,90,100]; | |
public static var divider = [5,6,7,3,8,6,5,7,6,5,7,5,8,7,6,8,7,6,5,7,6,8,7,6,5,8,7,6,5]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@:enum | |
abstract OutType( Int ) { | |
var tagOut = 0; | |
var attOut = 1; | |
var contentOut = 2; | |
var nullOut = 4; | |
} | |
class Main { static public function main():Void { new Main(); } | |
public function new(){ | |
trace( haxe.Resource.getString("sample") ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import js.html.Float32Array; | |
import js.html.CanvasElement; | |
import js.html.webgl.RenderingContext; | |
import js.html.webgl.Program; | |
import js.html.webgl.Shader; | |
import js.html.webgl.Texture; | |
import js.html.webgl.Framebuffer; | |
import js.Browser; | |
import js.html.Uint16Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package; | |
import js.html.Float32Array; | |
import js.html.CanvasElement; | |
import js.html.webgl.RenderingContext; | |
import js.html.webgl.Program; | |
import js.html.webgl.Shader; | |
import js.html.webgl.Texture; | |
import js.html.webgl.Framebuffer; | |
import js.Browser; | |
import js.html.Uint16Array; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reset( gl: RenderingContext ): RenderingContext { | |
var numAttribs = gl.getParameter( RenderingContext.MAX_VERTEX_ATTRIBS ); | |
var tmp = gl.createBuffer(); | |
gl.bindBuffer( RenderingContext.ARRAY_BUFFER, tmp ); | |
for( ii in 0...numAttribs ){ | |
gl.disableVertexAttribArray( ii ); | |
gl.vertexAttribPointer(ii, 4, RenderingContext.FLOAT, false, 0, 0 ); | |
gl.vertexAttrib1f( ii, 0 ); | |
} | |
gl.deleteBuffer( tmp ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To add target to Haxe compiler, general theory. | |
1) Adjust main.ml and globals.ml with the language keyword as per example diffs. | |
2) Add a language folder to std folder, with subfolder _std Populate ideally with base Array etc.. implementations and add the haxe/ds and sys packages. | |
3) Add a gentarget.ml file to the generators folder that does the heavy work of converting haxe AST to target code. |
OlderNewer