Grafica algo pero no la banda

This commit is contained in:
alan
2024-10-17 19:37:00 -06:00
parent 252aab3dd2
commit 7333f3933c
6 changed files with 68 additions and 11 deletions

View File

@@ -7,7 +7,7 @@ struct obj
unsigned int vertex, vao, vbo;
};
mesh_t create_mesh( narray_float_t mesh )
mesh_t create_mesh( float * mesh )
{
struct obj * p;
@@ -20,10 +20,10 @@ mesh_t create_mesh( narray_float_t mesh )
glBindVertexArray( p->vao );
glBindBuffer( GL_ARRAY_BUFFER, p->vbo );
glBufferData( GL_ARRAY_BUFFER, (p->vertex*3)*sizeof(int), mesh+1,
glBufferData( GL_ARRAY_BUFFER, (p->vertex*3)*sizeof(float), mesh+1,
GL_STATIC_DRAW );
glVertexAttribPointer( 0,3,GL_FLOAT, 0, 3*sizeof(int), NULL );
glVertexAttribPointer( 0,3,GL_FLOAT, 0, 3*sizeof(float), NULL );
glEnableVertexAttribArray(0);
return p;