2020-10-12 17:34:22 +02:00
|
|
|
// dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline
|
2019-09-22 23:19:04 +02:00
|
|
|
// - Desktop GL: 2.x 3.x 4.x
|
2019-03-03 23:14:30 +01:00
|
|
|
// - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0)
|
2020-10-12 17:34:22 +02:00
|
|
|
// This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..)
|
2018-06-08 19:37:33 +02:00
|
|
|
|
|
|
|
// Implemented features:
|
2019-10-16 11:23:15 +02:00
|
|
|
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID!
|
2023-02-07 12:24:42 +01:00
|
|
|
// [x] Renderer: Large meshes support (64k+ vertices) with 16-bit indices (Desktop OpenGL only).
|
2018-06-08 19:37:33 +02:00
|
|
|
|
2023-05-23 11:43:16 +02:00
|
|
|
// About WebGL/ES:
|
|
|
|
// - You need to '#define IMGUI_IMPL_OPENGL_ES2' or '#define IMGUI_IMPL_OPENGL_ES3' to use WebGL or OpenGL ES.
|
|
|
|
// - This is done automatically on iOS, Android and Emscripten targets.
|
|
|
|
// - For other targets, the define needs to be visible from the imgui_impl_opengl3.cpp compilation unit. If unsure, define globally or in imconfig.h.
|
|
|
|
|
2021-08-19 11:42:15 +02:00
|
|
|
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
|
2021-05-27 13:59:35 +02:00
|
|
|
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
|
2023-09-11 13:47:08 +02:00
|
|
|
// Learn about Dear ImGui:
|
|
|
|
// - FAQ https://dearimgui.com/faq
|
|
|
|
// - Getting Started https://dearimgui.com/getting-started
|
|
|
|
// - Documentation https://dearimgui.com/docs (same as your local docs/ folder).
|
|
|
|
// - Introduction, links and more at the top of imgui.cpp
|
2018-07-04 19:06:28 +02:00
|
|
|
|
2018-06-08 19:37:33 +02:00
|
|
|
// About GLSL version:
|
2022-10-11 12:22:29 +02:00
|
|
|
// The 'glsl_version' initialization parameter should be nullptr (default) or a "#version XXX" string.
|
2019-03-03 23:14:30 +01:00
|
|
|
// On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es"
|
|
|
|
// Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp.
|
2018-06-08 19:37:33 +02:00
|
|
|
|
2018-11-01 20:56:36 +01:00
|
|
|
#pragma once
|
2020-04-07 11:02:29 +02:00
|
|
|
#include "imgui.h" // IMGUI_IMPL_API
|
2023-07-13 11:27:52 +02:00
|
|
|
#ifndef IMGUI_DISABLE
|
2020-04-06 20:23:57 +02:00
|
|
|
|
2019-09-22 23:19:04 +02:00
|
|
|
// Backend API
|
2022-10-11 12:22:29 +02:00
|
|
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = nullptr);
|
2019-09-22 23:19:04 +02:00
|
|
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown();
|
|
|
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame();
|
|
|
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data);
|
|
|
|
|
|
|
|
// (Optional) Called by Init/NewFrame/Shutdown
|
|
|
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture();
|
|
|
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
|
|
|
|
IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
|
|
|
|
IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
|
|
|
|
2024-04-18 21:26:49 +02:00
|
|
|
// Configuration flags to add in your imconfig file:
|
|
|
|
//#define IMGUI_IMPL_OPENGL_ES2 // Enable ES 2 (Auto-detected on Emscripten)
|
|
|
|
//#define IMGUI_IMPL_OPENGL_ES3 // Enable ES 3 (Auto-detected on iOS/Android)
|
2019-03-03 23:32:40 +01:00
|
|
|
|
2021-08-19 11:42:15 +02:00
|
|
|
// You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line.
|
2020-05-21 13:49:06 +02:00
|
|
|
#if !defined(IMGUI_IMPL_OPENGL_ES2) \
|
2021-08-19 11:42:15 +02:00
|
|
|
&& !defined(IMGUI_IMPL_OPENGL_ES3)
|
2020-05-21 13:49:06 +02:00
|
|
|
|
|
|
|
// Try to detect GLES on matching platforms
|
|
|
|
#if defined(__APPLE__)
|
2021-08-24 15:26:55 +02:00
|
|
|
#include <TargetConditionals.h>
|
2018-08-04 16:09:56 +02:00
|
|
|
#endif
|
2020-05-21 13:49:06 +02:00
|
|
|
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
|
|
|
|
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
|
2022-04-13 20:38:45 +02:00
|
|
|
#elif defined(__EMSCRIPTEN__) || defined(__amigaos4__)
|
2020-05-21 13:49:06 +02:00
|
|
|
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
|
|
|
|
#else
|
2021-08-19 11:42:15 +02:00
|
|
|
// Otherwise imgui_impl_opengl3_loader.h will be used.
|
2020-05-21 13:49:06 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
2023-07-13 11:27:52 +02:00
|
|
|
|
|
|
|
#endif // #ifndef IMGUI_DISABLE
|