static VertexLayout GetVertexLayout( PC_Vertexes& vertexes ) { VertexLayout layout; layout.push_back( VertexAttributeProperties( "inPosition", 3, GL_FLOAT, false, sizeof( Vertex3D_PC ), (int) &vertexes[0].position ) ); layout.push_back( VertexAttributeProperties( "inColor", 4, GL_UNSIGNED_BYTE, true, sizeof( Vertex3D_PC ), (int) &vertexes[0].color ) ); return layout; }
static VertexLayout GetVertexLayout() { static VertexLayout layout; if (layout.size() == 0) { layout.push_back( VertexAttributeProperties( "inPosition", 3, GL_FLOAT, false, sizeof( Vertex3D_PC ), offsetof( Vertex3D_PC, position ) ) ); layout.push_back( VertexAttributeProperties( "inColor", 4, GL_UNSIGNED_BYTE, true, sizeof( Vertex3D_PC ), offsetof( Vertex3D_PC, color ) ) ); } return layout; }
static VertexLayout GetVertexLayout() { static VertexLayout layout; if (layout.size() == 0) { layout.push_back( VertexAttributeProperties( "inPosition", 3, GL_FLOAT, false, sizeof( Vertex3D_PUN ), offsetof( Vertex3D_PUN, position ) ) ); layout.push_back( VertexAttributeProperties( "inUV", 2, GL_FLOAT, false, sizeof( Vertex3D_PUN ), offsetof( Vertex3D_PUN, uv ) ) ); layout.push_back( VertexAttributeProperties( "inNormal", 3, GL_FLOAT, true, sizeof( Vertex3D_PUN ), offsetof( Vertex3D_PUN, normal ) ) ); } return layout; }
static VertexLayout GetVertexLayout() { static VertexLayout layout; if (layout.size() == 0) { layout.push_back( VertexAttributeProperties( "inPosition", 3, GL_FLOAT, false, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, position ) ) ); layout.push_back( VertexAttributeProperties( "inUV", 2, GL_FLOAT, false, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, uv ) ) ); layout.push_back( VertexAttributeProperties( "inNormal", 3, GL_FLOAT, true, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, normal ) ) ); layout.push_back( VertexAttributeProperties( "inTangent", 3, GL_FLOAT, true, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, tangent ) ) ); layout.push_back( VertexAttributeProperties( "inBitangent", 3, GL_FLOAT, true, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, bitangent ) ) ); layout.push_back( VertexAttributeProperties( "inColor", 4, GL_UNSIGNED_BYTE, true, sizeof( Vertex3D_PUTBNC ), offsetof( Vertex3D_PUTBNC, color ) ) ); } return layout; }