]> git.tdb.fi Git - libs/gl.git/blobdiff - source/vertexarray.cpp
Get rid of the typedefs for fundamental types
[libs/gl.git] / source / vertexarray.cpp
index ef11844466b9ff7833dcde88a53a69ff422f059d..c6724e13a27f05d1c509ac189d379fe3f392c2e6 100644 (file)
@@ -35,13 +35,13 @@ void VertexArray::use_vertex_buffer()
        if(vbuf && own_vbuf)
                return;
 
-       vbuf=new VertexBuffer();
+       vbuf=new Buffer(ARRAY_BUFFER);
        own_vbuf=true;
 
        update_data();
 }
 
-void VertexArray::use_vertex_buffer(VertexBuffer *b)
+void VertexArray::use_vertex_buffer(Buffer *b)
 {
        if(own_vbuf)
                delete vbuf;
@@ -83,13 +83,13 @@ void VertexArray::apply() const
                vbuf->bind();
 
        const float *base=vbuf?0:&data[0];
-       uint offset=0;
-       uint found=0;
-       uint bpv=stride*sizeof(float);
+       unsigned offset=0;
+       unsigned found=0;
+       unsigned bpv=stride*sizeof(float);
        for(const unsigned char *c=format.begin(); c!=format.end(); ++c)
        {
-               uint sz=(*c&3)+1;
-               uint t=*c>>2;
+               unsigned sz=(*c&3)+1;
+               unsigned t=*c>>2;
                switch(t)
                {
                case 0:
@@ -120,10 +120,10 @@ void VertexArray::apply() const
        set_array(GL_TEXTURE_COORD_ARRAY, found&4, 4);
        set_array(GL_COLOR_ARRAY, found&8, 8);
        for(unsigned i=4; i<32; ++i)
-               set_array(i-3, (found>>i)&1, 1<<i);
+               set_array(i-4, (found>>i)&1, 1<<i);
 
        if(vbuf)
-               VertexBuffer::unbind();
+               vbuf->unbind();
 }
 
 /**
@@ -134,7 +134,7 @@ void VertexArray::update_data()
        if(vbuf)
        {
                vbuf->data(data.size()*sizeof(float), &data[0]);
-               VertexBuffer::unbind();
+               vbuf->unbind();
        }
 }
 
@@ -192,17 +192,17 @@ void array_element(int i)
        glArrayElement(i);
 }
 
-void draw_arrays(PrimitiveType mode, int first, sizei count)
+void draw_arrays(PrimitiveType mode, int first, unsigned count)
 {
        glDrawArrays(mode, first, count);
 }
 
-void draw_elements(PrimitiveType mode, sizei count, DataType type, const void *indices)
+void draw_elements(PrimitiveType mode, unsigned count, DataType type, const void *indices)
 {
        glDrawElements(mode, count, type, indices);
 }
 
-void draw_range_elements(PrimitiveType mode, uint low, uint high, sizei count, DataType type, const void *indices)
+void draw_range_elements(PrimitiveType mode, unsigned low, unsigned high, unsigned count, DataType type, const void *indices)
 {
        static RequireVersion _ver(1, 2);
        glDrawRangeElements(mode, low, high, count, type, indices);