Skip to content

Commit

Permalink
Fix Dear ImGui colors on Big Endian systems
Browse files Browse the repository at this point in the history
dhewm#625 (comment)
confirms that it's broken

for the fix, see
ocornut/imgui#6732 (comment)
ocornut/imgui#5190
  • Loading branch information
DanielGibson committed Oct 31, 2024
1 parent 7e28637 commit e0d1a96
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions neo/libs/imgui/imconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,13 @@ namespace ImGui
void MyFunction(const char* name, MyMatrix44* mtx);
}
*/

// DG: on Big Endian systems the order of color channels in an uint32 color is inverted.
// this seems to be the official way to support Big Endian platforms in ImGUI:
#if D3_IS_BIG_ENDIAN
#define IM_COL32_R_SHIFT 24
#define IM_COL32_G_SHIFT 16
#define IM_COL32_B_SHIFT 8
#define IM_COL32_A_SHIFT 0
#define IM_COL32_A_MASK 0x000000FF
#endif

0 comments on commit e0d1a96

Please sign in to comment.