mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
fixed compiler warnings reported by gcc/clang
* changed some catch blocks to use exception references instead of value types * fixed missing use of SCR_WIDTH/SCR_HEIGHT for glfwCreateWindow * fixed implicit numeric type casts regarding signedness * removed unused variables Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -445,7 +445,6 @@ void processInput(GLFWwindow *window)
|
||||
if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, true);
|
||||
|
||||
float cameraSpeed = 2.5 * deltaTime;
|
||||
if (glfwGetKey(window, GLFW_KEY_W) == GLFW_PRESS)
|
||||
camera.ProcessKeyboard(FORWARD, deltaTime);
|
||||
if (glfwGetKey(window, GLFW_KEY_S) == GLFW_PRESS)
|
||||
@@ -532,11 +531,11 @@ void renderSphere()
|
||||
}
|
||||
|
||||
bool oddRow = false;
|
||||
for (int y = 0; y < Y_SEGMENTS; ++y)
|
||||
for (unsigned int y = 0; y < Y_SEGMENTS; ++y)
|
||||
{
|
||||
if (!oddRow) // even rows: y == 0, y == 2; and so on
|
||||
{
|
||||
for (int x = 0; x <= X_SEGMENTS; ++x)
|
||||
for (unsigned int x = 0; x <= X_SEGMENTS; ++x)
|
||||
{
|
||||
indices.push_back(y * (X_SEGMENTS + 1) + x);
|
||||
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
|
||||
@@ -544,7 +543,7 @@ void renderSphere()
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int x = X_SEGMENTS; x >= 0; --x)
|
||||
for (unsigned int x = X_SEGMENTS; x >= 0; --x)
|
||||
{
|
||||
indices.push_back((y + 1) * (X_SEGMENTS + 1) + x);
|
||||
indices.push_back(y * (X_SEGMENTS + 1) + x);
|
||||
@@ -555,7 +554,7 @@ void renderSphere()
|
||||
indexCount = indices.size();
|
||||
|
||||
std::vector<float> data;
|
||||
for (int i = 0; i < positions.size(); ++i)
|
||||
for (std::size_t i = 0; i < positions.size(); ++i)
|
||||
{
|
||||
data.push_back(positions[i].x);
|
||||
data.push_back(positions[i].y);
|
||||
|
||||
Reference in New Issue
Block a user