update merge request as requested by JoeyDeVries: no auto or GLtypes

This commit is contained in:
N. Pattakos
2022-01-10 00:45:44 +01:00
parent 1be7d8ab3e
commit 93be6f82ab
59 changed files with 260 additions and 260 deletions

View File

@@ -146,8 +146,8 @@ int main()
glUseProgram(shaderProgram);
// update shader uniform
auto timeValue = glfwGetTime();
auto greenValue = static_cast<GLfloat>(sin(timeValue) / 2.0 + 0.5);
double timeValue = glfwGetTime();
float greenValue = static_cast<float>(sin(timeValue) / 2.0 + 0.5);
int vertexColorLocation = glGetUniformLocation(shaderProgram, "ourColor");
glUniform4f(vertexColorLocation, 0.0f, greenValue, 0.0f, 1.0f);

View File

@@ -184,7 +184,7 @@ int main()
// ---------------------
transform = glm::mat4(1.0f); // reset it to identity matrix
transform = glm::translate(transform, glm::vec3(-0.5f, 0.5f, 0.0f));
auto scaleAmount = static_cast<GLfloat>(sin(glfwGetTime()));
float scaleAmount = static_cast<float>(sin(glfwGetTime()));
transform = glm::scale(transform, glm::vec3(scaleAmount, scaleAmount, scaleAmount));
glUniformMatrix4fv(transformLoc, 1, GL_FALSE, &transform[0][0]); // this time take the matrix value array's first element as its memory pointer value

View File

@@ -222,8 +222,8 @@ int main()
// camera/view transformation
glm::mat4 view = glm::mat4(1.0f); // make sure to initialize matrix to identity matrix first
float radius = 10.0f;
auto camX = static_cast<GLfloat>(sin(glfwGetTime()) * radius);
auto camZ = static_cast<GLfloat>(cos(glfwGetTime()) * radius);
float camX = static_cast<float>(sin(glfwGetTime()) * radius);
float camZ = static_cast<float>(cos(glfwGetTime()) * radius);
view = glm::lookAt(glm::vec3(camX, 0.0f, camZ), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 1.0f, 0.0f));
ourShader.setMat4("view", view);

View File

@@ -212,7 +212,7 @@ int main()
{
// per-frame time logic
// --------------------
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
float currentFrame = static_cast<float>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -276,7 +276,7 @@ void processInput(GLFWwindow *window)
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
auto cameraSpeed = static_cast<GLfloat>(2.5 * deltaTime);
float cameraSpeed = static_cast<float>(2.5 * deltaTime);
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
cameraPos += cameraSpeed * cameraFront;
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)

View File

@@ -221,7 +221,7 @@ int main()
{
// per-frame time logic
// --------------------
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
float currentFrame = static_cast<float>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -289,7 +289,7 @@ void processInput(GLFWwindow *window)
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
glfwSetWindowShouldClose(window, true);
auto cameraSpeed = static_cast<GLfloat>(2.5 * deltaTime);
float cameraSpeed = static_cast<float>(2.5 * deltaTime);
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
cameraPos += cameraSpeed * cameraFront;
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)
@@ -313,8 +313,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
float xpos = static_cast<float>(xposIn);
float ypos = static_cast<float>(yposIn);
if (firstMouse)
{

View File

@@ -216,7 +216,7 @@ int main()
{
// per-frame time logic
// --------------------
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
float currentFrame = static_cast<float>(glfwGetTime());
deltaTime = currentFrame - lastFrame;
lastFrame = currentFrame;
@@ -308,8 +308,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height)
// -------------------------------------------------------
void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
{
auto xpos = static_cast<GLfloat>(xposIn);
auto ypos = static_cast<GLfloat>(yposIn);
float xpos = static_cast<float>(xposIn);
float ypos = static_cast<float>(yposIn);
if (firstMouse)
{
@@ -331,5 +331,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn)
// ----------------------------------------------------------------------
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
{
camera.ProcessMouseScroll(static_cast<GLfloat>(yoffset));
}
camera.ProcessMouseScroll(static_cast<float>(yoffset));
}