littlejsengine 1.11.13 → 1.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/littlejs.d.ts +1418 -109
- package/dist/littlejs.esm.js +3495 -581
- package/dist/littlejs.esm.min.js +1 -1
- package/dist/littlejs.js +3258 -399
- package/dist/littlejs.min.js +1 -1
- package/dist/littlejs.release.js +3147 -379
- package/examples/box2d/game.js +73 -45
- package/examples/box2d/gameObjects.js +96 -92
- package/examples/box2d/index.html +2 -7
- package/examples/box2d/scenes.js +82 -92
- package/examples/breakout/game.js +62 -30
- package/examples/breakout/gameObjects.js +45 -47
- package/examples/breakout/index.html +1 -5
- package/examples/breakoutTutorial/game.js +36 -29
- package/examples/breakoutTutorial/index.html +1 -3
- package/examples/empty/game.js +5 -2
- package/examples/empty/index.html +1 -3
- package/examples/htmlMenu/game.js +25 -19
- package/examples/htmlMenu/index.html +5 -7
- package/examples/index.html +2 -3
- package/examples/module/game.js +32 -34
- package/examples/module/index.html +1 -1
- package/examples/particles/index.html +27 -22
- package/examples/platformer/game.js +71 -48
- package/examples/platformer/gameCharacter.js +42 -34
- package/examples/platformer/gameEffects.js +82 -75
- package/examples/platformer/gameLevel.js +67 -38
- package/examples/platformer/{gameLevelData.js → gameLevelData.json} +1 -11
- package/examples/platformer/gameObjects.js +70 -64
- package/examples/platformer/gamePlayer.js +12 -7
- package/examples/platformer/index.html +1 -9
- package/examples/puzzle/game.js +58 -42
- package/examples/puzzle/index.html +1 -3
- package/examples/shorts/base.html +2 -2
- package/examples/shorts/particles.js +1 -1
- package/examples/shorts/platformer.js +1 -1
- package/examples/shorts/tileLayer.js +5 -6
- package/examples/shorts/tiles.png +0 -0
- package/examples/starter/build.js +4 -4
- package/examples/starter/game.js +9 -12
- package/examples/starter/index.html +13 -13
- package/examples/stress/index.html +44 -43
- package/examples/typescript/build.js +17 -18
- package/examples/typescript/game.js +32 -34
- package/examples/typescript/game.ts +32 -34
- package/examples/typescript/index.html +1 -1
- package/examples/uiSystem/game.js +33 -36
- package/examples/uiSystem/index.html +1 -5
- package/package.json +3 -3
- package/plugins/box2d.js +1556 -640
- package/plugins/{Box2D_v2.3.1_min.wasm.js → box2d.wasm.js} +1 -1
- package/plugins/newgrounds.js +7 -8
- package/plugins/pluginExport.js +50 -0
- package/plugins/postProcess.js +94 -93
- package/plugins/uiSystem.js +145 -161
- package/plugins/zzfxm.js +163 -0
- package/reference.md +29 -27
- package/src/engine.js +15 -20
- package/src/engineAudio.js +74 -204
- package/src/engineBuild.js +29 -4
- package/src/engineDebug.js +105 -9
- package/src/engineDraw.js +27 -14
- package/src/engineExport.js +12 -8
- package/src/engineInput.js +3 -1
- package/src/engineObject.js +18 -14
- package/src/engineParticles.js +6 -1
- package/src/engineRelease.js +6 -1
- package/src/engineSettings.js +8 -8
- package/src/engineTileLayer.js +179 -96
- package/src/engineUtilities.js +5 -11
- package/src/engineWebGL.js +19 -7
- package/examples/starter/build/index.html +0 -2
- package/examples/starter/build/index.js +0 -1
- package/examples/starter/build/tiles.png +0 -0
- package/examples/starter/game.zip +0 -0
- package/examples/typescript/build/dist/littlejs.esm.js +0 -4834
- package/examples/typescript/build/examples/typescript/build.js +0 -24
- package/examples/typescript/build/examples/typescript/game.js +0 -102
- /package/plugins/{Box2D_v2.3.1_min.wasm.wasm → box2d.wasm.wasm} +0 -0
|
@@ -15,7 +15,7 @@ a.noExitRuntime&&(noExitRuntime=a.noExitRuntime);"object"!==typeof WebAssembly&&
|
|
|
15
15
|
function wa(b,c,d){var f=c+d;for(d=c;b[d]&&!(d>=f);)++d;if(16<d-c&&b.subarray&&va)return va.decode(b.subarray(c,d));for(f="";c<d;){var y=b[c++];if(y&128){var oa=b[c++]&63;if(192==(y&224))f+=String.fromCharCode((y&31)<<6|oa);else{var ya=b[c++]&63;y=224==(y&240)?(y&15)<<12|oa<<6|ya:(y&7)<<18|oa<<12|ya<<6|b[c++]&63;65536>y?f+=String.fromCharCode(y):(y-=65536,f+=String.fromCharCode(55296|y>>10,56320|y&1023))}}else f+=String.fromCharCode(y)}return f}function xa(b){return b?wa(za,b,void 0):""}
|
|
16
16
|
var Aa,za,Ba,Ca;function Da(b){Aa=b;a.HEAP8=new Int8Array(b);a.HEAP16=new Int16Array(b);a.HEAP32=Ba=new Int32Array(b);a.HEAPU8=za=new Uint8Array(b);a.HEAPU16=new Uint16Array(b);a.HEAPU32=new Uint32Array(b);a.HEAPF32=new Float32Array(b);a.HEAPF64=Ca=new Float64Array(b)}var Ea=a.INITIAL_MEMORY||16777216;if(sa=a.wasmMemory?a.wasmMemory:new WebAssembly.Memory({initial:Ea/65536,maximum:32768}))Aa=sa.buffer;Ea=Aa.byteLength;Da(Aa);Ba[6512]=5269088;
|
|
17
17
|
function Fa(b){for(;0<b.length;){var c=b.shift();if("function"==typeof c)c(a);else{var d=c.ev;"number"===typeof d?void 0===c.Au?a.dynCall_v(d):a.dynCall_vi(d,c.Au):d(void 0===c.Au?null:c.Au)}}}var Ga=[],Ha=[],Ia=[],Ja=[],Ka=!1;function La(){var b=a.preRun.shift();Ga.unshift(b)}var Ma=0,Na=null,Oa=null;a.preloadedImages={};a.preloadedAudios={};
|
|
18
|
-
function na(b){if(a.onAbort)a.onAbort(b);b+="";pa(b);qa(b);ua=!0;throw new WebAssembly.RuntimeError("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");}function Pa(b){var c=Qa;return String.prototype.startsWith?c.startsWith(b):0===c.indexOf(b)}function Ra(){return Pa("data:application/octet-stream;base64,")}var Qa="
|
|
18
|
+
function na(b){if(a.onAbort)a.onAbort(b);b+="";pa(b);qa(b);ua=!0;throw new WebAssembly.RuntimeError("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");}function Pa(b){var c=Qa;return String.prototype.startsWith?c.startsWith(b):0===c.indexOf(b)}function Ra(){return Pa("data:application/octet-stream;base64,")}var Qa="box2d.wasm.wasm";if(!Ra()){var Sa=Qa;Qa=a.locateFile?a.locateFile(Sa,ia):ia+Sa}
|
|
19
19
|
function Ta(){try{if(ra)return new Uint8Array(ra);if(ka)return ka(Qa);throw"both async and sync fetching of the wasm failed";}catch(b){na(b)}}function Ua(){return ra||!da&&!ea||"function"!==typeof fetch||Pa("file://")?new Promise(function(b){b(Ta())}):fetch(Qa,{credentials:"same-origin"}).then(function(b){if(!b.ok)throw"failed to load wasm binary file at '"+Qa+"'";return b.arrayBuffer()}).catch(function(){return Ta()})}
|
|
20
20
|
var Va={1156:function(b,c){b=a.getCache(a.JSDestructionListener)[b];if(!b.hasOwnProperty("SayGoodbyeJoint"))throw"a JSImplementation must implement all functions, you forgot JSDestructionListener::SayGoodbyeJoint.";b.SayGoodbyeJoint(c)},1414:function(b,c){b=a.getCache(a.JSDestructionListener)[b];if(!b.hasOwnProperty("SayGoodbyeFixture"))throw"a JSImplementation must implement all functions, you forgot JSDestructionListener::SayGoodbyeFixture.";b.SayGoodbyeFixture(c)},1840:function(b,c){b=a.getCache(a.JSQueryCallback)[b];
|
|
21
21
|
if(!b.hasOwnProperty("ReportFixture"))throw"a JSImplementation must implement all functions, you forgot JSQueryCallback::ReportFixture.";return b.ReportFixture(c)},2104:function(b,c,d,f,y){b=a.getCache(a.JSRayCastCallback)[b];if(!b.hasOwnProperty("ReportFixture"))throw"a JSImplementation must implement all functions, you forgot JSRayCastCallback::ReportFixture.";return b.ReportFixture(c,d,f,y)},2400:function(b,c){b=a.getCache(a.JSContactListener)[b];if(!b.hasOwnProperty("BeginContact"))throw"a JSImplementation must implement all functions, you forgot JSContactListener::BeginContact.";
|
package/plugins/newgrounds.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LittleJS Newgrounds API
|
|
3
3
|
* - NewgroundsMedal extends Medal with Newgrounds API functionality
|
|
4
|
-
* - Call
|
|
4
|
+
* - Call new NewgroundsPlugin() to setup Newgrounds
|
|
5
5
|
* - Uses CryptoJS for encryption if optional cipher is provided
|
|
6
6
|
* - Keeps connection alive and logs views
|
|
7
7
|
* - Functions to interact with scoreboards
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
13
|
/** Global Newgrounds object
|
|
14
|
-
* @type {
|
|
14
|
+
* @type {NewgroundsPlugin}
|
|
15
15
|
* @memberof Medal */
|
|
16
16
|
let newgrounds;
|
|
17
17
|
|
|
18
18
|
///////////////////////////////////////////////////////////////////////////////
|
|
19
19
|
/**
|
|
20
20
|
* Newgrounds medal auto unlocks in newgrounds API
|
|
21
|
-
* Particle Emitter - Spawns particles with the given settings
|
|
22
21
|
* @extends Medal
|
|
23
22
|
*/
|
|
24
23
|
class NewgroundsMedal extends Medal
|
|
@@ -45,7 +44,7 @@ class NewgroundsMedal extends Medal
|
|
|
45
44
|
/**
|
|
46
45
|
* Newgrounds API object
|
|
47
46
|
*/
|
|
48
|
-
class
|
|
47
|
+
class NewgroundsPlugin
|
|
49
48
|
{
|
|
50
49
|
/** Create the global newgrounds object
|
|
51
50
|
* @param {string} app_id - The newgrounds App ID
|
|
@@ -54,7 +53,7 @@ class Newgrounds
|
|
|
54
53
|
* @example
|
|
55
54
|
* // create the newgrounds object, replace the app id with your own
|
|
56
55
|
* const app_id = 'your_app_id_here';
|
|
57
|
-
* new
|
|
56
|
+
* new NewgroundsPlugin(app_id);
|
|
58
57
|
*/
|
|
59
58
|
constructor(app_id, cipher, cryptoJS)
|
|
60
59
|
{
|
|
@@ -102,8 +101,8 @@ class Newgrounds
|
|
|
102
101
|
this.scoreboards = scoreboardResult ? scoreboardResult.result.data.scoreboards : [];
|
|
103
102
|
debugMedals && console.log(this.scoreboards);
|
|
104
103
|
|
|
105
|
-
// keep the session alive with a ping every
|
|
106
|
-
const keepAliveMS =
|
|
104
|
+
// keep the session alive with a ping every minute
|
|
105
|
+
const keepAliveMS = 60 * 1e3;
|
|
107
106
|
setInterval(()=>this.call('Gateway.ping', 0, true), keepAliveMS);
|
|
108
107
|
}
|
|
109
108
|
|
|
@@ -175,4 +174,4 @@ class Newgrounds
|
|
|
175
174
|
debugMedals && console.log(xmlHttp.responseText);
|
|
176
175
|
return xmlHttp.responseText && JSON.parse(xmlHttp.responseText);
|
|
177
176
|
}
|
|
178
|
-
}
|
|
177
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* LittleJS Module Plugins Export
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export
|
|
6
|
+
{
|
|
7
|
+
// Newgrounds
|
|
8
|
+
newgrounds,
|
|
9
|
+
NewgroundsPlugin,
|
|
10
|
+
NewgroundsMedal,
|
|
11
|
+
|
|
12
|
+
// Post Process
|
|
13
|
+
postProcess,
|
|
14
|
+
PostProcessPlugin,
|
|
15
|
+
|
|
16
|
+
// ZzFXMusic
|
|
17
|
+
ZzFXMusic,
|
|
18
|
+
|
|
19
|
+
// UI System
|
|
20
|
+
uiSystem,
|
|
21
|
+
UISystemPlugin,
|
|
22
|
+
UIObject,
|
|
23
|
+
UIText,
|
|
24
|
+
UITile,
|
|
25
|
+
UIButton,
|
|
26
|
+
UICheckbox,
|
|
27
|
+
UIScrollbar,
|
|
28
|
+
|
|
29
|
+
// Box2D Physics
|
|
30
|
+
box2d,
|
|
31
|
+
box2dDebug,
|
|
32
|
+
box2dSetDebug,
|
|
33
|
+
box2dEngineInit,
|
|
34
|
+
Box2dPlugin,
|
|
35
|
+
Box2dObject,
|
|
36
|
+
Box2dRaycastResult,
|
|
37
|
+
Box2dJoint,
|
|
38
|
+
Box2dTargetJoint,
|
|
39
|
+
Box2dDistanceJoint,
|
|
40
|
+
Box2dPinJoint,
|
|
41
|
+
Box2dRopeJoint,
|
|
42
|
+
Box2dRevoluteJoint,
|
|
43
|
+
Box2dGearJoint,
|
|
44
|
+
Box2dPrismaticJoint,
|
|
45
|
+
Box2dWheelJoint,
|
|
46
|
+
Box2dWeldJoint,
|
|
47
|
+
Box2dFrictionJoint,
|
|
48
|
+
Box2dPulleyJoint,
|
|
49
|
+
Box2dMotorJoint,
|
|
50
|
+
};
|
package/plugins/postProcess.js
CHANGED
|
@@ -1,115 +1,116 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* LittleJS Post Processing Plugin
|
|
3
3
|
* - Supports shadertoy style post processing shaders
|
|
4
|
-
* - call
|
|
5
|
-
*
|
|
4
|
+
* - call new new PostProcessPlugin() to setup post processing
|
|
5
|
+
* - can be enabled to pass other canvases through a final shader
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
10
|
///////////////////////////////////////////////////////////////////////////////
|
|
11
|
-
// post processing - can be enabled to pass other canvases through a final shader
|
|
12
11
|
|
|
13
|
-
/**
|
|
14
|
-
* @type {
|
|
15
|
-
|
|
16
|
-
let glPostShader;
|
|
12
|
+
/** Global Post Process plugin object
|
|
13
|
+
* @type {PostProcessPlugin} */
|
|
14
|
+
let postProcess;
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
|
|
16
|
+
/////////////////////////////////////////////////////////////////////////
|
|
17
|
+
/**
|
|
18
|
+
* UI System Global Object
|
|
19
|
+
*/
|
|
20
|
+
class PostProcessPlugin
|
|
21
|
+
{
|
|
22
|
+
/** Create global post processing shader
|
|
23
|
+
* @param {string} shaderCode
|
|
24
|
+
* @param {boolean} [includeOverlay]
|
|
25
|
+
* @example
|
|
26
|
+
* // create the post process plugin object
|
|
27
|
+
* new PostProcessPlugin(shaderCode);
|
|
28
|
+
*/
|
|
29
|
+
constructor(shaderCode, includeOverlay=false)
|
|
30
|
+
{
|
|
31
|
+
ASSERT(!postProcess, 'Post process already initialized');
|
|
32
|
+
postProcess = this;
|
|
22
33
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let glPostIncludeOverlay;
|
|
34
|
+
if (headlessMode) return;
|
|
35
|
+
if (!shaderCode) // default shader pass through
|
|
36
|
+
shaderCode = 'void mainImage(out vec4 c,vec2 p){c=texture(iChannel0,p/iResolution.xy);}';
|
|
27
37
|
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
/** @property {WebGLProgram} - Shader for post processing */
|
|
39
|
+
this.shader = glCreateProgram(
|
|
40
|
+
'#version 300 es\n' + // specify GLSL ES version
|
|
41
|
+
'precision highp float;'+ // use highp for better accuracy
|
|
42
|
+
'in vec2 p;'+ // position
|
|
43
|
+
'void main(){'+ // shader entry point
|
|
44
|
+
'gl_Position=vec4(p+p-1.,1,1);'+ // set position
|
|
45
|
+
'}' // end of shader
|
|
46
|
+
,
|
|
47
|
+
'#version 300 es\n' + // specify GLSL ES version
|
|
48
|
+
'precision highp float;'+ // use highp for better accuracy
|
|
49
|
+
'uniform sampler2D iChannel0;'+ // input texture
|
|
50
|
+
'uniform vec3 iResolution;'+ // size of output texture
|
|
51
|
+
'uniform float iTime;'+ // time
|
|
52
|
+
'out vec4 c;'+ // out color
|
|
53
|
+
'\n' + shaderCode + '\n'+ // insert custom shader code
|
|
54
|
+
'void main(){'+ // shader entry point
|
|
55
|
+
'mainImage(c,gl_FragCoord.xy);'+ // call post process function
|
|
56
|
+
'c.a=1.;'+ // always use full alpha
|
|
57
|
+
'}' // end of shader
|
|
58
|
+
);
|
|
39
59
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
'#version 300 es\n' + // specify GLSL ES version
|
|
43
|
-
'precision highp float;'+ // use highp for better accuracy
|
|
44
|
-
'in vec2 p;'+ // position
|
|
45
|
-
'void main(){'+ // shader entry point
|
|
46
|
-
'gl_Position=vec4(p+p-1.,1,1);'+ // set position
|
|
47
|
-
'}' // end of shader
|
|
48
|
-
,
|
|
49
|
-
'#version 300 es\n' + // specify GLSL ES version
|
|
50
|
-
'precision highp float;'+ // use highp for better accuracy
|
|
51
|
-
'uniform sampler2D iChannel0;'+ // input texture
|
|
52
|
-
'uniform vec3 iResolution;'+ // size of output texture
|
|
53
|
-
'uniform float iTime;'+ // time
|
|
54
|
-
'out vec4 c;'+ // out color
|
|
55
|
-
'\n' + shaderCode + '\n'+ // insert custom shader code
|
|
56
|
-
'void main(){'+ // shader entry point
|
|
57
|
-
'mainImage(c,gl_FragCoord.xy);'+ // call post process function
|
|
58
|
-
'c.a=1.;'+ // always use full alpha
|
|
59
|
-
'}' // end of shader
|
|
60
|
-
);
|
|
60
|
+
/** @property {WebGLTexture} - Texture for post processing */
|
|
61
|
+
this.texture = glCreateTexture();
|
|
61
62
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
glPostIncludeOverlay = includeOverlay;
|
|
63
|
+
/** @property {boolean} - Should overlay canvas be included in post processing */
|
|
64
|
+
this.includeOverlay = includeOverlay;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
if (headlessMode) return;
|
|
71
|
-
|
|
72
|
-
// prepare to render post process shader
|
|
73
|
-
if (glEnable)
|
|
66
|
+
// Render the post processing shader, called automatically by the engine
|
|
67
|
+
engineAddPlugin(undefined, postProcessRender);
|
|
68
|
+
function postProcessRender()
|
|
74
69
|
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
70
|
+
if (headlessMode) return;
|
|
71
|
+
|
|
72
|
+
// prepare to render post process shader
|
|
73
|
+
if (glEnable)
|
|
74
|
+
{
|
|
75
|
+
glFlush(); // clear out the buffer
|
|
76
|
+
mainContext.drawImage(glCanvas, 0, 0); // copy to the main canvas
|
|
77
|
+
}
|
|
78
|
+
else
|
|
79
|
+
{
|
|
80
|
+
// set the viewport
|
|
81
|
+
glContext.viewport(0, 0, glCanvas.width = mainCanvas.width, glCanvas.height = mainCanvas.height);
|
|
82
|
+
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
84
|
+
if (postProcess.includeOverlay)
|
|
85
|
+
{
|
|
86
|
+
// copy overlay canvas so it will be included in post processing
|
|
87
|
+
mainContext.drawImage(overlayCanvas, 0, 0);
|
|
88
|
+
overlayCanvas.width |= 0;
|
|
89
|
+
}
|
|
90
90
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
91
|
+
// setup shader program to draw one triangle
|
|
92
|
+
glContext.useProgram(postProcess.shader);
|
|
93
|
+
glContext.bindBuffer(glContext.ARRAY_BUFFER, glGeometryBuffer);
|
|
94
|
+
glContext.pixelStorei(glContext.UNPACK_FLIP_Y_WEBGL, 1);
|
|
95
|
+
glContext.disable(glContext.BLEND);
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
97
|
+
// set textures, pass in the 2d canvas and gl canvas in separate texture channels
|
|
98
|
+
glContext.activeTexture(glContext.TEXTURE0);
|
|
99
|
+
glContext.bindTexture(glContext.TEXTURE_2D, postProcess.texture);
|
|
100
|
+
glContext.texImage2D(glContext.TEXTURE_2D, 0, glContext.RGBA, glContext.RGBA, glContext.UNSIGNED_BYTE, mainCanvas);
|
|
101
101
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
// set vertex position attribute
|
|
103
|
+
const vertexByteStride = 8;
|
|
104
|
+
const pLocation = glContext.getAttribLocation(postProcess.shader, 'p');
|
|
105
|
+
glContext.enableVertexAttribArray(pLocation);
|
|
106
|
+
glContext.vertexAttribPointer(pLocation, 2, glContext.FLOAT, false, vertexByteStride, 0);
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
108
|
+
// set uniforms and draw
|
|
109
|
+
const uniformLocation = (name)=>glContext.getUniformLocation(postProcess.shader, name);
|
|
110
|
+
glContext.uniform1i(uniformLocation('iChannel0'), 0);
|
|
111
|
+
glContext.uniform1f(uniformLocation('iTime'), time);
|
|
112
|
+
glContext.uniform3f(uniformLocation('iResolution'), mainCanvas.width, mainCanvas.height, 1);
|
|
113
|
+
glContext.drawArrays(glContext.TRIANGLE_STRIP, 0, 4);
|
|
114
|
+
}
|
|
114
115
|
}
|
|
115
|
-
}
|
|
116
|
+
}
|