I'm trying to open a window using glfw3, and paint the background blue. Here's my code:
#include <glad\glad.h>
#include <GLFW/glfw3.h>
GLFWwindow* window;
int main( void )
{
int windowWidth = 1024;
int windowHeight = 768;
glfwInit();
glfwWindowHint(GLFW_SAMPLES, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
window = glfwCreateWindow( 1024, 768, "Tutorial 14 - Render To Texture", NULL, NULL);
glfwMakeContextCurrent(window);
glfwGetFramebufferSize(window, &windowWidth, &windowHeight);
glfwSetInputMode(window, GLFW_STICKY_KEYS, GL_TRUE);
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
glfwPollEvents();
// Dark blue background
glClearColor(0.0f, 0.0f, 0.4f, 0.0f);
return 0;
}
At glClearColor, it throws
Unhandled exception at 0x74D2CB49 in rendertotexture.exe: 0xC0000005: Access violation executing location 0x00000000.
I already tried GLFW exception on glClearColor and glClear. I'm using Visual Studio 2017.