title: ImGui with the glad openGL loader throws segmentation fault (core dumped)
body: <p>I am new to the ImGui library and recently i've been trying out the examples included. Everything worked like a charm until I changed the include (and functions) of <code>gl3w</code> to <code>glad</code> (the loader i would like to use). The moment I swapped between the two loaders I got a segmentation fault exception inside the <code>imgui_impl_glfw_gl3.cpp</code> file. I found a post which suggested that this may happen because of some functions failing to "bind" and producing nullpointers.</p>
  
  <p>I have located the error in <code>line 216</code> of <code>imgui_impl_glfw_gl3.cpp</code>
  this is the code in line 216:</p>
  
  <pre><code>glGetIntegerv(GL_TEXTURE_BINDING_2D, &amp;last_texture);
  </code></pre>
  
  <p>I have also changed the include file in <code>imgui_impl_glfw_gl3.cpp</code> from <code>gl3w</code> to <code>glad</code> with no results.</p>
  
  <p>This is the main function i am executing (it's the basic opengl3 example of imgui using glad):</p>
  
  <pre><code>#include "gui/imgui.h"
  #include "gui/imgui_impl_glfw_gl3.h"
  #include &lt;stdio.h&gt;
  #include &lt;glad/glad.h&gt;    // This example is using gl3w to access OpenGL functions (because it is small). You may use glew/glad/glLoadGen/etc. whatever already works for you.
  #include &lt;GLFW/glfw3.h&gt;
  
  static void error_callback(int error, const char* description)
  {
      fprintf(stderr, "Error %d: %s\n", error, description);
  }
  
  int main(int, char**)
  {
      // Setup window
      glfwSetErrorCallback(error_callback);
      if (!glfwInit())
          return 1;
      glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
      glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
      glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
  
      GLFWwindow* window = glfwCreateWindow(1280, 720, "ImGui OpenGL3 example", NULL, NULL);
      glfwMakeContextCurrent(window);
      glfwSwapInterval(1); // Enable vsync
      glfwInit();
  
      // Setup ImGui binding
      ImGui_ImplGlfwGL3_Init(window, true);
  
      // Setup style
      //ImGui::StyleColorsDark();
      ImGui::StyleColorsClassic();
  
      bool show_demo_window = true;
      bool show_another_window = false;
      bool algo = true;
      ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
  
      // Main loop
      while (!glfwWindowShouldClose(window))
      {
  
          glfwPollEvents();
          ImGui_ImplGlfwGL3_NewFrame();
  
          // 1. Show a simple window.
          // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets automatically appears in a window called "Debug".
          {
              static float f = 0.0f;
              static int counter = 0;
              ImGui::Text("Hello, world!");                           // Display some text (you can use a format string too)
              ImGui::SliderFloat("float", &amp;f, 0.0f, 1.0f);            // Edit 1 float using a slider from 0.0f to 1.0f    
              ImGui::ColorEdit3("COLORINES", (float*)&amp;clear_color); // Edit 3 floats representing a color
  
              ImGui::Checkbox("Demo Window", &amp;show_demo_window);      // Edit bools storing our windows open/close state
              ImGui::Checkbox("Booleanooooo", &amp;algo);
              ImGui::Checkbox("Another Window", &amp;show_another_window);
  
              if (ImGui::Button("Button"))                            // Buttons return true when clicked (NB: most widgets return true when edited/activated)
                  counter++;
              ImGui::SameLine();
              ImGui::Text("counter = %d", counter);
              ImGui::Text("pues se ve que hay texto: %d", algo);
              ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
          }
  
          {
              ImGui::Begin("VENTANA WAPA");
              ImGui::Text("POS SA QUEDAO BUENA VENTANA");
  
              static float yee = 0.0f;
              ImGui::SliderFloat("lel", &amp;yee,1.0f,0.5f);
  
              ImGui::End();
          }
  
          // 2. Show another simple window. In most cases you will use an explicit Begin/End pair to name your windows.
          if (show_another_window)
          {
              ImGui::Begin("Another Window", &amp;show_another_window);
              ImGui::Text("Hello from another window!");
              if (ImGui::Button("Close Me"))
                  show_another_window = false;
              ImGui::End();
          }
  
          // 3. Show the ImGui demo window. Most of the sample code is in ImGui::ShowDemoWindow(). Read its code to learn more about Dear ImGui!
          if (show_demo_window)
          {
              ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiCond_FirstUseEver); // Normally user code doesn't need/want to call this because positions are saved in .ini file anyway. Here we just want to make the demo initial state a bit more friendly!
              ImGui::ShowDemoWindow(&amp;show_demo_window);
          }
  
          // Rendering
          int display_w, display_h;
          glfwGetFramebufferSize(window, &amp;display_w, &amp;display_h);
          glViewport(0, 0, display_w, display_h);
          glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
          glClear(GL_COLOR_BUFFER_BIT);
          ImGui::Render();
          glfwSwapBuffers(window);
      }
  
      // Cleanup
      //ImGui_ImplGlfwGL3_Shutdown();
      glfwTerminate();
  
      return 0;
  }
  </code></pre>
  
  <p>I have no clue why this is happenning and I'm pretty new to openGL an ImGui so, any ideas? :(</p>