Skip to content

Commit

Permalink
Comment out ellipsis in code blocks (mdn#18498)
Browse files Browse the repository at this point in the history
  • Loading branch information
OnkarRuikar authored Jul 19, 2022
1 parent 32823e7 commit 302ccec
Show file tree
Hide file tree
Showing 30 changed files with 43 additions and 45 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ None ({{jsxref("undefined")}}).
```js
var transformFeedback = gl.createTransformFeedback();

// ...
//

gl.deleteTransformFeedback(transformFeedback);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ None ({{jsxref("undefined")}}).
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
//

gl.deleteVertexArray(vao);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ None ({{jsxref("undefined")}}).
var query = gl.createQuery();
gl.beginQuery(gl.ANY_SAMPLES_PASSED, query);

// ...
//

gl.endQuery(gl.ANY_SAMPLES_PASSED);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A {{domxref("WebGL_API/Types", "GLboolean")}} indicating whether the given objec
```js
var query = gl.createQuery();

// ...
//

gl.isQuery(query);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A {{domxref("WebGL_API/Types", "GLboolean")}} indicating whether the given objec
```js
var sampler = gl.createSampler();

// ...
//

gl.isSampler(sampler);
```
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/webgl2renderingcontext/issync/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ objects are not available in WebGL 1.
```js
var sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);

// ...
//

gl.isSync(sync);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ A {{domxref("WebGL_API/Types", "GLboolean")}} indicating whether the given objec
```js
var transformFeedback = gl.createTransformFeedback();

// ...
//

gl.isTransformFeedback(transformFeedback);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A {{domxref("WebGL_API/Types", "GLboolean")}} indicating whether the given objec
var vao = gl.createVertexArray();
gl.bindVertexArray(vao);

// ...
//

gl.isVertexArray(vao);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var transformFeedback = gl.createTransformFeedback();
gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback);
gl.beginTransformFeedback(gl.TRIANGLES);
gl.pauseTransformFeedback();
//...
//
gl.resumeTransformFeedback();
gl.drawArrays(gl.TRIANGLES, 0, 3);
gl.endTransformFeedback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var transformFeedback = gl.createTransformFeedback();
gl.bindTransformFeedback(gl.TRANSFORM_FEEDBACK, transformFeedback);
gl.beginTransformFeedback(gl.TRIANGLES);
gl.pauseTransformFeedback();
//...
//
gl.resumeTransformFeedback();
gl.drawArrays(gl.TRIANGLES, 0, 3);
gl.endTransformFeedback();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ A really easy way to start using a matrix is to use the CSS {{cssxref("transform
```html
<div id='move-me' class='transformable'>
<h2>Move me with a matrix</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit...</p>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit</p>
</div>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Since we've added a z-component to our vertices, we need to update the `numCompo
// buffer into the vertexPosition attribute
{
const numComponents = 3;
// ...
//
gl.vertexAttribPointer(
programInfo.attribLocations.vertexPosition,
numComponents,
Expand Down Expand Up @@ -157,7 +157,7 @@ Next we need to add code to our `drawScene()` function to draw using the cube's
// Tell WebGL which indices to use to index the vertices
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, buffers.indices);

// ...
//

{
const vertexCount = 36;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The first thing we need to do is generate the array of normals for all the verti
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertexNormals),
gl.STATIC_DRAW);

// ...
//

return {
position: positionBuffer,
Expand Down Expand Up @@ -135,7 +135,7 @@ Finally, we need to update the code that builds the uniform matrices to generate
mat4.invert(normalMatrix, modelViewMatrix);
mat4.transpose(normalMatrix, normalMatrix);

// ...
//

gl.uniformMatrix4fv(
programInfo.uniformLocations.normalMatrix,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ Let's say we want to render a gradient in which each corner of the square is a d

```js
function initBuffers(){
// ...
const colors = [
1.0, 1.0, 1.0, 1.0, // white
1.0, 0.0, 0.0, 1.0, // red
Expand Down Expand Up @@ -100,8 +99,7 @@ Next, it's necessary to add code to look up the attribute location for the color
vertexPosition: gl.getAttribLocation(shaderProgram, 'aVertexPosition'),
vertexColor: gl.getAttribLocation(shaderProgram, 'aVertexColor'),
},
// ...
}
//
```
Then, `drawScene()` can have the following added to it so it actually uses these colors when drawing the square:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ At this point, the texture is loaded and ready to use. But before we can use it,
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(textureCoordinates),
gl.STATIC_DRAW);

// ...
//
return {
position: positionBuffer,
textureCoord: textureCoordBuffer,
Expand Down Expand Up @@ -265,9 +265,9 @@ Lastly, add `texture` as a parameter to the `drawScene()` function, both where i

```js
drawScene(gl, programInfo, buffers, texture, deltaTime);
// ...
//
function drawScene(gl, programInfo, buffers, texture, deltaTime) {
// ...
//
}
```

Expand Down
16 changes: 8 additions & 8 deletions files/en-us/web/api/webgl_api/webgl_best_practices/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -443,21 +443,21 @@ Most texture uploads from DOM elements will incur a processing pass that will te
In WebGL:

```
...
useProgram(prog1)
<pipeline flush>
bindFramebuffer(target)
drawArrays()
bindTexture(webgl_texture)
texImage2D(HTMLVideoElement)
drawArrays()
...
```

Behind the scenes in the browser:

```
...
useProgram(prog1)
<pipeline flush>
bindFramebuffer(target)
Expand All @@ -474,15 +474,15 @@ Behind the scenes in the browser:
+useProgram(prog1)
<pipeline flush>
drawArrays()
...
```

Prefer doing uploads before starting drawing, or at least between pipelines:

In WebGL:

```
...
bindTexture(webgl_texture)
texImage2D(HTMLVideoElement)
useProgram(prog1)
Expand All @@ -491,13 +491,13 @@ In WebGL:
drawArrays()
bindTexture(webgl_texture)
drawArrays()
...
```

Behind the scenes in the browser:

```
...
bindTexture(webgl_texture)
-texImage2D(HTMLVideoElement):
+useProgram(_internal_tex_tranform_prog)
Expand All @@ -513,7 +513,7 @@ Behind the scenes in the browser:
drawArrays()
bindTexture(webgl_texture)
drawArrays()
...
```

## Use texStorage to create textures
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ None.
## Examples

```js
// let firsts = new Int32Array(...);
// let counts = new Int32Array(...);
// let instanceCounts = new Int32Array(...);
const firsts = new Int32Array(/**/);
const counts = new Int32Array(/**/);
const instanceCounts = new Int32Array(/**/);
ext.multiDrawArraysInstancedWEBGL(
gl.TRIANGLES, firsts, 0, counts, 0, instanceCounts, 0, firsts.length);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var framebuffer = gl.createFramebuffer();

// ...
//

gl.checkFramebufferStatus(gl.FRAMEBUFFER);
```
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/webglrenderingcontext/commit/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var htmlCanvas = document.createElement('canvas');
var offscreen = htmlCanvas.transferControlToOffscreen();
var gl = offscreen.getContext('webgl');

// ... some drawing using the gl context ...
// Perform some drawing using the gl context

// Push frames back to the original HTMLCanvasElement
gl.commit();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var buffer = gl.createBuffer();

// ...
//

gl.deleteBuffer(buffer);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var framebuffer = gl.createFramebuffer();

// ...
//

gl.deleteFramebuffer(framebuffer);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var program = gl.createProgram();

// ...
//

gl.deleteProgram(program);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var renderbuffer = gl.createRenderbuffer();

// ...
//

gl.deleteRenderbuffer(renderbuffer);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var texture = gl.createTexture();

// ...
//

gl.deleteTexture(texture);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var canvas = document.getElementById('canvas');
gl = canvas.getContext('webgl');

var extensions = gl.getSupportedExtensions();
// Array [ 'ANGLE_instanced_arrays', 'EXT_blend_minmax', ... ]
// Array [ 'ANGLE_instanced_arrays', 'EXT_blend_minmax', ]
```

See also the {{domxref("WebGLRenderingContext.getExtension()")}} method to get a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var program = gl.createProgram();

// ...
//

gl.isProgram(program);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var canvas = document.getElementById('canvas');
var gl = canvas.getContext('webgl');
var shader = gl.createShader(gl.VERTEX_SHADER);

// ...
//

gl.isShader(shader);
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Now our users can make a call, but they can't answer one. Let's add the next pie
- `call.answer(window.localStream)`: if `answerCall` is `true`, you'll want to call peerJS's `answer()` function on the call to create an answer, passing it the local stream.
- `showCallContent`: Similar to what you did in the call button event listener, you want to ensure the person being called sees the correct HTML content.
- Everything in the `call.on('stream', function(){...}` block is exactly the same as it is in call button's event listener. The reason you need to add it here too is so that the browser is also updated for the person answering the call.
- Everything in the `call.on('stream', function(){ }` block is exactly the same as it is in call button's event listener. The reason you need to add it here too is so that the browser is also updated for the person answering the call.
- If the person denies the call, we're just going to log a message to the console.
3. The code you have now is enough for you to create a call and answer it. Refresh your browsers and test it out. You'll want to make sure that both browsers have the console open or else you won't get the prompt to answer the call. Click call, submit the peer ID for the other browser and then answer the call. The final page should look like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ You've nearly finished! The last thing you want to do is ensure your callers hav
})
```

2. When the connection has been closed, you also want to display the correct HTML content so you can just call your `showCallContent()` function. Within the `call` event, you also want to ensure the remote browser is updated. To achieve this, add another event listener within the `peer.on('call', function(stream){...}` event listener, within the conditional block.
2. When the connection has been closed, you also want to display the correct HTML content so you can just call your `showCallContent()` function. Within the `call` event, you also want to ensure the remote browser is updated. To achieve this, add another event listener within the `peer.on('call', function(stream){ }` event listener, within the conditional block.
```js
conn.on('close', function (){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ When the user clicks on a username they want to call, the `invite()` function is
```js
const mediaConstraints = {
audio: true, // We want an audio track
video: true // ...and we want a video track
video: true // And we want a video track
};

function invite(evt) {
Expand Down

0 comments on commit 302ccec

Please sign in to comment.