X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcore%2Fvertexsetup.cpp;h=75d3ad8bc11017966d249adbe4762e2b235cab0f;hb=3a1b9cbe2441ae670a97541dc8ccb0a2860c8302;hp=81d2261e6aa78b55b3240e231ea72b25232bea60;hpb=e92de029768eef5f0fd744329e589161b46d0762;p=libs%2Fgl.git diff --git a/source/core/vertexsetup.cpp b/source/core/vertexsetup.cpp index 81d2261e..75d3ad8b 100644 --- a/source/core/vertexsetup.cpp +++ b/source/core/vertexsetup.cpp @@ -107,7 +107,7 @@ bool VertexSetup::verify_format(const VertexFormat &fmt) unsigned max_attribs = Limits::get_global().max_vertex_attributes; - for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a) + for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a) if(get_attribute_semantic(*a)>=max_attribs) return false; @@ -117,7 +117,7 @@ bool VertexSetup::verify_format(const VertexFormat &fmt) void VertexSetup::require_format(const VertexFormat &fmt) { bool has_int = false; - for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a) + for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a) has_int = has_int | is_integer_attribute(*a); if(has_int) @@ -148,7 +148,10 @@ void VertexSetup::update() const void VertexSetup::update_vertex_array(const VertexArray &array, unsigned binding, unsigned divisor, bool direct) const { if(!direct) + { + Buffer::unbind_scratch(); glBindBuffer(GL_ARRAY_BUFFER, array.get_buffer()->get_id()); + } const VertexFormat &fmt = array.get_format(); unsigned stride = fmt.stride(); @@ -159,7 +162,7 @@ void VertexSetup::update_vertex_array(const VertexArray &array, unsigned binding } unsigned offset = 0; - for(const UInt16 *a=fmt.begin(); a!=fmt.end(); ++a) + for(const uint16_t *a=fmt.begin(); a!=fmt.end(); ++a) { unsigned sem = get_attribute_semantic(*a); bool integer = is_integer_attribute(*a); @@ -204,13 +207,13 @@ void VertexSetup::unload() glBindVertexArray(id); glBindBuffer(GL_ARRAY_BUFFER, 0); - for(const UInt16 *a=vertex_format.begin(); a!=vertex_format.end(); ++a) + for(const uint16_t *a=vertex_format.begin(); a!=vertex_format.end(); ++a) { unsigned sem = get_attribute_semantic(*a); glDisableVertexAttribArray(sem); glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0); } - for(const UInt16 *a=inst_format.begin(); a!=inst_format.end(); ++a) + for(const uint16_t *a=inst_format.begin(); a!=inst_format.end(); ++a) { unsigned sem = get_attribute_semantic(*a); glDisableVertexAttribArray(sem);