Updating the random indexes to work on mobile. Todo:Try all the shaders and find the best ones.
This commit is contained in:
@@ -80,7 +80,11 @@ class Main {
|
|||||||
#end //if !mobile
|
#end //if !mobile
|
||||||
|
|
||||||
//The maximum time to spend on a shader example before cycling
|
//The maximum time to spend on a shader example before cycling
|
||||||
|
#if !mobile
|
||||||
private static var maxTime = 2;
|
private static var maxTime = 2;
|
||||||
|
#else
|
||||||
|
private static var maxTime = 5;
|
||||||
|
#end
|
||||||
|
|
||||||
//The current active shader example in the list
|
//The current active shader example in the list
|
||||||
private var currentIndex:Int;
|
private var currentIndex:Int;
|
||||||
@@ -114,12 +118,16 @@ class Main {
|
|||||||
var time = haxe.Timer.stamp() - startTime;
|
var time = haxe.Timer.stamp() - startTime;
|
||||||
if (time > maxTime && fragmentShaders.length > 1) {
|
if (time > maxTime && fragmentShaders.length > 1) {
|
||||||
|
|
||||||
//Pick a random example to show
|
#if !mobile
|
||||||
if( include_slow_expensive_examples ) {
|
//Pick a random example to show
|
||||||
|
if( include_slow_expensive_examples ) {
|
||||||
|
currentIndex = Std.random( fragmentShaders.length - 1 );
|
||||||
|
} else {
|
||||||
|
currentIndex = slow_end_index + next ;
|
||||||
|
}
|
||||||
|
#else
|
||||||
currentIndex = Std.random( fragmentShaders.length - 1 );
|
currentIndex = Std.random( fragmentShaders.length - 1 );
|
||||||
} else {
|
#end
|
||||||
currentIndex = slow_end_index + Std.random( (fragmentShaders.length - slow_end_index - 1) );
|
|
||||||
}
|
|
||||||
|
|
||||||
compile ();
|
compile ();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user