5#include "smk/Vertex.hpp"
7#include <smk/OpenGL.hpp>
12void Vertex2D::Bind() {
13 glEnableVertexAttribArray(0);
14 glVertexAttribPointer(0,
sizeof(Vertex::space_position) /
sizeof(GL_FLOAT),
15 GL_FLOAT,
false,
sizeof(Vertex),
16 (
void*)offsetof(Vertex, space_position));
17 glEnableVertexAttribArray(1);
18 glVertexAttribPointer(1,
sizeof(Vertex::texture_position) /
sizeof(GL_FLOAT),
19 GL_FLOAT,
false,
sizeof(Vertex),
20 (
void*)offsetof(Vertex, texture_position));
24void Vertex3D::Bind() {
25 glVertexAttribPointer(0,
sizeof(Vertex3D::space_position) /
sizeof(GL_FLOAT),
26 GL_FLOAT,
false,
sizeof(Vertex3D),
27 (
void*)offsetof(Vertex3D, space_position));
28 glEnableVertexAttribArray(1);
29 glVertexAttribPointer(1,
sizeof(Vertex3D::normal) /
sizeof(GL_FLOAT),
30 GL_FLOAT,
false,
sizeof(Vertex3D),
31 (
void*)offsetof(Vertex3D, normal));
32 glEnableVertexAttribArray(2);
33 glVertexAttribPointer(
34 2,
sizeof(Vertex3D::texture_position) /
sizeof(GL_FLOAT), GL_FLOAT,
false,
35 sizeof(Vertex3D), (
void*)offsetof(Vertex3D, texture_position));