-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
good first issueGood for newcomersGood for newcomersrefactoringOr Improve structure / Format of the codeOr Improve structure / Format of the code
Description
This Three functions seems are static, but no static keyword or comment to explain why.
practical-tools-for-simple-design/src/Util/Image.cpp
Lines 47 to 96 in de573bd
| void Image::InitProgram() { | |
| // TODO: Create `BaseProgram` from `Program` and pass it into `Drawable` | |
| s_Program = std::make_unique<Core::Program>("../assets/shaders/Base.vert", | |
| "../assets/shaders/Base.frag"); | |
| s_Program->Bind(); | |
| GLint location = glGetUniformLocation(s_Program->GetId(), "surface"); | |
| glUniform1i(location, UNIFORM_SURFACE_LOCATION); | |
| } | |
| void Image::InitVertexArray() { | |
| s_VertexArray = std::make_unique<Core::VertexArray>(); | |
| // NOLINTBEGIN | |
| // These are vertex data for the rectangle but clang-tidy has magic | |
| // number warnings | |
| // Vertex | |
| s_VertexArray->AddVertexBuffer(std::make_unique<Core::VertexBuffer>( | |
| std::vector<float>{ | |
| -0.5F, 0.5F, // | |
| -0.5F, -0.5F, // | |
| 0.5F, -0.5F, // | |
| 0.5F, 0.5F, // | |
| }, | |
| 2)); | |
| // UV | |
| s_VertexArray->AddVertexBuffer(std::make_unique<Core::VertexBuffer>( | |
| std::vector<float>{ | |
| 0.0F, 0.0F, // | |
| 0.0F, 1.0F, // | |
| 1.0F, 1.0F, // | |
| 1.0F, 0.0F, // | |
| }, | |
| 2)); | |
| // Index | |
| s_VertexArray->SetIndexBuffer( | |
| std::make_unique<Core::IndexBuffer>(std::vector<unsigned int>{ | |
| 0, 1, 2, // | |
| 0, 2, 3, // | |
| })); | |
| // NOLINTEND | |
| } | |
| void Image::InitUniformBuffer() { | |
| s_UniformBuffer = std::make_unique<Core::UniformBuffer<Core::Matrices>>( | |
| *s_Program, "Matrices", 0); | |
| } |
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomersrefactoringOr Improve structure / Format of the codeOr Improve structure / Format of the code
Type
Projects
Status
🆕 Backlog