fix: Rendering on macOS being broken

This commit is contained in:
WerWolv
2025-05-11 17:18:43 +02:00
parent e2735e283e
commit e9e3d25315
2 changed files with 8 additions and 7 deletions

View File

@@ -492,7 +492,7 @@ static void ImGui_ImplOpenGL3_SetupRenderState(ImDrawData* draw_data, int fb_wid
if (useFontShaders)
Gamma = 1.0f;
else
Gamma = -1.0f;
Gamma = 0.0f;
// IMHEX PATCH END
const float ortho_projection[4][4] =
{
@@ -936,7 +936,7 @@ bool ImGui_ImplOpenGL3_CreateDeviceObjects()
"{\n"
// IMHEX PATCH BEGIN
" float Gamma = Frag_mat[0][2];\n"
" if (Gamma <= 0.0)\n"
" if (Gamma <= 0.0001)\n"
// IMHEX PATCH END
" Out_Color = Frag_Color * texture(Texture, Frag_UV.st);\n"
// IMHEX PATCH BEGIN

View File

@@ -7,14 +7,15 @@ namespace hex::fonts {
class AntialiasPicker : public ContentRegistry::Settings::Widgets::DropDown {
public:
AntialiasPicker() : DropDown(
#if defined(OS_WEB)
// Only allow subpixel rendering on Windows and Linux
#if defined(OS_WINDOWS) || defined(OS_LINUX)
std::vector<UnlocalizedString>({"hex.fonts.setting.font.antialias_none", "hex.fonts.setting.font.antialias_grayscale", "hex.fonts.setting.font.antialias_subpixel"}),
std::vector<nlohmann::json>({"none", "grayscale" , "subpixel"}),
nlohmann::json("subpixel")
#else
std::vector<UnlocalizedString>({"hex.fonts.setting.font.antialias_none", "hex.fonts.setting.font.antialias_grayscale"}),
std::vector<nlohmann::json>({"none", "grayscale"}),
nlohmann::json("grayscale")
#else
std::vector<UnlocalizedString>({"hex.fonts.setting.font.antialias_none", "hex.fonts.setting.font.antialias_grayscale", "hex.fonts.setting.font.antialias_subpixel"}),
std::vector<nlohmann::json>({"none", "grayscale" , "subpixel"}),
nlohmann::json("subpixel")
#endif
){}
};