Moving on to cubemaps.
This commit is contained in:
parent
9c75238461
commit
87c513b9f0
113 changed files with 15511 additions and 0 deletions
18
24-cubemaps/src/screen.cpp
Normal file
18
24-cubemaps/src/screen.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#include "screen.hpp"
|
||||
#include <glad/glad.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
void Screen::init() {
|
||||
shader.use();
|
||||
shader.setInt("screenTexture", 0);
|
||||
|
||||
glGenVertexArrays(1, &target_VAO);
|
||||
glGenBuffers(1, &target_VBO);
|
||||
glBindVertexArray(target_VAO);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, target_VBO);
|
||||
glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), &vertices, GL_STATIC_DRAW);
|
||||
glEnableVertexAttribArray(0);
|
||||
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (void *)0);
|
||||
glEnableVertexAttribArray(1);
|
||||
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 4 * sizeof(float), (void*)(2 * sizeof(float)));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue