From 93be6f82abd75a70a2d2537902376c0b8f7d2b40 Mon Sep 17 00:00:00 2001 From: "N. Pattakos" Date: Mon, 10 Jan 2022 00:45:44 +0100 Subject: [PATCH] update merge request as requested by JoeyDeVries: no auto or GLtypes --- includes/learnopengl/mesh.h | 2 +- .../3.1.shaders_uniform/shaders_uniform.cpp | 4 ++-- .../transformations_exercise2.cpp | 2 +- .../7.1.camera_circle/camera_circle.cpp | 4 ++-- .../camera_keyboard_dt.cpp | 4 ++-- .../camera_mouse_zoom.cpp | 8 ++++---- .../7.4.camera_class/camera_class.cpp | 10 +++++----- src/2.lighting/1.colors/colors.cpp | 10 +++++----- .../basic_lighting_diffuse.cpp | 10 +++++----- .../basic_lighting_specular.cpp | 10 +++++----- src/2.lighting/3.1.materials/materials.cpp | 16 +++++++-------- .../materials_exercise1.cpp | 8 ++++---- .../lighting_maps_diffuse.cpp | 8 ++++---- .../lighting_maps_specular.cpp | 8 ++++---- .../lighting_maps_exercise4.cpp | 8 ++++---- .../light_casters_directional.cpp | 8 ++++---- .../light_casters_point.cpp | 8 ++++---- .../light_casters_spot.cpp | 8 ++++---- .../light_casters_spot_soft.cpp | 8 ++++---- .../6.multiple_lights/multiple_lights.cpp | 8 ++++---- .../1.model_loading/model_loading.cpp | 8 ++++---- .../1.1.depth_testing/depth_testing.cpp | 8 ++++---- .../depth_testing_view.cpp | 8 ++++---- .../10.2.asteroids/asteroids.cpp | 12 +++++------ .../asteroids_instanced.cpp | 14 ++++++------- .../anti_aliasing_msaa.cpp | 8 ++++---- .../anti_aliasing_offscreen.cpp | 8 ++++---- .../2.stencil_testing/stencil_testing.cpp | 8 ++++---- .../3.1.blending_discard/blending_discard.cpp | 8 ++++---- .../3.2.blending_sort/blending_sorted.cpp | 8 ++++---- .../5.1.framebuffers/framebuffers.cpp | 8 ++++---- .../framebuffers_exercise1.cpp | 8 ++++---- .../6.1.cubemaps_skybox/cubemaps_skybox.cpp | 8 ++++---- .../cubemaps_environment_mapping.cpp | 8 ++++---- .../8.advanced_glsl_ubo/advanced_glsl_ubo.cpp | 6 +++--- .../geometry_shader_exploding.cpp | 10 +++++----- .../normal_visualization.cpp | 8 ++++---- .../1.advanced_lighting/advanced_lighting.cpp | 8 ++++---- .../2.gamma_correction/gamma_correction.cpp | 8 ++++---- .../shadow_mapping_depth.cpp | 8 ++++---- .../shadow_mapping_base.cpp | 8 ++++---- .../3.1.3.shadow_mapping/shadow_mapping.cpp | 8 ++++---- .../3.2.1.point_shadows/point_shadows.cpp | 10 +++++----- .../point_shadows_soft.cpp | 10 +++++----- .../4.normal_mapping/normal_mapping.cpp | 8 ++++---- .../5.1.parallax_mapping/parallax_mapping.cpp | 8 ++++---- .../steep_parallax_mapping.cpp | 8 ++++---- .../parallax_occlusion_mapping.cpp | 8 ++++---- src/5.advanced_lighting/6.hdr/hdr.cpp | 8 ++++---- src/5.advanced_lighting/7.bloom/bloom.cpp | 8 ++++---- .../8.1.deferred_shading/deferred_shading.cpp | 20 +++++++++---------- .../deferred_shading_volumes.cpp | 20 +++++++++---------- src/5.advanced_lighting/9.ssao/ssao.cpp | 8 ++++---- src/6.pbr/1.1.lighting/lighting.cpp | 12 +++++------ .../lighting_textured.cpp | 12 +++++------ .../ibl_irradiance_conversion.cpp | 10 +++++----- .../2.1.2.ibl_irradiance/ibl_irradiance.cpp | 12 +++++------ src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp | 12 +++++------ .../ibl_specular_textured.cpp | 8 ++++---- 59 files changed, 260 insertions(+), 260 deletions(-) diff --git a/includes/learnopengl/mesh.h b/includes/learnopengl/mesh.h index 2287d0f..803f489 100644 --- a/includes/learnopengl/mesh.h +++ b/includes/learnopengl/mesh.h @@ -87,7 +87,7 @@ public: // draw mesh glBindVertexArray(VAO); - glDrawElements(GL_TRIANGLES, static_cast(indices.size()), GL_UNSIGNED_INT, 0); + glDrawElements(GL_TRIANGLES, static_cast(indices.size()), GL_UNSIGNED_INT, 0); glBindVertexArray(0); // always good practice to set everything back to defaults once configured. diff --git a/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp b/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp index 21c08c9..afaafde 100644 --- a/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp +++ b/src/1.getting_started/3.1.shaders_uniform/shaders_uniform.cpp @@ -146,8 +146,8 @@ int main() glUseProgram(shaderProgram); // update shader uniform - auto timeValue = glfwGetTime(); - auto greenValue = static_cast(sin(timeValue) / 2.0 + 0.5); + double timeValue = glfwGetTime(); + float greenValue = static_cast(sin(timeValue) / 2.0 + 0.5); int vertexColorLocation = glGetUniformLocation(shaderProgram, "ourColor"); glUniform4f(vertexColorLocation, 0.0f, greenValue, 0.0f, 1.0f); diff --git a/src/1.getting_started/5.2.transformations_exercise2/transformations_exercise2.cpp b/src/1.getting_started/5.2.transformations_exercise2/transformations_exercise2.cpp index 6343d11..de32483 100644 --- a/src/1.getting_started/5.2.transformations_exercise2/transformations_exercise2.cpp +++ b/src/1.getting_started/5.2.transformations_exercise2/transformations_exercise2.cpp @@ -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(sin(glfwGetTime())); + float scaleAmount = static_cast(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 diff --git a/src/1.getting_started/7.1.camera_circle/camera_circle.cpp b/src/1.getting_started/7.1.camera_circle/camera_circle.cpp index a868227..1b79f31 100644 --- a/src/1.getting_started/7.1.camera_circle/camera_circle.cpp +++ b/src/1.getting_started/7.1.camera_circle/camera_circle.cpp @@ -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(sin(glfwGetTime()) * radius); - auto camZ = static_cast(cos(glfwGetTime()) * radius); + float camX = static_cast(sin(glfwGetTime()) * radius); + float camZ = static_cast(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); diff --git a/src/1.getting_started/7.2.camera_keyboard_dt/camera_keyboard_dt.cpp b/src/1.getting_started/7.2.camera_keyboard_dt/camera_keyboard_dt.cpp index 5a23faa..45c6fc9 100644 --- a/src/1.getting_started/7.2.camera_keyboard_dt/camera_keyboard_dt.cpp +++ b/src/1.getting_started/7.2.camera_keyboard_dt/camera_keyboard_dt.cpp @@ -212,7 +212,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(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(2.5 * deltaTime); + float cameraSpeed = static_cast(2.5 * deltaTime); if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS) cameraPos += cameraSpeed * cameraFront; if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS) diff --git a/src/1.getting_started/7.3.camera_mouse_zoom/camera_mouse_zoom.cpp b/src/1.getting_started/7.3.camera_mouse_zoom/camera_mouse_zoom.cpp index 8c717b7..6d556fa 100644 --- a/src/1.getting_started/7.3.camera_mouse_zoom/camera_mouse_zoom.cpp +++ b/src/1.getting_started/7.3.camera_mouse_zoom/camera_mouse_zoom.cpp @@ -221,7 +221,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(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(2.5 * deltaTime); + float cameraSpeed = static_cast(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(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { diff --git a/src/1.getting_started/7.4.camera_class/camera_class.cpp b/src/1.getting_started/7.4.camera_class/camera_class.cpp index f405899..93d60ce 100644 --- a/src/1.getting_started/7.4.camera_class/camera_class.cpp +++ b/src/1.getting_started/7.4.camera_class/camera_class.cpp @@ -216,7 +216,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(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(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(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(yoffset)); -} \ No newline at end of file + camera.ProcessMouseScroll(static_cast(yoffset)); +} diff --git a/src/2.lighting/1.colors/colors.cpp b/src/2.lighting/1.colors/colors.cpp index 384e69b..0597909 100644 --- a/src/2.lighting/1.colors/colors.cpp +++ b/src/2.lighting/1.colors/colors.cpp @@ -157,7 +157,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -252,8 +252,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -275,5 +275,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); -} \ No newline at end of file + camera.ProcessMouseScroll(static_cast(yoffset)); +} diff --git a/src/2.lighting/2.1.basic_lighting_diffuse/basic_lighting_diffuse.cpp b/src/2.lighting/2.1.basic_lighting_diffuse/basic_lighting_diffuse.cpp index b8b519b..99a1f71 100644 --- a/src/2.lighting/2.1.basic_lighting_diffuse/basic_lighting_diffuse.cpp +++ b/src/2.lighting/2.1.basic_lighting_diffuse/basic_lighting_diffuse.cpp @@ -160,7 +160,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -256,8 +256,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -279,5 +279,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); -} \ No newline at end of file + camera.ProcessMouseScroll(static_cast(yoffset)); +} diff --git a/src/2.lighting/2.2.basic_lighting_specular/basic_lighting_specular.cpp b/src/2.lighting/2.2.basic_lighting_specular/basic_lighting_specular.cpp index bc50fcc..ffe2342 100644 --- a/src/2.lighting/2.2.basic_lighting_specular/basic_lighting_specular.cpp +++ b/src/2.lighting/2.2.basic_lighting_specular/basic_lighting_specular.cpp @@ -160,7 +160,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -257,8 +257,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -279,5 +279,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); -} \ No newline at end of file + camera.ProcessMouseScroll(static_cast(yoffset)); +} diff --git a/src/2.lighting/3.1.materials/materials.cpp b/src/2.lighting/3.1.materials/materials.cpp index 33d5da9..82de7e1 100644 --- a/src/2.lighting/3.1.materials/materials.cpp +++ b/src/2.lighting/3.1.materials/materials.cpp @@ -160,7 +160,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -180,9 +180,9 @@ int main() // light properties glm::vec3 lightColor; - lightColor.x = static_cast(sin(glfwGetTime() * 2.0)); - lightColor.y = static_cast(sin(glfwGetTime() * 0.7)); - lightColor.z = static_cast(sin(glfwGetTime() * 1.3)); + lightColor.x = static_cast(sin(glfwGetTime() * 2.0)); + lightColor.y = static_cast(sin(glfwGetTime() * 0.7)); + lightColor.z = static_cast(sin(glfwGetTime() * 1.3)); glm::vec3 diffuseColor = lightColor * glm::vec3(0.5f); // decrease the influence glm::vec3 ambientColor = diffuseColor * glm::vec3(0.2f); // low influence lightingShader.setVec3("light.ambient", ambientColor); @@ -272,8 +272,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -295,5 +295,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); -} \ No newline at end of file + camera.ProcessMouseScroll(static_cast(yoffset)); +} diff --git a/src/2.lighting/3.2.materials_exercise1/materials_exercise1.cpp b/src/2.lighting/3.2.materials_exercise1/materials_exercise1.cpp index ea09d1a..7b1c0b0 100644 --- a/src/2.lighting/3.2.materials_exercise1/materials_exercise1.cpp +++ b/src/2.lighting/3.2.materials_exercise1/materials_exercise1.cpp @@ -160,7 +160,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -266,8 +266,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -288,5 +288,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/2.lighting/4.1.lighting_maps_diffuse_map/lighting_maps_diffuse.cpp b/src/2.lighting/4.1.lighting_maps_diffuse_map/lighting_maps_diffuse.cpp index ed2f1ea..4f4b412 100644 --- a/src/2.lighting/4.1.lighting_maps_diffuse_map/lighting_maps_diffuse.cpp +++ b/src/2.lighting/4.1.lighting_maps_diffuse_map/lighting_maps_diffuse.cpp @@ -170,7 +170,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -278,8 +278,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -301,7 +301,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/4.2.lighting_maps_specular_map/lighting_maps_specular.cpp b/src/2.lighting/4.2.lighting_maps_specular_map/lighting_maps_specular.cpp index 11fa264..a7f04e8 100644 --- a/src/2.lighting/4.2.lighting_maps_specular_map/lighting_maps_specular.cpp +++ b/src/2.lighting/4.2.lighting_maps_specular_map/lighting_maps_specular.cpp @@ -172,7 +172,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -281,8 +281,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -304,7 +304,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/4.4.lighting_maps_exercise4/lighting_maps_exercise4.cpp b/src/2.lighting/4.4.lighting_maps_exercise4/lighting_maps_exercise4.cpp index f0816b9..dc0d755 100644 --- a/src/2.lighting/4.4.lighting_maps_exercise4/lighting_maps_exercise4.cpp +++ b/src/2.lighting/4.4.lighting_maps_exercise4/lighting_maps_exercise4.cpp @@ -174,7 +174,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -287,8 +287,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -310,7 +310,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/5.1.light_casters_directional/light_casters_directional.cpp b/src/2.lighting/5.1.light_casters_directional/light_casters_directional.cpp index fba512f..5655313 100644 --- a/src/2.lighting/5.1.light_casters_directional/light_casters_directional.cpp +++ b/src/2.lighting/5.1.light_casters_directional/light_casters_directional.cpp @@ -182,7 +182,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -306,8 +306,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -328,7 +328,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/5.2.light_casters_point/light_casters_point.cpp b/src/2.lighting/5.2.light_casters_point/light_casters_point.cpp index 90b529a..7d65b24 100644 --- a/src/2.lighting/5.2.light_casters_point/light_casters_point.cpp +++ b/src/2.lighting/5.2.light_casters_point/light_casters_point.cpp @@ -185,7 +185,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -307,8 +307,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -330,7 +330,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/5.3.light_casters_spot/light_casters_spot.cpp b/src/2.lighting/5.3.light_casters_spot/light_casters_spot.cpp index 47a057d..6503df9 100644 --- a/src/2.lighting/5.3.light_casters_spot/light_casters_spot.cpp +++ b/src/2.lighting/5.3.light_casters_spot/light_casters_spot.cpp @@ -182,7 +182,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(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(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -331,7 +331,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/5.4.light_casters_spot_soft/light_casters_spot_soft.cpp b/src/2.lighting/5.4.light_casters_spot_soft/light_casters_spot_soft.cpp index 89195d2..416943e 100644 --- a/src/2.lighting/5.4.light_casters_spot_soft/light_casters_spot_soft.cpp +++ b/src/2.lighting/5.4.light_casters_spot_soft/light_casters_spot_soft.cpp @@ -182,7 +182,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(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(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -331,7 +331,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/2.lighting/6.multiple_lights/multiple_lights.cpp b/src/2.lighting/6.multiple_lights/multiple_lights.cpp index 9689bf0..6a7c73c 100644 --- a/src/2.lighting/6.multiple_lights/multiple_lights.cpp +++ b/src/2.lighting/6.multiple_lights/multiple_lights.cpp @@ -192,7 +192,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -361,8 +361,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -384,7 +384,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/3.model_loading/1.model_loading/model_loading.cpp b/src/3.model_loading/1.model_loading/model_loading.cpp index c66cff8..bc41ef8 100644 --- a/src/3.model_loading/1.model_loading/model_loading.cpp +++ b/src/3.model_loading/1.model_loading/model_loading.cpp @@ -94,7 +94,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -166,8 +166,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -189,5 +189,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp b/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp index 5a94de2..a7c7210 100644 --- a/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp +++ b/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp @@ -177,7 +177,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -261,8 +261,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -284,7 +284,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp b/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp index 666d508..d6b4ad0 100644 --- a/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp +++ b/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp @@ -177,7 +177,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -261,8 +261,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -284,7 +284,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/10.2.asteroids/asteroids.cpp b/src/4.advanced_opengl/10.2.asteroids/asteroids.cpp index 0848dd0..fa34d68 100644 --- a/src/4.advanced_opengl/10.2.asteroids/asteroids.cpp +++ b/src/4.advanced_opengl/10.2.asteroids/asteroids.cpp @@ -105,11 +105,11 @@ int main() model = glm::translate(model, glm::vec3(x, y, z)); // 2. scale: Scale between 0.05 and 0.25f - float scale = static_cast((rand() % 20) / 100.0 + 0.05); + float scale = static_cast((rand() % 20) / 100.0 + 0.05); model = glm::scale(model, glm::vec3(scale)); // 3. rotation: add random rotation around a (semi)randomly picked rotation axis vector - float rotAngle = static_cast((rand() % 360)); + float rotAngle = static_cast((rand() % 360)); model = glm::rotate(model, rotAngle, glm::vec3(0.4f, 0.6f, 0.8f)); // 4. now add to list of matrices @@ -122,7 +122,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -196,8 +196,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -219,5 +219,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/10.3.asteroids_instanced/asteroids_instanced.cpp b/src/4.advanced_opengl/10.3.asteroids_instanced/asteroids_instanced.cpp index 1950198..1eeca2c 100644 --- a/src/4.advanced_opengl/10.3.asteroids_instanced/asteroids_instanced.cpp +++ b/src/4.advanced_opengl/10.3.asteroids_instanced/asteroids_instanced.cpp @@ -106,11 +106,11 @@ int main() model = glm::translate(model, glm::vec3(x, y, z)); // 2. scale: Scale between 0.05 and 0.25f - auto scale = static_cast((rand() % 20) / 100.0 + 0.05); + float scale = static_cast((rand() % 20) / 100.0 + 0.05); model = glm::scale(model, glm::vec3(scale)); // 3. rotation: add random rotation around a (semi)randomly picked rotation axis vector - auto rotAngle = static_cast((rand() % 360)); + float rotAngle = static_cast((rand() % 360)); model = glm::rotate(model, rotAngle, glm::vec3(0.4f, 0.6f, 0.8f)); // 4. now add to list of matrices @@ -156,7 +156,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -194,7 +194,7 @@ int main() for (unsigned int i = 0; i < rock.meshes.size(); i++) { glBindVertexArray(rock.meshes[i].VAO); - glDrawElementsInstanced(GL_TRIANGLES, static_cast(rock.meshes[i].indices.size()), GL_UNSIGNED_INT, 0, amount); + glDrawElementsInstanced(GL_TRIANGLES, static_cast(rock.meshes[i].indices.size()), GL_UNSIGNED_INT, 0, amount); glBindVertexArray(0); } @@ -238,8 +238,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -261,5 +261,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/11.1.anti_aliasing_msaa/anti_aliasing_msaa.cpp b/src/4.advanced_opengl/11.1.anti_aliasing_msaa/anti_aliasing_msaa.cpp index db5854a..8c1eb38 100644 --- a/src/4.advanced_opengl/11.1.anti_aliasing_msaa/anti_aliasing_msaa.cpp +++ b/src/4.advanced_opengl/11.1.anti_aliasing_msaa/anti_aliasing_msaa.cpp @@ -141,7 +141,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -204,8 +204,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -226,5 +226,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/11.2.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp b/src/4.advanced_opengl/11.2.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp index 0f6d003..6056bbc 100644 --- a/src/4.advanced_opengl/11.2.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp +++ b/src/4.advanced_opengl/11.2.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp @@ -209,7 +209,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -296,8 +296,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -318,5 +318,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp b/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp index 805e12d..9176e73 100644 --- a/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp +++ b/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp @@ -181,7 +181,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -305,8 +305,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -328,7 +328,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp b/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp index 9dbd2c0..0d8d7be 100644 --- a/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp +++ b/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp @@ -208,7 +208,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -304,8 +304,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -326,7 +326,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp b/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp index a8b5c0b..1fbb1c1 100644 --- a/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp +++ b/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp @@ -210,7 +210,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -315,8 +315,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -337,7 +337,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp b/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp index 3aa9b7c..9f39226 100644 --- a/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp +++ b/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp @@ -226,7 +226,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -331,8 +331,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -353,7 +353,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp b/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp index 85c71c7..16f43aa 100644 --- a/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp +++ b/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp @@ -226,7 +226,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -363,8 +363,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -385,7 +385,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp b/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp index 9b0ae08..88a8def 100644 --- a/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp +++ b/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp @@ -222,7 +222,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -311,8 +311,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -333,7 +333,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp b/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp index 8c0ca0a..8ca9ddc 100644 --- a/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp +++ b/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp @@ -220,7 +220,7 @@ int main() { // per-frame time logic // -------------------- - float currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -310,8 +310,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -332,7 +332,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/4.advanced_opengl/8.advanced_glsl_ubo/advanced_glsl_ubo.cpp b/src/4.advanced_opengl/8.advanced_glsl_ubo/advanced_glsl_ubo.cpp index dce90ea..9d5f74d 100644 --- a/src/4.advanced_opengl/8.advanced_glsl_ubo/advanced_glsl_ubo.cpp +++ b/src/4.advanced_opengl/8.advanced_glsl_ubo/advanced_glsl_ubo.cpp @@ -168,7 +168,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -259,8 +259,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; diff --git a/src/4.advanced_opengl/9.2.geometry_shader_exploding/geometry_shader_exploding.cpp b/src/4.advanced_opengl/9.2.geometry_shader_exploding/geometry_shader_exploding.cpp index 95fe367..f735cff 100644 --- a/src/4.advanced_opengl/9.2.geometry_shader_exploding/geometry_shader_exploding.cpp +++ b/src/4.advanced_opengl/9.2.geometry_shader_exploding/geometry_shader_exploding.cpp @@ -88,7 +88,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -111,7 +111,7 @@ int main() shader.setMat4("model", model); // add time component to geometry shader in the form of a uniform - shader.setFloat("time", static_cast(glfwGetTime())); + shader.setFloat("time", static_cast(glfwGetTime())); // draw model nanosuit.Draw(shader); @@ -156,8 +156,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -178,5 +178,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/4.advanced_opengl/9.3.geometry_shader_normals/normal_visualization.cpp b/src/4.advanced_opengl/9.3.geometry_shader_normals/normal_visualization.cpp index cca63bc..4a968cf 100644 --- a/src/4.advanced_opengl/9.3.geometry_shader_normals/normal_visualization.cpp +++ b/src/4.advanced_opengl/9.3.geometry_shader_normals/normal_visualization.cpp @@ -90,7 +90,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -163,8 +163,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -185,5 +185,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp b/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp index d456294..3227425 100644 --- a/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp +++ b/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp @@ -129,7 +129,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -215,8 +215,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -237,7 +237,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp b/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp index 9a61383..44d93a6 100644 --- a/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp +++ b/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp @@ -141,7 +141,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -228,8 +228,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -250,7 +250,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/3.1.1.shadow_mapping_depth/shadow_mapping_depth.cpp b/src/5.advanced_lighting/3.1.1.shadow_mapping_depth/shadow_mapping_depth.cpp index a8886fc..c30867e 100644 --- a/src/5.advanced_lighting/3.1.1.shadow_mapping_depth/shadow_mapping_depth.cpp +++ b/src/5.advanced_lighting/3.1.1.shadow_mapping_depth/shadow_mapping_depth.cpp @@ -154,7 +154,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -380,8 +380,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -403,7 +403,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp b/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp index 6aaa8f7..5873ca8 100644 --- a/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp +++ b/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp @@ -158,7 +158,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -404,8 +404,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -426,7 +426,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp b/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp index cdd1150..a201fa9 100644 --- a/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp +++ b/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp @@ -160,7 +160,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -411,8 +411,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -433,7 +433,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp b/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp index dcc5fd9..387becb 100644 --- a/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp +++ b/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp @@ -129,7 +129,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -138,7 +138,7 @@ int main() processInput(window); // move light position over time - lightPos.z = static_cast(sin(glfwGetTime() * 0.5) * 3.0); + lightPos.z = static_cast(sin(glfwGetTime() * 0.5) * 3.0); // render // ------ @@ -358,8 +358,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -380,7 +380,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp b/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp index 88ec9a4..2a51384 100644 --- a/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp +++ b/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp @@ -129,7 +129,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -138,7 +138,7 @@ int main() processInput(window); // move light position over time - lightPos.z = static_cast(sin(glfwGetTime() * 0.5) * 3.0); + lightPos.z = static_cast(sin(glfwGetTime() * 0.5) * 3.0); // render // ------ @@ -358,8 +358,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -380,7 +380,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp b/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp index a689077..14326db 100644 --- a/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp +++ b/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp @@ -101,7 +101,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -271,8 +271,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -293,7 +293,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp b/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp index 09b1078..db8882a 100644 --- a/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp +++ b/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp @@ -107,7 +107,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -300,8 +300,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -322,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp b/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp index 72970f9..958dbfa 100644 --- a/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp +++ b/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp @@ -107,7 +107,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -300,8 +300,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -322,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp b/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp index 43f5708..e2439d0 100644 --- a/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp +++ b/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp @@ -107,7 +107,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -300,8 +300,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -322,7 +322,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/6.hdr/hdr.cpp b/src/5.advanced_lighting/6.hdr/hdr.cpp index e48ca83..0f63afe 100644 --- a/src/5.advanced_lighting/6.hdr/hdr.cpp +++ b/src/5.advanced_lighting/6.hdr/hdr.cpp @@ -141,7 +141,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -361,8 +361,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -383,7 +383,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/7.bloom/bloom.cpp b/src/5.advanced_lighting/7.bloom/bloom.cpp index 5e1132b..a8b6527 100644 --- a/src/5.advanced_lighting/7.bloom/bloom.cpp +++ b/src/5.advanced_lighting/7.bloom/bloom.cpp @@ -177,7 +177,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -469,8 +469,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -491,7 +491,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // utility function for loading a 2D texture from file diff --git a/src/5.advanced_lighting/8.1.deferred_shading/deferred_shading.cpp b/src/5.advanced_lighting/8.1.deferred_shading/deferred_shading.cpp index cc37ef4..13d6e10 100644 --- a/src/5.advanced_lighting/8.1.deferred_shading/deferred_shading.cpp +++ b/src/5.advanced_lighting/8.1.deferred_shading/deferred_shading.cpp @@ -150,14 +150,14 @@ int main() for (unsigned int i = 0; i < NR_LIGHTS; i++) { // calculate slightly random offsets - float xPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); - float yPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 4.0); - float zPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); + float xPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); + float yPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 4.0); + float zPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); lightPositions.push_back(glm::vec3(xPos, yPos, zPos)); // also calculate random color - float rColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0 - float gColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0 - float bColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0 + float rColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0 + float gColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.0 + float bColor = static_cast(((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 // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + auto currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -405,8 +405,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -427,5 +427,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp b/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp index 1a2b986..68692f2 100644 --- a/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp +++ b/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp @@ -150,14 +150,14 @@ int main() for (unsigned int i = 0; i < NR_LIGHTS; i++) { // calculate slightly random offsets - float xPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); - float yPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 4.0); - float zPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); + float xPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); + float yPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 4.0); + float zPos = static_cast(((rand() % 100) / 100.0) * 6.0 - 3.0); lightPositions.push_back(glm::vec3(xPos, yPos, zPos)); // also calculate random color - float rColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.) - float gColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.) - float bColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.) + float rColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.) + float gColor = static_cast(((rand() % 100) / 200.0f) + 0.5); // between 0.5 and 1.) + float bColor = static_cast(((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 // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + auto currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -410,8 +410,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -432,5 +432,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/5.advanced_lighting/9.ssao/ssao.cpp b/src/5.advanced_lighting/9.ssao/ssao.cpp index ac7920d..08ac98e 100644 --- a/src/5.advanced_lighting/9.ssao/ssao.cpp +++ b/src/5.advanced_lighting/9.ssao/ssao.cpp @@ -222,7 +222,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -464,8 +464,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { lastX = xpos; @@ -486,5 +486,5 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } diff --git a/src/6.pbr/1.1.lighting/lighting.cpp b/src/6.pbr/1.1.lighting/lighting.cpp index 9259500..e24f8c9 100644 --- a/src/6.pbr/1.1.lighting/lighting.cpp +++ b/src/6.pbr/1.1.lighting/lighting.cpp @@ -115,7 +115,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -215,8 +215,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -238,13 +238,13 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // renders (and builds at first invocation) a sphere // ------------------------------------------------- unsigned int sphereVAO = 0; -GLsizei indexCount; +unsigned int indexCount; void renderSphere() { if (sphereVAO == 0) @@ -300,7 +300,7 @@ void renderSphere() } oddRow = !oddRow; } - indexCount = static_cast(indices.size()); + indexCount = static_cast(indices.size()); std::vector data; for (unsigned int i = 0; i < positions.size(); ++i) diff --git a/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp b/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp index e0bbd56..b64b00f 100644 --- a/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp +++ b/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp @@ -120,7 +120,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -226,8 +226,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -249,13 +249,13 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // renders (and builds at first invocation) a sphere // ------------------------------------------------- unsigned int sphereVAO = 0; -GLsizei indexCount; +unsigned int indexCount; void renderSphere() { if (sphereVAO == 0) @@ -311,7 +311,7 @@ void renderSphere() } oddRow = !oddRow; } - indexCount = static_cast(indices.size()); + indexCount = static_cast(indices.size()); std::vector data; for (unsigned int i = 0; i < positions.size(); ++i) diff --git a/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp b/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp index 097867b..de2ce95 100644 --- a/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp +++ b/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp @@ -214,7 +214,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -331,8 +331,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -360,7 +360,7 @@ void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) // renders (and builds at first invocation) a sphere // ------------------------------------------------- unsigned int sphereVAO = 0; -GLsizei indexCount; +unsigned int indexCount; void renderSphere() { if (sphereVAO == 0) @@ -416,7 +416,7 @@ void renderSphere() } oddRow = !oddRow; } - indexCount = static_cast(indices.size()); + indexCount = static_cast(indices.size()); std::vector data; for (unsigned int i = 0; i < positions.size(); ++i) diff --git a/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp b/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp index 80060a5..38cf5a4 100644 --- a/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp +++ b/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp @@ -255,7 +255,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -371,8 +371,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -394,13 +394,13 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // renders (and builds at first invocation) a sphere // ------------------------------------------------- unsigned int sphereVAO = 0; -GLsizei indexCount; +unsigned int indexCount; void renderSphere() { if (sphereVAO == 0) @@ -456,7 +456,7 @@ void renderSphere() } oddRow = !oddRow; } - indexCount = static_cast(indices.size()); + indexCount = static_cast(indices.size()); std::vector data; for (unsigned int i = 0; i < positions.size(); ++i) diff --git a/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp b/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp index fa543af..1e5f62d 100644 --- a/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp +++ b/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp @@ -343,7 +343,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -469,8 +469,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -492,13 +492,13 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // renders (and builds at first invocation) a sphere // ------------------------------------------------- unsigned int sphereVAO = 0; -GLsizei indexCount; +unsigned int indexCount; void renderSphere() { if (sphereVAO == 0) @@ -554,7 +554,7 @@ void renderSphere() } oddRow = !oddRow; } - indexCount = static_cast(indices.size()); + indexCount = static_cast(indices.size()); std::vector data; for (unsigned int i = 0; i < positions.size(); ++i) diff --git a/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp b/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp index 23c1bf4..bdd36d2 100644 --- a/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp +++ b/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp @@ -380,7 +380,7 @@ int main() { // per-frame time logic // -------------------- - auto currentFrame = static_cast(glfwGetTime()); + float currentFrame = static_cast(glfwGetTime()); deltaTime = currentFrame - lastFrame; lastFrame = currentFrame; @@ -569,8 +569,8 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) // ------------------------------------------------------- void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) { - auto xpos = static_cast(xposIn); - auto ypos = static_cast(yposIn); + float xpos = static_cast(xposIn); + float ypos = static_cast(yposIn); if (firstMouse) { @@ -592,7 +592,7 @@ void mouse_callback(GLFWwindow* window, double xposIn, double yposIn) // ---------------------------------------------------------------------- void scroll_callback(GLFWwindow* window, double xoffset, double yoffset) { - camera.ProcessMouseScroll(static_cast(yoffset)); + camera.ProcessMouseScroll(static_cast(yoffset)); } // renders (and builds at first invocation) a sphere