fix narrowing conversions (eg double to float, size_t to GLsizei)

This commit is contained in:
N. Pattakos
2022-01-07 23:13:19 +01:00
parent 47a6664845
commit 72f3e37150
59 changed files with 371 additions and 238 deletions

View File

@@ -129,7 +129,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -213,8 +213,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -235,7 +237,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -141,7 +141,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -226,8 +226,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -248,7 +250,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -154,7 +154,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -378,8 +378,11 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -400,7 +403,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -158,7 +158,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -402,8 +402,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -424,7 +426,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -160,7 +160,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -409,8 +409,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -431,7 +433,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -129,7 +129,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -138,7 +138,7 @@ int main()
processInput(window);
// move light position over time
lightPos.z = sin(glfwGetTime() * 0.5) * 3.0;
lightPos.z = static_cast<GLfloat>(sin(glfwGetTime() * 0.5) * 3.0);
// render
// ------
@@ -356,8 +356,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -378,7 +380,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -129,7 +129,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -138,7 +138,7 @@ int main()
processInput(window);
// move light position over time
lightPos.z = sin(glfwGetTime() * 0.5) * 3.0;
lightPos.z = static_cast<GLfloat>(sin(glfwGetTime() * 0.5) * 3.0);
// render
// ------
@@ -356,8 +356,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -378,7 +380,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -101,7 +101,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -269,8 +269,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -291,7 +293,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -23,7 +23,7 @@ void renderQuad();
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
float heightScale = 0.1;
float heightScale = 0.1f;
// camera
Camera camera(glm::vec3(0.0f, 0.0f, 3.0f));
@@ -107,7 +107,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -298,8 +298,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -320,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -23,7 +23,7 @@ void renderQuad();
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
float heightScale = 0.1;
float heightScale = 0.1f;
// camera
Camera camera(glm::vec3(0.0f, 0.0f, 3.0f));
@@ -107,7 +107,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -298,8 +298,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -320,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -23,7 +23,7 @@ void renderQuad();
// settings
const unsigned int SCR_WIDTH = 800;
const unsigned int SCR_HEIGHT = 600;
float heightScale = 0.1;
float heightScale = 0.1f;
// camera
Camera camera(glm::vec3(0.0f, 0.0f, 3.0f));
@@ -107,7 +107,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -298,8 +298,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -320,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -141,7 +141,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -359,8 +359,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -381,7 +383,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -177,7 +177,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -467,8 +467,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -489,7 +491,7 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
// utility function for loading a 2D texture from file

View File

@@ -150,14 +150,14 @@ int main()
for (unsigned int i = 0; i < NR_LIGHTS; i++)
{
// calculate slightly random offsets
float xPos = ((rand() % 100) / 100.0) * 6.0 - 3.0;
float yPos = ((rand() % 100) / 100.0) * 6.0 - 4.0;
float zPos = ((rand() % 100) / 100.0) * 6.0 - 3.0;
float xPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 3.0);
float yPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 4.0);
float zPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 3.0);
lightPositions.push_back(glm::vec3(xPos, yPos, zPos));
// also calculate random color
float rColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float gColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float bColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float rColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0
float gColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0
float bColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0
lightColors.push_back(glm::vec3(rColor, gColor, bColor));
}
@@ -174,7 +174,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -223,8 +223,8 @@ int main()
shaderLightingPass.setVec3("lights[" + std::to_string(i) + "].Position", lightPositions[i]);
shaderLightingPass.setVec3("lights[" + std::to_string(i) + "].Color", lightColors[i]);
// update attenuation parameters and calculate radius
const float linear = 0.7;
const float quadratic = 1.8;
const float linear = 0.7f;
const float quadratic = 1.8f;
shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Linear", linear);
shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Quadratic", quadratic);
}
@@ -403,8 +403,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -425,5 +427,5 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}

View File

@@ -150,14 +150,14 @@ int main()
for (unsigned int i = 0; i < NR_LIGHTS; i++)
{
// calculate slightly random offsets
float xPos = ((rand() % 100) / 100.0) * 6.0 - 3.0;
float yPos = ((rand() % 100) / 100.0) * 6.0 - 4.0;
float zPos = ((rand() % 100) / 100.0) * 6.0 - 3.0;
float xPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 3.0);
float yPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 4.0);
float zPos = static_cast<GLfloat>(((rand() % 100) / 100.0) * 6.0 - 3.0);
lightPositions.push_back(glm::vec3(xPos, yPos, zPos));
// also calculate random color
float rColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float gColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float bColor = ((rand() % 100) / 200.0f) + 0.5; // between 0.5 and 1.0
float rColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.)
float gColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.)
float bColor = static_cast<GLfloat>(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.)
lightColors.push_back(glm::vec3(rColor, gColor, bColor));
}
@@ -174,7 +174,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -223,9 +223,9 @@ int main()
shaderLightingPass.setVec3("lights[" + std::to_string(i) + "].Position", lightPositions[i]);
shaderLightingPass.setVec3("lights[" + std::to_string(i) + "].Color", lightColors[i]);
// update attenuation parameters and calculate radius
const float constant = 1.0; // note that we don't send this to the shader, we assume it is always 1.0 (in our case)
const float linear = 0.7;
const float quadratic = 1.8;
const float constant = 1.0f; // note that we don't send this to the shader, we assume it is always 1.0 (in our case)
const float linear = 0.7f;
const float quadratic = 1.8f;
shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Linear", linear);
shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Quadratic", quadratic);
// then calculate radius of light volume/sphere
@@ -408,8 +408,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -430,5 +432,5 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}

View File

@@ -173,7 +173,7 @@ int main()
glm::vec3 sample(randomFloats(generator) * 2.0 - 1.0, randomFloats(generator) * 2.0 - 1.0, randomFloats(generator));
sample = glm::normalize(sample);
sample *= randomFloats(generator);
float scale = float(i) / 64.0;
float scale = float(i) / 64.0f;
// scale samples s.t. they're more aligned to center of kernel
scale = lerp(0.1f, 1.0f, scale * scale);
@@ -222,7 +222,7 @@ int main()
{
// per-frame time logic
// --------------------
float currentFrame = glfwGetTime();
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -302,8 +302,8 @@ int main()
shaderLightingPass.setVec3("light.Position", lightPosView);
shaderLightingPass.setVec3("light.Color", lightColor);
// Update attenuation parameters
const float linear = 0.09;
const float quadratic = 0.032;
const float linear = 0.09f;
const float quadratic = 0.032f;
shaderLightingPass.setFloat("light.Linear", linear);
shaderLightingPass.setFloat("light.Quadratic", quadratic);
glActiveTexture(GL_TEXTURE0);
@@ -462,8 +462,10 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// glfw: whenever the mouse moves, this callback is called
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xpos, double ypos)
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
if (firstMouse)
{
lastX = xpos;
@@ -484,5 +486,5 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(yoffset);
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}