]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/vertexsetup.cpp
Use standard fixed-size integer types
[libs/gl.git] / source / core / vertexsetup.cpp
index 81d2261e6aa78b55b3240e231ea72b25232bea60..75d3ad8bc11017966d249adbe4762e2b235cab0f 100644 (file)
@@ -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);