Explorar el Código

Updated for resources scanning system

pull/5085/head
Ray hace 2 meses
padre
commit
e130775e0d
Se han modificado 2 ficheros con 8 adiciones y 6 borrados
  1. +7
    -5
      examples/text/text_draw_3d.c
  2. +1
    -1
      examples/textures/textures_mouse_painting.c

+ 7
- 5
examples/text/text_draw_3d.c Ver fichero

@ -34,8 +34,11 @@
#include <stddef.h> // Required for: NULL
#include <math.h> // 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, n">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};

+ 1
- 1
examples/textures/textures_mouse_painting.c Ver fichero

@ -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();

Cargando…
Cancelar
Guardar