mirror of
https://github.com/cimgui/cimgui.git
synced 2025-08-14 21:48:30 +01:00
add opengl2 implementation
This commit is contained in:
@@ -1038,6 +1038,18 @@ struct GLFWwindow;
|
|||||||
// About GLSL version:
|
// About GLSL version:
|
||||||
// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
|
// The 'glsl_version' initialization parameter defaults to "#version 150" if NULL.
|
||||||
// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
|
// Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure!
|
||||||
|
// Called by Init/NewFrame/Shutdown
|
||||||
|
// ImGui Renderer for: OpenGL2 (legacy OpenGL, fixed pipeline)
|
||||||
|
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL, Win32, custom..)
|
||||||
|
// Implemented features:
|
||||||
|
// [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID in imgui.cpp.
|
||||||
|
// **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)**
|
||||||
|
// **Prefer using the code in imgui_impl_opengl3.cpp**
|
||||||
|
// This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read.
|
||||||
|
// If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more
|
||||||
|
// complicated, will require your code to reset every single OpenGL attributes to their initial state, and might
|
||||||
|
// confuse your GPU driver.
|
||||||
|
// The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API.
|
||||||
// Called by Init/NewFrame/Shutdown
|
// Called by Init/NewFrame/Shutdown
|
||||||
struct GlyphRangesBuilder
|
struct GlyphRangesBuilder
|
||||||
{
|
{
|
||||||
@@ -1726,6 +1738,14 @@ CIMGUI_API bool ImGui_ImplOpenGL3_CreateFontsTexture();
|
|||||||
CIMGUI_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
|
CIMGUI_API void ImGui_ImplOpenGL3_DestroyFontsTexture();
|
||||||
CIMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
|
CIMGUI_API bool ImGui_ImplOpenGL3_CreateDeviceObjects();
|
||||||
CIMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
CIMGUI_API void ImGui_ImplOpenGL3_DestroyDeviceObjects();
|
||||||
|
CIMGUI_API bool ImGui_ImplOpenGL2_Init();
|
||||||
|
CIMGUI_API void ImGui_ImplOpenGL2_Shutdown();
|
||||||
|
CIMGUI_API void ImGui_ImplOpenGL2_NewFrame();
|
||||||
|
CIMGUI_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data);
|
||||||
|
CIMGUI_API bool ImGui_ImplOpenGL2_CreateFontsTexture();
|
||||||
|
CIMGUI_API void ImGui_ImplOpenGL2_DestroyFontsTexture();
|
||||||
|
CIMGUI_API bool ImGui_ImplOpenGL2_CreateDeviceObjects();
|
||||||
|
CIMGUI_API void ImGui_ImplOpenGL2_DestroyDeviceObjects();
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////hand written functions
|
/////////////////////////hand written functions
|
||||||
|
@@ -12,10 +12,10 @@ set PATH=%PATH%;C:\mingw32\bin;C:\luaGL;
|
|||||||
:: gcc -E -P no #pragma location information
|
:: gcc -E -P no #pragma location information
|
||||||
|
|
||||||
::generate preprocessed file
|
::generate preprocessed file
|
||||||
gcc -E -C -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../../imgui/imgui.h ../../imgui/examples/imgui_impl_glfw.h ../../imgui/examples/imgui_impl_opengl3.h > 1.txt
|
gcc -E -C -DIMGUI_DISABLE_OBSOLETE_FUNCTIONS -DIMGUI_API="" -DIMGUI_IMPL_API="" ../../imgui/imgui.h ../../imgui/examples/imgui_impl_glfw.h ../../imgui/examples/imgui_impl_opengl3.h ../../imgui/examples/imgui_impl_opengl2.h > 1.txt
|
||||||
|
|
||||||
::process preprocessed file
|
::process preprocessed file
|
||||||
type 1.txt | luajit.exe ./generator.lua true imgui imgui_impl_glfw imgui_impl_opengl3 > out.txt
|
type 1.txt | luajit.exe ./generator.lua true imgui imgui_impl_glfw imgui_impl_opengl3 imgui_impl_opengl2 > out.txt
|
||||||
|
|
||||||
::copy cimgui.h and cimgui.cpp
|
::copy cimgui.h and cimgui.cpp
|
||||||
copy .\cimgui.h ..\cimgui.h
|
copy .\cimgui.h ..\cimgui.h
|
||||||
|
Reference in New Issue
Block a user