-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lighting sample works on both Web and Kinc.
- Loading branch information
1 parent
f6d4bc4
commit a7ecb72
Showing
13 changed files
with
198 additions
and
98 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "tools/krafix"] | ||
path = tools/krafix | ||
url = https://github.com/Kode/krafix_bin | ||
[submodule "tools/KincTools_linux_x64"] | ||
path = tools/KincTools_linux_x64 | ||
url = https://github.com/Kode/KincTools_linux_x64 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,60 @@ | ||
import sys.thread.Thread; | ||
|
||
function main() { | ||
trace("Hello World!"); | ||
Thread.create(() -> { | ||
trace("thread"); | ||
throw "Hello?"; | ||
}); | ||
// hl.Api.breakPoint(); | ||
Thread.current().events.repeat(() -> {}, 5); | ||
} | ||
using Test; | ||
|
||
class Test { | ||
static function main() { | ||
trace("Haxe is great!"); | ||
trace("foo\nbar".lines().filter(s -> s != "foo").collect()); | ||
} | ||
|
||
static function lines(s:String):Iterator<String> { | ||
return s.split("\n").iterator(); // TODO: bad! should be a lazy iter! | ||
} | ||
|
||
static function filter<T>(i:Iterator<T>, fn:T->Bool):Iterator<T> { | ||
return new FilterIter(i, fn); | ||
} | ||
|
||
static function collect<T>(iter:Iterator<T>):Array<T> { | ||
return [for (i in iter) i]; | ||
} | ||
} | ||
|
||
class FilterIter<T> { | ||
var inner:Iterator<T>; | ||
var fn:T->Bool; | ||
|
||
var _hasNext:Bool = false; | ||
var _next:T = null; | ||
|
||
public inline function new(i:Iterator<T>, fn:T->Bool) { | ||
inner = i; | ||
this.fn = fn; | ||
while (inner.hasNext()) { | ||
var n = inner.next(); | ||
if (fn(n)) { | ||
_hasNext = true; | ||
_next = n; | ||
break; | ||
} | ||
} | ||
} | ||
|
||
public inline function hasNext():Bool { | ||
return _hasNext; | ||
} | ||
|
||
public inline function next():Null<T> { | ||
var ret = if (_hasNext) _next else null; | ||
_hasNext = false; | ||
_next = null; | ||
while (inner.hasNext()) { | ||
var n = inner.next(); | ||
if (fn(n)) { | ||
_hasNext = true; | ||
_next = n; | ||
break; | ||
} | ||
} | ||
return ret; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
-cp samples | ||
-cp samples/light | ||
-cp src | ||
-cp test | ||
-main Texture | ||
-main Light | ||
-lib kinc | ||
-lib format | ||
|
||
|
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
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
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
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
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
Oops, something went wrong.