Skip to content

[Bug] Build error on system with GLES3: use of undeclared identifier GL_SRC1_COLORΒ #2608

@leha-bot

Description

@leha-bot

Operating System

Linux

What's the issue you encountered?

The file <GLES3/gl3.h> used here:

#include <GLES3/gl3.h> // Use GL ES 3
- doesn't contain this GLES identifier (it seems GLES doesn't support the Dual-Source blending, as WebGL (and Emscripten) doesn't support it either). I think the possible fix is to disable this patch for GLES2/3 at this line:

I'll make a PR with this fix.

How can the issue be reproduced?

  1. Set IMGUI_IMPL_OPENGL_ES3 #define to 1 (e.g., via CMake, or build on specific Linux-like environment (e.g., termux)
  2. Try to build
  3. Get this error:
Building CXX object lib/third_party/imgui/backend/CMakeFiles/imgui_backend.dir/source/imgui_impl_opengl3.cpp.o
/data/data/com.termux/files/home/ImHex/lib/third_party/imgui/backend/source/imgui_impl_opengl3.cpp:488:29: error:
      use of undeclared identifier 'GL_SRC1_COLOR'
  488 |         glBlendFuncSeparate(GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR,G...
      |                             ^~~~~
/data/data/com.termux/files/home/ImHex/lib/third_party/imgui/backend/source/imgui_impl_opengl3.cpp:488:44: error:
      use of undeclared identifier 'GL_ONE_MINUS_SRC1_COLOR'
  488 |         glBlendFuncSeparate(GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR,G...
      |                                            ^~~~~~~
2 errors generated.
make[3]: *** [lib/third_party/imgui/backend/CMakeFiles/imgui_backend.dir/build.make:79: lib/third_party/imgui/backend/CMakeFiles/imgui_backend.dir/source/imgui_impl_opengl3.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:3243: lib/third_party/imgui/backend/CMakeFiles/imgui_backend.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:3250: lib/third_party/imgui/backend/CMakeFiles/imgui_backend.dir/rule] Error 2
make: *** [Makefile:524: imgui_backend] Error 2

ImHex Version

1.39.0.WIP (hash: 03dd20c)

ImHex Build Type

  • Nightly or built from sources

Installation type

build from source

Additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions