Improve documentation on webgl and View

This commit is contained in:
Olivier Guyot
2019-05-04 17:26:05 +02:00
parent d6485b1e94
commit f69c37566e
5 changed files with 53 additions and 30 deletions
+10 -3
View File
@@ -4,20 +4,27 @@
import {STATIC_DRAW, STREAM_DRAW, DYNAMIC_DRAW} from '../webgl.js';
/**
* Used to describe the intended usage for the data: `STATIC_DRAW`, `STREAM_DRAW`
* or `DYNAMIC_DRAW`.
* @enum {number}
*/
const BufferUsage = {
export const BufferUsage = {
STATIC_DRAW: STATIC_DRAW,
STREAM_DRAW: STREAM_DRAW,
DYNAMIC_DRAW: DYNAMIC_DRAW
};
/**
* @classdesc
* Object used to store an array of data as well as usage information for that data.
* See the documentation of [WebGLRenderingContext.bufferData](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bufferData) for more info.
* @api
*/
class WebGLArrayBuffer {
/**
* @param {Array<number>=} opt_arr Array.
* @param {number=} opt_usage Usage.
* @param {number=} opt_usage Usage, either `STATIC_DRAW`, `STREAM_DRAW` or `DYNAMIC_DRAW`. Default is `DYNAMIC_DRAW`.
*/
constructor(opt_arr, opt_usage) {