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