chore: finish adding const

This commit is contained in:
Krzysztof Rudnicki 2022-09-10 13:07:13 +02:00
parent f8854f4bfa
commit 7225191a23
5 changed files with 5 additions and 6 deletions

2
.vscode/tasks.json vendored
View File

@ -2,7 +2,7 @@
"tasks": [ "tasks": [
{ {
"type": "cppbuild", "type": "cppbuild",
"label": "C/C++: g++-11 build active file", "label": "C/C++: g++-20 build active file",
"command": "/usr/bin/g++", "command": "/usr/bin/g++",
"args": [ "args": [
"-g", "-g",

Binary file not shown.

View File

@ -89,7 +89,7 @@ unsigned int generateBindVAO()
return vertexArrayObject; return vertexArrayObject;
} }
void copyVerticesArray(unsigned int vertexBufferObject, const float vertices[], const size_t sizeOfVertices, const GLenum boundBufferTarget) void copyVerticesArray(const unsigned int vertexBufferObject, const float vertices[], const size_t sizeOfVertices, const GLenum boundBufferTarget)
{ {
// copy vertices array in array useful for OGL // copy vertices array in array useful for OGL
glBindBuffer(boundBufferTarget, vertexBufferObject); glBindBuffer(boundBufferTarget, vertexBufferObject);

View File

@ -6,13 +6,12 @@
#include "constants.hpp" #include "constants.hpp"
#include "misc.hpp" #include "misc.hpp"
unsigned int linkShaderObjectsShaderProgram(unsigned int vertexShaders, unsigned int fragmentShader) unsigned int linkShaderObjectsShaderProgram(const unsigned int vertexShaders, const unsigned int fragmentShader)
{ {
// link shader objects into shader program // link shader objects into shader program
// will store shader program id // will store shader program id
unsigned int shaderProgram;
// creates program // creates program
shaderProgram = glCreateProgram(); const unsigned int shaderProgram = glCreateProgram();
// attachShaders // attachShaders
glAttachShader(shaderProgram, vertexShaders); glAttachShader(shaderProgram, vertexShaders);

View File

@ -4,7 +4,7 @@
#include <GLFW/glfw3.h> #include <GLFW/glfw3.h>
#include <iostream> #include <iostream>
unsigned int linkShaderObjectsShaderProgram(unsigned int vertexShaders, unsigned int fragmentShader); unsigned int linkShaderObjectsShaderProgram(const unsigned int vertexShaders, const unsigned int fragmentShader);
std::pair<unsigned int, unsigned int> compileShaders(); std::pair<unsigned int, unsigned int> compileShaders();
unsigned int compileShader(const GLenum shaderType, const char *shaderSource); unsigned int compileShader(const GLenum shaderType, const char *shaderSource);
int shaderCompilationSuccessful(const unsigned int shader); int shaderCompilationSuccessful(const unsigned int shader);