From: beeanyew Date: Mon, 17 May 2021 20:39:04 +0000 (+0200) Subject: Update Pi4 raylib dependencies X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=df3221c950ed9213701954d8967e92ce4d718e36;p=pistorm Update Pi4 raylib dependencies --- diff --git a/raylib_pi4_test/config.h b/raylib_pi4_test/config.h index 54fadb2..99cb1d4 100644 --- a/raylib_pi4_test/config.h +++ b/raylib_pi4_test/config.h @@ -25,6 +25,8 @@ * **********************************************************************************************/ +#define RAYLIB_VERSION "3.7" + //------------------------------------------------------------------------------------ // Module: core - Configuration Flags //------------------------------------------------------------------------------------ diff --git a/raylib_pi4_test/core.c b/raylib_pi4_test/core.c index d33cc04..a6a8505 100644 --- a/raylib_pi4_test/core.c +++ b/raylib_pi4_test/core.c @@ -116,6 +116,8 @@ // Check if config flags have been externally provided on compilation line #if !defined(EXTERNAL_CONFIG_FLAGS) #include "config.h" // Defines module configuration flags +#else + #define RAYLIB_VERSION "3.7" #endif #include "utils.h" // Required for: TRACELOG macros @@ -919,7 +921,6 @@ void CloseWindow(void) if (CORE.Input.Gamepad.threadId) pthread_join(CORE.Input.Gamepad.threadId, NULL); #endif - CORE.Window.ready = false; TRACELOG(LOG_INFO, "Window closed successfully"); } diff --git a/raylib_pi4_test/libraylib.a b/raylib_pi4_test/libraylib.a index fec350e..d8b3e9c 100644 Binary files a/raylib_pi4_test/libraylib.a and b/raylib_pi4_test/libraylib.a differ diff --git a/raylib_pi4_test/raylib.h b/raylib_pi4_test/raylib.h index bb67c12..ead617c 100644 --- a/raylib_pi4_test/raylib.h +++ b/raylib_pi4_test/raylib.h @@ -81,8 +81,6 @@ #include // Required for: va_list - Only used by TraceLogCallback -#define RAYLIB_VERSION "3.7.0" - #if defined(_WIN32) // Microsoft attibutes to tell compiler that symbols are imported/exported from a .dll #if defined(BUILD_LIBTYPE_SHARED) @@ -418,7 +416,7 @@ typedef struct BoundingBox { // Wave type, defines audio wave data typedef struct Wave { - unsigned int sampleCount; // Total number of samples (considering channels!) + unsigned int sampleCount; // Total number of samples unsigned int sampleRate; // Frequency (samples per second) unsigned int sampleSize; // Bit depth (bits per sample): 8, 16, 32 (24 not supported) unsigned int channels; // Number of channels (1-mono, 2-stereo) @@ -780,6 +778,7 @@ typedef enum { PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, // 8*2 bpp (2 channels) PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp + PIXELFORMAT_UNCOMPRESSED_RGB565_BE, // 16 bpp (big endian) PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) diff --git a/raylib_pi4_test/rlgl.h b/raylib_pi4_test/rlgl.h index b3eddf0..bb0bc23 100644 --- a/raylib_pi4_test/rlgl.h +++ b/raylib_pi4_test/rlgl.h @@ -346,6 +346,7 @@ typedef enum { PIXELFORMAT_UNCOMPRESSED_GRAYSCALE = 1, // 8 bit per pixel (no alpha) PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA, PIXELFORMAT_UNCOMPRESSED_R5G6B5, // 16 bpp + PIXELFORMAT_UNCOMPRESSED_RGB565_BE, // 16 bpp (big endian) PIXELFORMAT_UNCOMPRESSED_R8G8B8, // 24 bpp PIXELFORMAT_UNCOMPRESSED_R5G5B5A1, // 16 bpp (1 bit alpha) PIXELFORMAT_UNCOMPRESSED_R4G4B4A4, // 16 bpp (4 bit alpha) @@ -750,8 +751,10 @@ RLAPI void rlLoadDrawQuad(void); // Load and draw a quad #define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE #endif +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #if defined(GRAPHICS_API_OPENGL_11) #define GL_UNSIGNED_SHORT_5_6_5 0x8363 + //#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 #define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 #define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 #endif @@ -2662,6 +2665,7 @@ void rlGetGlTextureFormats(int format, unsigned int *glInternalFormat, unsigned case PIXELFORMAT_UNCOMPRESSED_GRAYSCALE: *glInternalFormat = GL_LUMINANCE; *glFormat = GL_LUMINANCE; *glType = GL_UNSIGNED_BYTE; break; case PIXELFORMAT_UNCOMPRESSED_GRAY_ALPHA: *glInternalFormat = GL_LUMINANCE_ALPHA; *glFormat = GL_LUMINANCE_ALPHA; *glType = GL_UNSIGNED_BYTE; break; case PIXELFORMAT_UNCOMPRESSED_R5G6B5: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5; break; + case PIXELFORMAT_UNCOMPRESSED_RGB565_BE: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_SHORT_5_6_5_REV; break; case PIXELFORMAT_UNCOMPRESSED_R8G8B8: *glInternalFormat = GL_RGB; *glFormat = GL_RGB; *glType = GL_UNSIGNED_BYTE; break; case PIXELFORMAT_UNCOMPRESSED_R5G5B5A1: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_5_5_5_1; break; case PIXELFORMAT_UNCOMPRESSED_R4G4B4A4: *glInternalFormat = GL_RGBA; *glFormat = GL_RGBA; *glType = GL_UNSIGNED_SHORT_4_4_4_4; break; diff --git a/raylib_pi4_test/text.c b/raylib_pi4_test/text.c index 3e821fe..3a49963 100644 --- a/raylib_pi4_test/text.c +++ b/raylib_pi4_test/text.c @@ -848,14 +848,12 @@ void DrawText(const char *text, int posX, int posY, int fontSize, Color color) // NOTE: chars spacing is NOT proportional to fontSize void DrawTextEx(Font font, const char *text, Vector2 position, float fontSize, float spacing, Color tint) { - if (font.texture.id == 0) font = GetFontDefault(); // Security check in case of not valid font - - int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop + int length = TextLength(text); // Total length in bytes of the text, scanned by codepoints in loop int textOffsetY = 0; // Offset between lines (on line break '\n') float textOffsetX = 0.0f; // Offset X to next character to draw - float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor + float scaleFactor = fontSize/font.baseSize; // Character quad scaling factor for (int i = 0; i < length;) {