raylib-extras/rlImGui-cs

M1 no visible ImGui output

Closed this issue · 2 comments

Running this wrapper on an M1 machine will result in no visible / cut off output.

This problem can be solved on M1's (.NET 6.0) commenting out:
EnableScissor and Rlgl.rlDisableScissorTest() in rlImGui.cs.

This is not the correct fix for this issue. While it may look correct in some demos, it won't produce correct visuals, The scissor is needed to clip controls to windows and scroll areas.

The core problem is with Apple's OpenGL drivers. They do not properly scale the scissor buffer on high DPI displays (this is discussed in issue #4 ).

A MacOS specific workaround has been applied to the C/C++ version of rlImGui (raylib-extras/rlImGui@82704a7) But can not be applied to the C# version.

Raylib does not export the GLFW function needed to get the display scale to pre-scale the scissor buffer to make it work on MacOS. This means that C# can't access the function and can't get the display scale.

Apple has deprecated it's use of the OpenGL API (preferring everyone to use the Metal2/3 APIs). This means they will not fix these bugs with the drivers, ever, leaving there no generic fix for C# on MacOS. At some point OpenGL will no longer work on Macs, that's just the sad truth.

If you can come up with a platform specific way to get the display scale on MacOS without GLFW, you can apply the same kind of scale fix to rlImGui-cs as is done for the C/C++ version.

Sorry for the late reply. Can't you get that information by calling GetWindowScaleDPI from C# Raylib? This gives the scaling information and is available / exported. I can't test it right now as I do not own a Mac myself.