-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch to add Haiku support #8143
Comments
Markup swallowed the _ _ HAIKU _ _ |
Can you clarify precisely what happens if you try to compile the backend as is? |
Without the header files, it fails to find any GL functions. If I only add #include "imgui_impl_opengl3_loader.h", then it fails to link due to unresolved imgl3wProcs. The entire point of the function pointer dance is to allow the existance of OS vendor libopengl32.dll and HW vendor accelerated opengl, and the function dance maps to both (since you can actually mix and match GL functions from libopengl and HW version). MS being MS, they are stuck on ancient version of opengl headers. Early Linux copied this behaviour from Win32, hence why you still need extension wranglers like glew, glee and siblings. Haiku has none of this nonsense, it allows runtime mixing and overridding, the ELF loader does late binding based on link order. It just works. With environmental variables you can even specify GL version override, so you can go from 1.1 to 4.5 on same binary. You can patch any system library using this technique, so much so that the naive application innocently believes that it is calling a harmless system library function like printf( ), while the injected shared library will override this and send data across the internet (or similar). For hacker devs, this is fantastic, but for security minded folks, this is a No-No, hence why some OS's dont allow late library overriding. So what does my patch do? |
You shouldn’t have to “add” any include. It’s already included by the backend. Please report exact build error on the system with vanilla files, thanks! I am not denying that your setup may have more complete headers but presumably we should be able to use the loader and get things to still work? |
Version/Branch of Dear ImGui:
any
Back-ends:
imgui_impl_opengl3
Compiler, OS:
gcc 13.3
Full config/build information:
No response
Details:
To support Haiku OS, all that is required is to append the following code to imgui_impl_opengl3.cpp (near the top)
#if defined(HAIKU)
#define GL_GLEXT_PROTOTYPES 1
#include <GL/gl.h>
#include <GL/glext.h>
#define IMGUI_IMPL_OPENGL_LOADER_CUSTOM
#endif
Haiku doesn't require the OpenGL function pointer dance. The app should link to libGL.so (tested with libglfw.so)
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: