Subversion Repositories AndroidProjects

Rev

Rev 786 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
786 chris 1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
 
7
namespace BauzoidNET.graphics.model
8
{
787 chris 9
    public class AttributeArray
786 chris 10
    {
11
        private float[] mAttributeArray = null;
12
        private int mCurrentIndex = 0;
13
 
14
        public AttributeArray(int size)
15
        {
16
            mAttributeArray = new float[size];
17
            mCurrentIndex = 0;
18
        }
19
 
20
        public void fill(float x)
21
        {
22
            mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
23
        }
24
 
25
        public void fill(float x, float y)
26
        {
27
            mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
28
            mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;
29
        }
30
 
31
        public void fill(float x, float y, float z)
32
        {
33
            mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
34
            mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;
35
            mAttributeArray[mCurrentIndex] = z; mCurrentIndex++;
36
        }
37
 
38
        public void fill(float x, float y, float z, float w)
39
        {
40
            mAttributeArray[mCurrentIndex] = x; mCurrentIndex++;
41
            mAttributeArray[mCurrentIndex] = y; mCurrentIndex++;
42
            mAttributeArray[mCurrentIndex] = z; mCurrentIndex++;
43
            mAttributeArray[mCurrentIndex] = w; mCurrentIndex++;
44
        }
45
 
46
        public float[] getAttributeArray()
47
        {
48
            return mAttributeArray;
49
        }
50
 
51
        public int getUsedCount()
52
        {
53
            return mCurrentIndex;
54
        }
55
    }
56
}