title: glfwWindowShouldClose error
body: <p>I am currently making a small c++ engine using opengl and glfw and I get a weird error while trying to call the <code>glfwWindowShouldClose(window)</code> function here is my code :</p>
  
  <pre><code>#include "Engine\Window.h"
  
  #include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      GLFWwindow* window = 0;
      Window::InitGLFW();
      Window::CreateWindow(window,640,480,"1");
  
      while (true)
      {
          if (glfwWindowShouldClose(window))//here is the error
          {
              Window::DestroyWindow(window);
              Window::EndGLFW();
              return 0;
          }
      }
      system("pause");
      return 0;
  }
  </code></pre>
  
  <p>Window.h File :</p>
  
  <pre><code>#ifndef ENGINE_WINDOW
  #define ENGINE_WINDOW
  
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  #include "GL\glew.h"
  #include "GLFW\glfw3.h"
  
  using namespace std;
  
  class Window
  {
  public:
  
  
      static bool InitGLFW();
      static void EndGLFW();
      static bool CreateWindow(GLFWwindow* Window, int Width, int Height, char* Title);
  
      static void DestroyWindow(GLFWwindow* Window);
  
  private:
      static void error_callback(int error, const char* description);
  };
  
  
  
  #endif
  </code></pre>
  
  <p>Now the Window.cpp file :</p>
  
  <pre><code>#include "Window.h"
  
  
  void Window::error_callback(int error, const char* description)
  {
      cout &lt;&lt; "Error: %s\n" &lt;&lt; description;
  }
  
  bool Window::CreateWindow(GLFWwindow* Window, int Width, int Height,char* Title)
  {
      Window = glfwCreateWindow(Width, Height, Title, NULL, NULL);
      if (!Window)
      {
          cout &lt;&lt; "Window or OpenGL context creation failed";
          return 1;
      }
      glfwMakeContextCurrent(Window);
      return 0;
  }
  
  bool Window::InitGLFW()
  {
      glfwSetErrorCallback(error_callback);
  
      if (!glfwInit())
      {
          cout &lt;&lt; "glfw Initialization failed";
          return 1;
      }
  }
  
  void Window::DestroyWindow(GLFWwindow* Window)
  {
      glfwDestroyWindow(Window);
  }
  
  void Window::EndGLFW()
  {
      glfwTerminate();
  }
  </code></pre>
  
  <p>So as you can see the the program gives me an error when its running not when I compile and the error is:</p>
  
  <pre><code>Unhandled exception to 0x56B34B9F (glfw3.dll) in Engine.exe: 0xC0000005: Access violation when reading location 0x00000014.
  </code></pre>
  
  <p>I assume the variable that <code>glfwWindowShouldClose</code> look at is not created? </p>
  
  <p>if you need to know i am running on Windows 10 and I use Visual Studio 2015</p>