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": [
{
"type": "cppbuild",
"label": "C/C++: g++-11 build active file",
"label": "C/C++: g++-20 build active file",
"command": "/usr/bin/g++",
"args": [
"-g",

Binary file not shown.

View File

@ -89,7 +89,7 @@ unsigned int generateBindVAO()
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
glBindBuffer(boundBufferTarget, vertexBufferObject);

View File

@ -6,13 +6,12 @@
#include "constants.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
// will store shader program id
unsigned int shaderProgram;
// creates program
shaderProgram = glCreateProgram();
const unsigned int shaderProgram = glCreateProgram();
// attachShaders
glAttachShader(shaderProgram, vertexShaders);

View File

@ -4,7 +4,7 @@
#include <GLFW/glfw3.h>
#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();
unsigned int compileShader(const GLenum shaderType, const char *shaderSource);
int shaderCompilationSuccessful(const unsigned int shader);