<commit_before>#include <ege/graphic/geometry/vertex/array.hxx>
#include <GL/glew.h>


using namespace ege::graphic::geometry::vertex;


Array::Array( ArrayAttribute* attributes, size_t count )
{
        GLuint id;
        glGenVertexArrays( 1, &id );
        glBindVertexArray( id );

        for ( size_t i = 0; i < count; ++i )
        {
                ArrayAttribute& attribute = attributes[ i ];
                glEnableVertexAttribArray( ( GLuint ) attribute.vertexIndex );
                glBindBuffer( GL_VERTEX_ARRAY, ( GLuint ) attribute.buffer->getBufferId() );
                const void* offset = ( const void * ) attribute.offsetInBuffer;
                glVertexAttribPointer( ( GLuint ) attribute.vertexIndex, attribute.vectorSize, GL_FLOAT, GL_FALSE, ( GLsizei ) attribute.stride, offset );
        }
}


void Array::use()
{
        glBindVertexArray( ( GLuint ) glVertexArrayId );
}


size_t Array::getVertexArrayId()
{
        return  glVertexArrayId;
}
<commit_msg>bugfix: binding buffer to GL_ARRAY_BUFFER and not to... GL_VERTEX_ARRAY (hahaha)<commit_after>#include <ege/graphic/geometry/vertex/array.hxx>
#include <GL/glew.h>


using namespace ege::graphic::geometry::vertex;


Array::Array( ArrayAttribute* attributes, size_t count )
{
        GLuint id;
        glGenVertexArrays( 1, &id );
        glBindVertexArray( id );

        for ( size_t i = 0; i < count; ++i )
        {
                ArrayAttribute& attribute = attributes[ i ];
                glEnableVertexAttribArray( ( GLuint ) attribute.vertexIndex );
                glBindBuffer( GL_ARRAY_BUFFER, ( GLuint ) attribute.buffer->getBufferId() );
                const void* offset = ( const void * ) attribute.offsetInBuffer;
                glVertexAttribPointer( ( GLuint ) attribute.vertexIndex, attribute.vectorSize, GL_FLOAT, GL_FALSE, ( GLsizei ) attribute.stride, offset );
        }
}


void Array::use()
{
        glBindVertexArray( ( GLuint ) glVertexArrayId );
}


size_t Array::getVertexArrayId()
{
        return  glVertexArrayId;
}

{'fraction_non_alphanumeric': 0.11280039234919079, 'fraction_numerical': 0.00196174595389897, 'mean_word_length': 2.770794824399261, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3093019', 'n_tokens_mistral': 623, 'n_tokens_neox': 603, 'n_words': 131}