mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 01:19:19 +02:00
cleanup imgui impl include as we're using glad anyway
This commit is contained in:
@@ -31,25 +31,8 @@
|
|||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_opengl2.h"
|
#include "imgui_impl_opengl2.h"
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
||||||
#include <stddef.h> // intptr_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h> // intptr_t
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Include OpenGL header (without an OpenGL loader) requires a bit of fiddling
|
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code
|
||||||
#if defined(_WIN32) && !defined(APIENTRY)
|
|
||||||
#define APIENTRY __stdcall // It is customary to use APIENTRY for OpenGL function pointer declarations on all platforms. Additionally, the Windows OpenGL header needs APIENTRY.
|
|
||||||
#endif
|
|
||||||
#if defined(_WIN32) && !defined(WINGDIAPI)
|
|
||||||
#define WINGDIAPI __declspec(dllimport) // Some Windows OpenGL headers need this
|
|
||||||
#endif
|
|
||||||
#if defined(__APPLE__)
|
|
||||||
#define GL_SILENCE_DEPRECATION
|
|
||||||
#include <OpenGL/gl.h>
|
|
||||||
#else
|
|
||||||
#include <GL/gl.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// OpenGL Data
|
// OpenGL Data
|
||||||
static GLuint g_FontTexture = 0;
|
static GLuint g_FontTexture = 0;
|
||||||
|
|||||||
@@ -70,57 +70,9 @@
|
|||||||
|
|
||||||
#include "imgui.h"
|
#include "imgui.h"
|
||||||
#include "imgui_impl_opengl3.h"
|
#include "imgui_impl_opengl3.h"
|
||||||
#include <stdio.h>
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
|
|
||||||
#include <stddef.h> // intptr_t
|
|
||||||
#else
|
|
||||||
#include <stdint.h> // intptr_t
|
|
||||||
#endif
|
|
||||||
#if defined(__APPLE__)
|
|
||||||
#include "TargetConditionals.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Auto-detect GL version
|
|
||||||
#if !defined(IMGUI_IMPL_OPENGL_ES2) && !defined(IMGUI_IMPL_OPENGL_ES3)
|
|
||||||
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__))
|
|
||||||
#define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es"
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
|
||||||
#elif defined(__EMSCRIPTEN__)
|
|
||||||
#define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100"
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GL3W
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GLEW
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_GLAD
|
|
||||||
#undef IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// GL includes
|
|
||||||
#if defined(IMGUI_IMPL_OPENGL_ES2)
|
|
||||||
#include <GLES2/gl2.h>
|
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_ES3)
|
|
||||||
#if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV))
|
|
||||||
#include <OpenGLES/ES3/gl.h> // Use GL ES 3
|
|
||||||
#else
|
|
||||||
#include <GLES3/gl3.h> // Use GL ES 3
|
|
||||||
#endif
|
|
||||||
#else
|
|
||||||
// About Desktop OpenGL function loaders:
|
|
||||||
// Modern desktop OpenGL doesn't have a standard portable header file to load OpenGL function pointers.
|
|
||||||
// Helper libraries are often used for this purpose! Here we are supporting a few common ones (gl3w, glew, glad).
|
|
||||||
// You may use another loader/header of your choice (glext, glLoadGen, etc.), or chose to manually implement your own.
|
|
||||||
#if defined(IMGUI_IMPL_OPENGL_LOADER_GL3W)
|
|
||||||
#include <GL/gl3w.h> // Needs to be initialized with gl3wInit() in user's code
|
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLEW)
|
|
||||||
#include <GL/glew.h> // Needs to be initialized with glewInit() in user's code
|
|
||||||
#elif defined(IMGUI_IMPL_OPENGL_LOADER_GLAD)
|
|
||||||
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code
|
#include <glad/glad.h> // Needs to be initialized with gladLoadGL() in user's code
|
||||||
#else
|
|
||||||
#include IMGUI_IMPL_OPENGL_LOADER_CUSTOM
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// OpenGL Data
|
// OpenGL Data
|
||||||
static char g_GlslVersionString[128] = "";
|
static char g_GlslVersionString[128] = "";
|
||||||
|
|||||||
Reference in New Issue
Block a user