JAVASCRIPT   74

buffer.js

Guest on 22nd July 2021 10:08:05 AM

  1. goog.provide('ol.webgl.Buffer');
  2.  
  3. goog.require('goog.array');
  4. goog.require('goog.webgl');
  5. goog.require('ol');
  6.  
  7.  
  8. /**
  9.  * @enum {number}
  10.  */
  11. ol.webgl.BufferUsage = {
  12.   STATIC_DRAW: goog.webgl.STATIC_DRAW,
  13.   STREAM_DRAW: goog.webgl.STREAM_DRAW,
  14.   DYNAMIC_DRAW: goog.webgl.DYNAMIC_DRAW
  15. };
  16.  
  17.  
  18.  
  19. /**
  20.  * @constructor
  21.  * @param {Array.<number>=} opt_arr Array.
  22.  * @param {number=} opt_usage Usage.
  23.  * @struct
  24.  */
  25. ol.webgl.Buffer = function(opt_arr, opt_usage) {
  26.  
  27.   /**
  28.    * @private
  29.    * @type {Array.<number>}
  30.    */
  31.   this.arr_ = goog.isDef(opt_arr) ? opt_arr : [];
  32.  
  33.   /**
  34.    * @private
  35.    * @type {number}
  36.    */
  37.   this.usage_ = goog.isDef(opt_usage) ?
  38.       opt_usage : ol.webgl.BufferUsage.STATIC_DRAW;
  39.  
  40. };
  41.  
  42.  
  43. /**
  44.  * @return {Array.<number>} Array.
  45.  */
  46. ol.webgl.Buffer.prototype.getArray = function() {
  47.   return this.arr_;
  48. };
  49.  
  50.  
  51. /**
  52.  * @return {number} Usage.
  53.  */
  54. ol.webgl.Buffer.prototype.getUsage = function() {
  55.   return this.usage_;
  56. };

Raw Paste


Login or Register to edit or fork this paste. It's free.