imgui_impl_opengl2.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline)
  2. // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
  3. // Implemented features:
  4. // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
  5. // Missing features or Issues:
  6. // [ ] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
  7. // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
  8. // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
  9. // Learn about Dear ImGui:
  10. // - FAQ https://dearimgui.com/faq
  11. // - Getting Started https://dearimgui.com/getting-started
  12. // - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
  13. // - Introduction, links and more at the top of imgui.cpp
  14. // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
  15. // **Prefer using the code in imgui_impl_opengl3.cpp**
  16. // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read.
  17. // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more
  18. // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might
  19. // confuse your GPU driver.
  20. // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API.
  21. #pragma once
  22. #include "imgui.h" // IMGUI_IMPL_API
  23. #ifndef IMGUI_DISABLE
  24. // Follow "Getting Started" link and check examples/ folder to learn about using backends!
  25. IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init();
  26. IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown();
  27. IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame();
  28. IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data);
  29. // Called by Init/NewFrame/Shutdown
  30. IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture();
  31. IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture();
  32. IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects();
  33. IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects();
  34. #endif // #ifndef IMGUI_DISABLE