title: How to create a glfw thread in c++?
body: <p>I just started using glfw to try and built a game. I'm fairly new to C and C++ but I worked with openGL before for android. I have got all the openGL stuff working and now started to try and make a thread with glfw. </p>
  
  <p>Here is some basic test code. Its similar to whats in the documentation. </p>
  
  <pre><code>#include &lt;GL/glfw.h&gt;
  #include &lt;stdio.h&gt;
  
  GLFWthread thread;
  
  void GLFWCALL testThread()
  {
      printf("hello\n");
  }
  
  int main()
  {
      printf("test\n");
  
      glfwInit();
  
      thread = glfwCreateThread(testThread, NULL);
      glfwWaitThread(thread, GLFW_WAIT);
  
      glfwTerminate();
      return 1;   
  }
  </code></pre>
  
  <p>This will compile fine in gcc and work as exspected.</p>
  
  <pre><code>$ gcc -o glthread glthread.c -lglfw
  $ ./glthread
  test
  hello
  </code></pre>
  
  <p>The problem is i want to take advantage of c++ features like classes is my game. When I compile in g++ i get this...</p>
  
  <pre><code>$ g++ -o glthread glthread.c -lglfw
  glthread.c: In function ‘int main()’:
  glthread.c:18: error: invalid conversion from ‘void (*)()’ to ‘void (*)(void*)’
  glthread.c:18: error:   initializing argument 1 of ‘GLFWthread glfwCreateThread(void (*)(void*), void*)’
  </code></pre>
  
  <p>When i put it in a class the crucial error changes to this.</p>
  
  <pre><code>error: argument of type ‘void (Renderer::)()’ does not match ‘void (*)(void*)’
  </code></pre>
  
  <p>What I basically want to know is, is it possible to create threads using glfw in c++ and if so how?</p>
  
  <p>My main PC for working on this is an arch linux machine. I can't give the versions of my compilers right now. If it will help I can get them later.</p>