X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fvertexarray.cpp;h=8381d8adb1d9663b742db5a88af857f988b6bfd0;hp=c6724e13a27f05d1c509ac189d379fe3f392c2e6;hb=b617c5d7b5283ad260a77f01e42e6170cabbc03d;hpb=f17794d55923d4fb4f63e9d082d8d84a735a04e8 diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index c6724e13..8381d8ad 100644 --- a/source/vertexarray.cpp +++ b/source/vertexarray.cpp @@ -35,8 +35,8 @@ void VertexArray::use_vertex_buffer() if(vbuf && own_vbuf) return; - vbuf=new Buffer(ARRAY_BUFFER); - own_vbuf=true; + vbuf = new Buffer(ARRAY_BUFFER); + own_vbuf = true; update_data(); } @@ -45,8 +45,8 @@ void VertexArray::use_vertex_buffer(Buffer *b) { if(own_vbuf) delete vbuf; - vbuf=b; - own_vbuf=false; + vbuf = b; + own_vbuf = false; update_data(); } @@ -64,12 +64,12 @@ void VertexArray::clear() void VertexArray::reset(const VertexFormat &f) { clear(); - format=f; - stride=get_stride(format); + format = f; + stride = get_stride(format); - bool has_gen_attrs=false; + bool has_gen_attrs = false; for(const unsigned char *c=format.begin(); (!has_gen_attrs && c!=format.end()); ++c) - has_gen_attrs=(*c>=ATTRIB1); + has_gen_attrs = (*c>=ATTRIB1); if(has_gen_attrs) static RequireExtension _ext("GL_ARB_vertex_program"); } @@ -82,14 +82,14 @@ void VertexArray::apply() const if(vbuf) vbuf->bind(); - const float *base=vbuf?0:&data[0]; - unsigned offset=0; - unsigned found=0; - unsigned bpv=stride*sizeof(float); + const float *base = vbuf?0:&data[0]; + unsigned offset = 0; + unsigned found = 0; + unsigned bpv = stride*sizeof(float); for(const unsigned char *c=format.begin(); c!=format.end(); ++c) { - unsigned sz=(*c&3)+1; - unsigned t=*c>>2; + unsigned sz = (*c&3)+1; + unsigned t = *c>>2; switch(t) { case 0: @@ -111,8 +111,8 @@ void VertexArray::apply() const glVertexAttribPointerARB(t-4, sz, GL_FLOAT, false, bpv, base+offset); break; } - found|=1<