diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index 6fc0e6c5c..c06698b9f 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -34,8 +34,11 @@ #include // Required for: NULL #include // Required for: sinf() -// To make it work with the older RLGL module just comment the line below -#define RAYLIB_NEW_RLGL +#if defined(PLATFORM_DESKTOP) + #define GLSL_VERSION 330 +#else // PLATFORM_ANDROID, PLATFORM_WEB + #define GLSL_VERSION 100 +#endif //-------------------------------------------------------------------------------------- // Globals @@ -50,7 +53,6 @@ bool SHOW_TEXT_BOUNDRY = false; //-------------------------------------------------------------------------------------- // Data Types definition //-------------------------------------------------------------------------------------- - // Configuration structure for waving the text typedef struct WaveTextConfig { Vector3 waveRange; @@ -66,7 +68,7 @@ static void DrawTextCodepoint3D(Font font, int codepoint, Vector3 position, floa // Draw a 2D text in 3D space static void DrawText3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, Color tint); -// Draw a 2D text in 3D space and wave the parts that start with `~~` and end with `~~`. +// Draw a 2D text in 3D space and wave the parts that start with '~~' and end with '~~' // This is a modified version of the original code by @Nighten found here https://github.com/NightenDushi/Raylib_DrawTextStyle static void DrawTextWave3D(Font font, const char *text, Vector3 position, float fontSize, float fontSpacing, float lineSpacing, bool backface, WaveTextConfig *config, float time, Color tint); // Measure a text in 3D ignoring the `~~` chars. @@ -128,7 +130,7 @@ int main(void) Color dark = RED; // Load the alpha discard shader - Shader alphaDiscard = LoadShader(NULL, "resources/shaders/glsl330/alpha_discard.fs"); + Shader alphaDiscard = LoadShader(NULL, TextFormat("resources/shaders/glsl%i/alpha_discard.fs", GLSL_VERSION)); // Array filled with multiple random colors (when multicolor mode is set) Color multi[TEXT_MAX_LAYERS] = {0}; diff --git a/examples/textures/textures_mouse_painting.c b/examples/textures/textures_mouse_painting.c index c0e426232..e2a2b6081 100644 --- a/examples/textures/textures_mouse_painting.c +++ b/examples/textures/textures_mouse_painting.c @@ -210,7 +210,7 @@ int main(void) { DrawRectangle(0, 0, GetScreenWidth(), GetScreenHeight(), Fade(RAYWHITE, 0.8f)); DrawRectangle(0, 150, GetScreenWidth(), 80, BLACK); - DrawText("IMAGE SAVED: my_amazing_texture_painting.png", 150, 180, 20, RAYWHITE); + DrawText("IMAGE SAVED!", 150, 180, 20, RAYWHITE); } EndDrawing();