Skip to content

Commit

Permalink
Improve developer experience – code formatting, linting & editor config
Browse files Browse the repository at this point in the history
  • Loading branch information
Reece Lucas committed May 29, 2018
1 parent d018770 commit b3be3b1
Show file tree
Hide file tree
Showing 78 changed files with 10,969 additions and 4,859 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
@@ -0,0 +1,14 @@
# http://EditorConfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion .eslintrc.json
Expand Up @@ -25,6 +25,6 @@
"error",
"always"
],
"no-console":0
"no-console": 0
}
}
14 changes: 13 additions & 1 deletion .gitignore
@@ -1,2 +1,14 @@
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Map files
*.map

# Project dependencies
node_modules
test_area
10 changes: 10 additions & 0 deletions .prettierrc
@@ -0,0 +1,10 @@
{
"useTabs": false,
"printWidth": 100,
"tabWidth": 4,
"singleQuote": false,
"trailingComma": "none",
"bracketSpacing": true,
"parser": "babylon",
"semi": true
}
1,770 changes: 919 additions & 851 deletions dist/videocontext.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/videocontext.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/api/DestinationNode.html
Expand Up @@ -49,7 +49,7 @@ <h4 class="name" id="DestinationNode"><span class="type-signature"></span>new De


<div class="description">
<p>Initialise an instance of a DestinationNode. </p>
<p>Initialise an instance of a DestinationNode.</p>
<p>There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.</p>
<p>You should not instantiate this directly.</p>
</div>
Expand Down Expand Up @@ -180,7 +180,7 @@ <h4 class="name" id="DestinationNode"><span class="type-signature"></span>new De


<div class="description">
<p>Initialise an instance of a DestinationNode. </p>
<p>Initialise an instance of a DestinationNode.</p>
<p>There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.</p>
<p>You should not instantiate this directly.</p>
</div>
Expand Down
46 changes: 29 additions & 17 deletions docs/api/DestinationNode_destinationnode.js.html
Expand Up @@ -31,15 +31,15 @@ <h1 class="page-title">Source: DestinationNode/destinationnode.js</h1>

class DestinationNode extends ProcessingNode {
/**
* Initialise an instance of a DestinationNode.
*
* There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.
*
* You should not instantiate this directly.
*/
constructor(gl, renderGraph){

let vertexShader = "\
* Initialise an instance of a DestinationNode.
*
* There should only be a single instance of a DestinationNode per VideoContext instance. An VideoContext's destination can be accessed like so: videoContext.desitnation.
*
* You should not instantiate this directly.
*/
constructor(gl, renderGraph) {
let vertexShader =
"\
attribute vec2 a_position;\
attribute vec2 a_texCoord;\
varying vec2 v_texCoord;\
Expand All @@ -48,7 +48,8 @@ <h1 class="page-title">Source: DestinationNode/destinationnode.js</h1>
v_texCoord = a_texCoord;\
}";

let fragmentShader = "\
let fragmentShader =
"\
precision mediump float;\
uniform sampler2D u_image;\
varying vec2 v_texCoord;\
Expand All @@ -57,31 +58,42 @@ <h1 class="page-title">Source: DestinationNode/destinationnode.js</h1>
gl_FragColor = texture2D(u_image, v_texCoord);\
}";

let deffinition = {fragmentShader:fragmentShader, vertexShader:vertexShader, properties:{}, inputs:["u_image"]};
let deffinition = {
fragmentShader: fragmentShader,
vertexShader: vertexShader,
properties: {},
inputs: ["u_image"]
};

super(gl, renderGraph, deffinition, deffinition.inputs, false);
this._displayName = "DestinationNode";
}

