Getting started content code-rework updates.

This commit is contained in:
Joey de Vries
2017-05-29 20:36:10 +02:00
parent bc718162b1
commit 5846428705
18 changed files with 131 additions and 80 deletions

View File

@@ -8,6 +8,10 @@
void framebuffer_size_callback(GLFWwindow* window, int width, int height);
void processInput(GLFWwindow *window);
// settings
const unsigned int SCR_WIDTH = 1280;
const unsigned int SCR_HEIGHT = 720;
int main()
{
// glfw: initialize and configure
@@ -20,14 +24,14 @@ int main()
// glfw window creation
// --------------------
GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", NULL, NULL);
glfwMakeContextCurrent(window);
GLFWwindow* window = glfwCreateWindow(SCR_WIDTH, SCR_HEIGHT, "LearnOpenGL", NULL, NULL);
if (window == NULL)
{
std::cout << "Failed to create GLFW window" << std::endl;
glfwTerminate();
return -1;
}
glfwMakeContextCurrent(window);
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
// glad: load all OpenGL function pointers
@@ -38,7 +42,6 @@ int main()
return -1;
}
// build and compile our shader program
// ------------------------------------
Shader ourShader("3.3.shader.vs", "3.3.shader.fs"); // you can name your shader files however you like
@@ -50,7 +53,6 @@ int main()
0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, // bottom right
-0.5f, -0.5f, 0.0f, 0.0f, 1.0f, 0.0f, // bottom left
0.0f, 0.5f, 0.0f, 0.0f, 0.0f, 1.0f // top
};
unsigned int VBO, VAO;