Skip to content

Commit

Permalink
check for RFONT_GET_WORLD_X
Browse files Browse the repository at this point in the history
  • Loading branch information
ColleagueRiley committed Dec 23, 2024
1 parent 1481ed4 commit aed830d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions RFont.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,15 @@ inline void RFont_render_legacy(u8 legacy);
#include "stb_truetype.h"
#endif

#ifdef RFONT_GET_TEXPOSX
#define RFONT_GET_TEXPOSX(x) (float)((float)(x) / (float)(RFONT_ATLAS_WIDTH))
#define RFONT_GET_TEXPOSY(y) (float)((float)(y) / (float)(RFONT_ATLAS_HEIGHT))
#endif

#ifndef RFONT_GET_WORLD_X
#define RFONT_GET_WORLD_X(x, w) (float)((x) / (((w) / 2.0f)) - 1.0f)
#define RFONT_GET_WORLD_Y(y, h) (float)(1.0f - ((y) / ((h) / 2.0f)))
#endif

/*
stb defines required by RFont
Expand Down
2 changes: 1 addition & 1 deletion example/ext/rglLoad.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,4 +204,4 @@ int RGL_loadGL3(RGLloadfunc proc) {
return 0;
}
#endif
#endif
#endif

0 comments on commit aed830d

Please sign in to comment.