title: GLFW window glfwSwapBuffers() really really slow?
body: <p>I wanted to build a game engine in c++ and OpenGL for the first time. I have done it c#. Now i use GLFW and GLEW. But when i make a simple window and measure the fps, it is already slow. Without even rendering anything.</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;time.h&gt;
  
  #include &lt;GL/glew.h&gt;
  #include &lt;GLFW/glfw3.h&gt;
  
  #include "tortoise4.h"
  #include "src/util/File.h"
  #include "src/util//Timer.h"
  
  int main(int argc, char** argv) {
  LOG("Main");
  system("color 0a");
  
  using namespace tortoise4;
  
  Timer time;
  float timer = 0.0f;
  unsigned int frames = 0;
  
  if (!glfwInit()) return 0;
  
  GLFWwindow* window = glfwCreateWindow(1920, 1080, "Test", NULL, NULL);
  glfwMakeContextCurrent(window);
  
  if (glewInit() != GLEW_OK) return 0;
  
  while (true) {//!glfwWindowShouldClose(window)
      //int w, h;
      //glfwGetFramebufferSize(window, &amp;w, &amp;h);
      //glViewport(0, 0, w, h);
      //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      //glClearColor(0, 0, 0, 0);
  
      glfwSwapBuffers(window);
      //glfwPollEvents();
  
      frames++;
      if (time.elapsed() - timer &gt; 1.0f) {
          timer += 1.0f;
          printf("%d fps\n", frames);
          frames = 0;
      }
  }
  
  glfwDestroyWindow(window);
  glfwTerminate();
  
  system("PAUSE");
  return 0;
  </code></pre>
  
  <p>}</p>
  
  <p>When i comment out glfwSwapBuffers(Window); i get an absurd FPS, which is expected because the loops does nothing. When i call glfwSwapBuffers(Window); The fps drops to 70fps for 1080p. The fps is 30 for 1620p and 200 for 540p.</p>
  
  <p>So when i increase the resolution i get a lower fps. This is to be expected when you render things, but this is just an empty window! I cant get an empty 1620p window at 60 fps? </p>
  
  <p>The gpu seems to be at 30% workload when i swap buffers, while it shouldnt do much?</p>
  
  <p>My specs are:
  CPU: i7 4810mq
  GPU: gtx 870m
  RAM: 8 gb</p>
  
  <p>I play many games just fine, it should we able to handle a black screen...
  I tried it in x64/x86/debug/release modes. same results.</p>
  
  <p>Thanks in advance.</p>
  
  <p>EDIT: A function called _glfwGetWGLContext seems to need a lot of cpu time.
  EDIT: This issue seems only the case when i use my dedicated gpu(GTX 870M)!
  when i use the integrated one(hd 4600) it doesnt clear the screen the the right colour..</p>