X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fvertexarray.cpp;h=8381d8adb1d9663b742db5a88af857f988b6bfd0;hb=7e9e15a12fb398798f2719545cc8553354c1e389;hp=a2b65daa6d15dd91635c092a73e2434e76a9b51f;hpb=76e338af116120d93d082ad247591ec9adad9233;p=libs%2Fgl.git diff --git a/source/vertexarray.cpp b/source/vertexarray.cpp index a2b65daa..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]; - uint offset=0; - uint found=0; - uint 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) { - uint sz=(*c&3)+1; - uint 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<