feat: refactor code + optimizations for obj file parsing
This commit is contained in:
15
src/renderer/basics.cpp
Normal file
15
src/renderer/basics.cpp
Normal file
@ -0,0 +1,15 @@
|
||||
#include <GL/glew.h>
|
||||
|
||||
#include "renderer/basics.h"
|
||||
|
||||
void Vertex::DefineAttrib()
|
||||
{
|
||||
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), reinterpret_cast<const void*>(offsetof(Vertex, m_position)));
|
||||
glEnableVertexAttribArray(0);
|
||||
|
||||
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), reinterpret_cast<const void*>(offsetof(Vertex, m_normal)));
|
||||
glEnableVertexAttribArray(1);
|
||||
|
||||
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex), reinterpret_cast<const void*>(offsetof(Vertex, m_texCoord)));
|
||||
glEnableVertexAttribArray(2);
|
||||
}
|
Reference in New Issue
Block a user