Skip to content

Commit

Permalink
build
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Mar 25, 2022
1 parent b35e44a commit 05807c5
Show file tree
Hide file tree
Showing 14 changed files with 114 additions and 29 deletions.
1 change: 1 addition & 0 deletions dist/4.x/twgl-full.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type AttachmentOptions = TextureOptions & {
format?: number;
type?: number;
target?: number;
samples?: number;
level?: number;
layer?: number;
attachment?: WebGLRenderbuffer | WebGLTexture;
Expand Down
23 changes: 18 additions & 5 deletions dist/4.x/twgl-full.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/4.x/twgl-full.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/4.x/twgl-full.min.js

Large diffs are not rendered by default.

21 changes: 16 additions & 5 deletions dist/4.x/twgl-full.module.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* @license twgl.js 4.21.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
/* @license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details */
/*
Expand Down Expand Up @@ -8898,6 +8898,7 @@ const LINEAR$1 = 0x2601;
* @property {number} [type] The type. Used for texture. Default = `gl.UNSIGNED_BYTE`.
* @property {number} [target] The texture target for `gl.framebufferTexture2D`.
* Defaults to `gl.TEXTURE_2D`. Set to appropriate face for cube maps.
* @property {number} [samples] The number of samples. Default = 1
* @property {number} [level] level for `gl.framebufferTexture2D`. Defaults to 0.
* @property {number} [layer] layer for `gl.framebufferTextureLayer`. Defaults to undefined.
* If set then `gl.framebufferTextureLayer` is called, if not then `gl.framebufferTexture2D`
Expand Down Expand Up @@ -9002,16 +9003,21 @@ function createFramebufferInfo(gl, attachments, width, height) {
};
attachments.forEach(function(attachmentOptions) {
let attachment = attachmentOptions.attachment;
const samples = attachmentOptions.samples;
const format = attachmentOptions.format;
let attachmentPoint = attachmentOptions.attachmentPoint || getAttachmentPointForFormat(format, attachmentOptions.internalFormat);
if (!attachmentPoint) {
attachmentPoint = COLOR_ATTACHMENT0 + colorAttachmentCount++;
}
if (!attachment) {
if (isRenderbufferFormat(format)) {
if (samples !== undefined || isRenderbufferFormat(format)) {
attachment = gl.createRenderbuffer();
gl.bindRenderbuffer(RENDERBUFFER, attachment);
gl.renderbufferStorage(RENDERBUFFER, format, width, height);
if (samples > 1) {
gl.renderbufferStorageMultisample(RENDERBUFFER, samples, format, width, height);
} else {
gl.renderbufferStorage(RENDERBUFFER, format, width, height);
}
} else {
const textureOptions = Object.assign({}, attachmentOptions);
textureOptions.width = width;
Expand Down Expand Up @@ -9104,9 +9110,14 @@ function resizeFramebufferInfo(gl, framebufferInfo, attachments, width, height)
attachments.forEach(function(attachmentOptions, ndx) {
const attachment = framebufferInfo.attachments[ndx];
const format = attachmentOptions.format;
if (isRenderbuffer(gl, attachment)) {
const samples = attachmentOptions.samples;
if (samples !== undefined || isRenderbuffer(gl, attachment)) {
gl.bindRenderbuffer(RENDERBUFFER, attachment);
gl.renderbufferStorage(RENDERBUFFER, format, width, height);
if (samples > 1) {
gl.renderbufferStorageMultisample(RENDERBUFFER, samples, format, width, height);
} else {
gl.renderbufferStorage(RENDERBUFFER, format, width, height);
}
} else if (isTexture(gl, attachment)) {
resizeTexture(gl, attachment, attachmentOptions, width, height);
} else {
Expand Down
1 change: 1 addition & 0 deletions dist/4.x/twgl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export type AttachmentOptions = TextureOptions & {
format?: number;
type?: number;
target?: number;
samples?: number;
level?: number;
layer?: number;
attachment?: WebGLRenderbuffer | WebGLTexture;
Expand Down
23 changes: 18 additions & 5 deletions dist/4.x/twgl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/4.x/twgl.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/4.x/twgl.min.js

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions docs/module-twgl.html
Original file line number Diff line number Diff line change
Expand Up @@ -7428,6 +7428,39 @@ <h5 class="subsection-title">Properties:</h5>



<tr>

<td class="name"><code>samples</code></td>


<td class="type">


<span class="param-type"><code>number</code></span>



</td>


<td class="attributes">

&lt;optional><br>



</td>




<td class="description last"><p>The number of samples. Default = 1</p></td>
</tr>





<tr>

<td class="name"><code>level</code></td>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<!-- this file is auto-generated from README.md. Do not edited directly -->
<!--
@license twgl.js 4.21.2 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
@license twgl.js 4.22.0 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
Available via the MIT license.
see: http://github.com/greggman/twgl.js for details
-->
Expand Down
23 changes: 18 additions & 5 deletions npm/base/dist/4.x/twgl.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion npm/base/dist/4.x/twgl.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion npm/base/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twgl-base.js",
"version": "4.21.2",
"version": "4.22.0",
"description": "A Tiny WebGL helper library",
"main": "dist/4.x/twgl.js",
"types": "dist/4.x/twgl-full.d.ts",
Expand Down

0 comments on commit 05807c5

Please sign in to comment.