# all files / ol/webgl/ buffer.js

90.91% Statements 10/11
75% Branches 3/4
66.67% Functions 2/3
90.91% Lines 10/11

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    561×

    1×
    1×

    1×

    1×

    4×

    4×

    1×
    3×

    1×

     goog.provide('ol.webgl.Buffer');

    goog.require('goog.webgl');
    goog.require('ol');

    /**
     * @enum {number}
     */
    ol.webgl.BufferUsage = {
      STATIC_DRAW: goog.webgl.STATIC_DRAW,
      STREAM_DRAW: goog.webgl.STREAM_DRAW,
      DYNAMIC_DRAW: goog.webgl.DYNAMIC_DRAW
    };

    /**
     * @constructor
     * @param {Array.<number>=} opt_arr Array.
     * @param {number=} opt_usage Usage.
     * @struct
     */
    ol.webgl.Buffer = function(opt_arr, opt_usage) {

      /**
       * @private
       * @type {Array.<number>}
       */
      this.arr_ = opt_arr !== undefined ? opt_arr : [];

      /**
       * @private
       * @type {number}
       */
      this.usage_ = opt_usage !== undefined ?
          opt_usage : ol.webgl.BufferUsage.STATIC_DRAW;

    };

    /**
     * @return {Array.<number>} Array.
     */
    ol.webgl.Buffer.prototype.getArray = function() {
      return this.arr_;
    };

    /**
     * @return {number} Usage.
     */
    ol.webgl.Buffer.prototype.getUsage = function() {
      return this.usage_;
    };