mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
update merge request as requested by JoeyDeVries: no auto or GLtypes
This commit is contained in:
@@ -115,7 +115,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLfloat>(yoffset));
|
||||
camera.ProcessMouseScroll(static_cast<float>(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<GLsizei>(indices.size());
|
||||
indexCount = static_cast<unsigned int>(indices.size());
|
||||
|
||||
std::vector<float> data;
|
||||
for (unsigned int i = 0; i < positions.size(); ++i)
|
||||
|
||||
@@ -120,7 +120,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLfloat>(yoffset));
|
||||
camera.ProcessMouseScroll(static_cast<float>(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<GLsizei>(indices.size());
|
||||
indexCount = static_cast<unsigned int>(indices.size());
|
||||
|
||||
std::vector<float> data;
|
||||
for (unsigned int i = 0; i < positions.size(); ++i)
|
||||
|
||||
@@ -214,7 +214,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLsizei>(indices.size());
|
||||
indexCount = static_cast<unsigned int>(indices.size());
|
||||
|
||||
std::vector<float> data;
|
||||
for (unsigned int i = 0; i < positions.size(); ++i)
|
||||
|
||||
@@ -255,7 +255,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLfloat>(yoffset));
|
||||
camera.ProcessMouseScroll(static_cast<float>(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<GLsizei>(indices.size());
|
||||
indexCount = static_cast<unsigned int>(indices.size());
|
||||
|
||||
std::vector<float> data;
|
||||
for (unsigned int i = 0; i < positions.size(); ++i)
|
||||
|
||||
@@ -343,7 +343,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLfloat>(yoffset));
|
||||
camera.ProcessMouseScroll(static_cast<float>(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<GLsizei>(indices.size());
|
||||
indexCount = static_cast<unsigned int>(indices.size());
|
||||
|
||||
std::vector<float> data;
|
||||
for (unsigned int i = 0; i < positions.size(); ++i)
|
||||
|
||||
@@ -380,7 +380,7 @@ int main()
|
||||
{
|
||||
// per-frame time logic
|
||||
// --------------------
|
||||
auto currentFrame = static_cast<GLfloat>(glfwGetTime());
|
||||
float currentFrame = static_cast<float>(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<GLfloat>(xposIn);
|
||||
auto ypos = static_cast<GLfloat>(yposIn);
|
||||
float xpos = static_cast<float>(xposIn);
|
||||
float ypos = static_cast<float>(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<GLfloat>(yoffset));
|
||||
camera.ProcessMouseScroll(static_cast<float>(yoffset));
|
||||
}
|
||||
|
||||
// renders (and builds at first invocation) a sphere
|
||||
|
||||
Reference in New Issue
Block a user