summaryrefslogtreecommitdiffhomepage
path: root/src/text.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-08-11 19:02:15 +0200
committerraysan5 <[email protected]>2021-08-11 19:02:15 +0200
commitb6541b7a558304f8a6e27533195c898ea728b712 (patch)
treed12013ad21e59b2a6de79751bde1f2dac7587443 /src/text.c
parent7e27c2ffa82337c6b4649295b4df1c7e1829c7fc (diff)
downloadraylib-b6541b7a558304f8a6e27533195c898ea728b712.tar.gz
raylib-b6541b7a558304f8a6e27533195c898ea728b712.zip
REVIEWED: DrawTextPro()
WARNING: DrawTextPro() requires including `rlgl.h`, before it was only dependant on `textures` module.
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/text.c b/src/text.c
index 891c5497..1724153f 100644
--- a/src/text.c
+++ b/src/text.c
@@ -53,6 +53,8 @@
#include "config.h" // Defines module configuration flags
#endif
+#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 2.1, 3.3+ or ES2 -> Only DrawTextPro()
+
#include <stdlib.h> // Required for: malloc(), free()
#include <stdio.h> // Required for: vsprintf()
#include <string.h> // Required for: strcmp(), strstr(), strcpy(), strncpy() [Used in TextReplace()], sscanf() [Used in LoadBMFont()]
@@ -893,15 +895,13 @@ void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, f
// Draw text using Font and pro parameters (rotation)
void DrawTextPro(Font font, const char *text, Vector2 position, Vector2 origin, float rotation, float fontSize, float spacing, Color tint)
{
- // TODO: Not working... why???
-
rlPushMatrix();
- //rlTranslatef(position.x, position.y, 0.0f);
+ rlTranslatef(position.x, position.y, 0.0f);
rlRotatef(rotation, 0.0f, 0.0f, 1.0f);
rlTranslatef(-origin.x, -origin.y, 0.0f);
- DrawTextEx(font, text, (Vector2){ position.x, position.y }, fontSize, spacing, tint);
+ DrawTextEx(font, text, (Vector2){ 0.0f, 0.0f }, fontSize, spacing, tint);
rlPopMatrix();
}