changed to a triangle

This commit is contained in:
Lukian 2025-01-29 11:15:25 +01:00
parent b21b9398e6
commit 78c7efd063

View file

@ -34,16 +34,14 @@ int main()
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback); glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
float vertices[] = { float vertices[] = {
0.5f, 0.5f, 0.0f, // top right 0.0f, 0.5f, 0.0f,
0.5f, -0.5f, 0.0f, // bottom right -0.5f, -0.5f, 0.0f,
-0.5f, -0.5f, 0.0f, // bottom left 0.5f, -0.5f, 0.0f
-0.5f, 0.5f, 0.0f // top left
}; };
unsigned int indices[] = { // note that we start from 0! unsigned int indices[] = { // note that we start from 0!
0, 1, 3, // first triangle 0, 1, 2
1, 2, 3 // second triangle };
};
unsigned int VBO; unsigned int VBO;
glGenBuffers(1, &VBO); glGenBuffers(1, &VBO);