_render(){
let gl = this._gl;
_render() {
let gl = this._gl;

gl.bindFramebuffer(gl.FRAMEBUFFER, null);
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
gl.enable(gl.BLEND);
gl.clearColor(0, 0, 0, 0.0); // green;
gl.clear(gl.COLOR_BUFFER_BIT);

this.inputs.forEach((node)=>{
this.inputs.forEach(node => {
super._render();
//map the input textures input the node
var texture = node._texture;
let textureOffset = 0;

for(let mapping of this._inputTextureUnitMapping ){
for (let mapping of this._inputTextureUnitMapping) {
gl.activeTexture(mapping.textureUnit);
let textureLocation = gl.getUniformLocation(this._program, mapping.name);
gl.uniform1i(textureLocation, this._parameterTextureCount + textureOffset);
let textureLocation = gl.getUniformLocation(
this._program,
mapping.name
);
gl.uniform1i(
textureLocation,
this._parameterTextureCount + textureOffset
);
textureOffset += 1;
gl.bindTexture(gl.TEXTURE_2D, texture);
}
Expand Down
18 changes: 9 additions & 9 deletions docs/api/GraphNode.html
Expand Up @@ -185,7 +185,7 @@ <h4 class="name" id="destroyed"><span class="type-signature"></span>destroyed<sp

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line72">line 72</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line76">line 76</a>
</li></ul></dd>


Expand Down Expand Up @@ -247,7 +247,7 @@ <h4 class="name" id="displayName"><span class="type-signature"></span>displayNam

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line24">line 24</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line25">line 25</a>
</li></ul></dd>


Expand Down Expand Up @@ -309,7 +309,7 @@ <h4 class="name" id="inputNames"><span class="type-signature"></span>inputNames<

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line33">line 33</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line35">line 35</a>
</li></ul></dd>


Expand Down Expand Up @@ -371,7 +371,7 @@ <h4 class="name" id="inputs"><span class="type-signature"></span>inputs<span cla

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line52">line 52</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line54">line 54</a>
</li></ul></dd>


Expand Down Expand Up @@ -433,7 +433,7 @@ <h4 class="name" id="maximumConnections"><span class="type-signature"></span>max

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line42">line 42</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line44">line 44</a>
</li></ul></dd>


Expand Down Expand Up @@ -495,7 +495,7 @@ <h4 class="name" id="outputs"><span class="type-signature"></span>outputs<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line63">line 63</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line67">line 67</a>
</li></ul></dd>


Expand Down Expand Up @@ -670,7 +670,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line84">line 84</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line87">line 87</a>
</li></ul></dd>


Expand Down Expand Up @@ -756,7 +756,7 @@ <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line107">line 107</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line116">line 116</a>
</li></ul></dd>


Expand Down Expand Up @@ -903,7 +903,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line94">line 94</a>
<a href="graphnode.js.html">graphnode.js</a>, <a href="graphnode.js.html#line101">line 101</a>
</li></ul></dd>


Expand Down
28 changes: 14 additions & 14 deletions docs/api/ProcessingNode.html
Expand Up @@ -94,7 +94,7 @@ <h4 class="name" id="ProcessingNode"><span class="type-signature"></span>new Pro

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line12">line 12</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line17">line 17</a>
</li></ul></dd>


Expand Down Expand Up @@ -200,7 +200,7 @@ <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line142">line 142</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line216">line 216</a>
</li></ul></dd>


Expand Down Expand Up @@ -286,7 +286,7 @@ <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line142">line 142</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line216">line 216</a>
</li></ul></dd>


Expand Down Expand Up @@ -421,7 +421,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line135">line 135</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line209">line 209</a>
</li></ul></dd>


Expand Down Expand Up @@ -563,7 +563,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line135">line 135</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line209">line 209</a>
</li></ul></dd>


Expand Down Expand Up @@ -728,7 +728,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line121">line 121</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line195">line 195</a>
</li></ul></dd>


Expand Down Expand Up @@ -893,7 +893,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line121">line 121</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line195">line 195</a>
</li></ul></dd>


Expand Down Expand Up @@ -1014,7 +1014,7 @@ <h4 class="name" id="ProcessingNode"><span class="type-signature"></span>new Pro

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line12">line 12</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line17">line 17</a>
</li></ul></dd>


Expand Down Expand Up @@ -1120,7 +1120,7 @@ <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line142">line 142</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line216">line 216</a>
</li></ul></dd>


Expand Down Expand Up @@ -1206,7 +1206,7 @@ <h4 class="name" id="destroy"><span class="type-signature"></span>destroy<span c

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line142">line 142</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line216">line 216</a>
</li></ul></dd>


Expand Down Expand Up @@ -1341,7 +1341,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line135">line 135</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line209">line 209</a>
</li></ul></dd>


Expand Down Expand Up @@ -1483,7 +1483,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line135">line 135</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line209">line 209</a>
</li></ul></dd>


Expand Down Expand Up @@ -1648,7 +1648,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line121">line 121</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line195">line 195</a>
</li></ul></dd>


Expand Down Expand Up @@ -1813,7 +1813,7 @@ <h5>Parameters:</h5>

<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line121">line 121</a>
<a href="ProcessingNodes_processingnode.js.html">ProcessingNodes/processingnode.js</a>, <a href="ProcessingNodes_processingnode.js.html#line195">line 195</a>
</li></ul></dd>


Expand Down

0 comments on commit b3be3b1

Please sign in to comment.