diff --git a/CHANGELOG b/CHANGELOG index f1207ae5c..602e9a4e0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,146 @@ changelog Current Release: raylib 4.2.0 (11 August 2022) +------------------------------------------------------------------------- +Release: raylib 4.5 (xx February 2023) -WIP- +------------------------------------------------------------------------- +KEY CHANGES: + - ADDED: M3D model format support with animations + - ADDED: GLTF animation support + - rlgl redesign to avoid render batch triangles limits pre-check: rlCheckRenderBatchLimit() + - rshapes simplification to minimize the requirement of rlgl functionality, now it only depends on 6 functions + - rl_gputex.h: Compressed textures loading, required by rtextures module, has been moved to a separate self-contained library + - raygui 3.5: New version of the immediate-mode gui system for tools development with raylib + + +Detailed changes: + +[core] ADDED: RAYLIB_VERSION_* values to raylib.h (#2856) by @RobLoach +[core] ADDED: Basic gamepad support for Android (#2709) by @deniska +[core] ADDED: Support CAPS/NUM lock keys registering if locked +[core] ADDED: _GNU_SOURCE define on Linux (#2729) +[core] `WARNING`: RENAMED: Exported raylib version symbol to raylib_version #2671 +[core] REMOVED: Touch points on touch up events on Android (#2711) by @deniska +[core] REVIEWED: Window position setup on InitWindow() (#2732) by @RandomErrorMessage +[core] REVIEWED: Touchscreen input related functions on Android (#2702) by @deniska +[core] REVIEWED: Viewport scaling on Android after context rebind (#2703) by @deniska +[core] REVIEWED: ScanDirectoryFilesRecursively() (#2704) +[core] REVIEWED: Gamepad mappings with latest gamecontrollerdb (#2725) +[core] REVIEWED: Monitor order check on app initialization +[core] REVIEWED: Application monitor when opening (#2728, #2731) by @RandomErrorMessage +[core] REVIEWED: Gestures module to use GetTime() if available (#2733) by @RobLoach +[core] REVIEWED: Resolve GLFW3 some symbols re-definition of windows.h in glfw3native (#2643) by @daipom +[core] REVIEWED: OpenURL(), string buffer too short sometimes +[core] REVIEWED: GetRandomValue() range limit warning (#2800) by @Pere001 +[core] REVIEWED: UnloadDirectoryFiles() +[core] REVIEWED: GetKeyPressed(), out of range issue (#2814) by @daipom +[core] REVIEWED: GetTime(), renamed variable 'time' to 'nanoSeconds' (#2816) by @jtainer +[core] REVIEWED: LoadShaderFromMemory(), issue with shader linkage +[core] REVIEWED: Avoid possible gamepad index as -1 (#2839) +[core] REVIEWED: SetShaderValue*(), avoid setup uniforms for invalid locations +[core] REVIEWED: GetClipboardText() on PLATFORM_WEB, permissions issues +[core] REVIEWED: Initial window position for display-sized fullscreen (#2742) by @daipom +[core] REVIEWED: Sticky touches input (#2857) by @ImazighenGhost +[rlgl] ADDED: OpenGL ES 2.0 support on PLATFORM_DESKTOP (#2840) by @wtnbgo +[rlgl] ADDED: Separate blending modes for color and alpha, BLEND_CUSTOM_SEPARATE (#2741) +[rlgl] ADDED: rlSetBlendFactorsSeparate and custom blend mode modification checks (#2741) by @pure01fx +[rlgl] ADDED: RL_TEXTURE_MIPMAP_BIAS_RATIO support to `rlTextureParameters()` for OpenGL 3.3 #2674 +[rlgl] ADDED: rlCubemapParameters() (#2862) by @GithubPrankster +[rlgl] ADDED: rlSetCullFace() (#2797) by @jtainer +[rlgl] REMOVED: Mipmaps software generation for OpenGL 1.1 +[rlgl] REVIEWED: Check for extensions before enabling them (#2706) by @Not-Nik +[rlgl] REVIEWED: SSBO usage to avoid long long data types +[rlgl] REVIEWED: Enable DXT compression on __APPLE__ targets (#2694) by @Not-Nik +[rlgl] REVIEWED: enums exposed and description comments +[rlgl] REVIEWED: rlBindImageTexture(), correct data types (#2808) by @planetis-m +[rlgl] REVIEWED: rlMultMatrixf(), use const pointer (#2807) by @planetis-m +[rlgl] REVIEWED: Expose OpenGL blending mode factors and functions/equations +[rlgl] REVIEWED: rLoadTextureDepth(), issue with depth textures on WebGL (#2824) +[raymath] REVIEWED: Vector2Angle() (#2829, #2832) by @AlxHnr and @planetis-m +[shapes] ADDED: CheckCollisionPointPoly() (#2685) by @acejacek +[shapes] REVIEWED: DrawPixel*(), use RL_QUADS/RL_TRIANGLES (#2750) by @hatkidchan +[shapes] REVIEWED: DrawLineBezier*(), fix bezier line breaking (#2735, #2767) by @nobytesgiven +[textures] ADDED: ColorBrightness() +[textures] ADDED: ColorTint() +[textures] ADDED: ColorContrast() +[textures] ADDED: Support for PNM images (.ppm, .pgm) +[textures] ADDED: GenImagePerlinNoise() +[textures] ADDED: GenImageText(), generate grayscale image from text byte data +[textures] ADDED: ImageDrawCircleLines(), ImageDrawCircleLinesV() (#2713) by @RobLoach +[textures] ADDED: ImageBlurGaussian() (#2770) by @nobytesgiven +[textures] REVIEWED: Image fileformat support: PIC, PNM +[textures] REVIEWED: ImageTextEx() and ImageDrawTextEx() scaling (#2756) by @hatkidchan +[textures] `WARNING`: REMOVED: DrawTextureQuad() +[textures] `WARNING`: REMOVED: DrawTexturePoly(), function moved to example: `textures_polygon` +[textures] `WARNING`: REMOVED: DrawTextureTiled(),function implementation moved to the textures_tiled.c +[text] ADDED: GetCodepointPrevious() +[text] ADDED: UnloadUTF8(), aligned with LoadUTF8() +[text] `WARNING`: RENAMED: TextCodepointsToUTF8() to LoadUTF8() +[text] `WARNING`: RENAMED: GetCodepoint() -> GetCodepointNext() +[text] REDESIGNED: GetCodepointNext() +[text] REVIEWED text_codepoints_loading.c +[text] REVIEWED: MeasureTextEx(), avoid crash on bad data +[text] REVIEWED: UnloadFontData(), avoid crash on invalid font data +[models] ADDED: Support M3D model file format (meshes and materials) (#2648) by @bztsrc +[models] ADDED: Support for M3D animations (#2648) by @bztsrc +[models] ADDED: GLTF animation support (#2844) by @charles-l +[models] ADDED: DrawCapsule() and DrawCapsuleWires() (#2761) by @IanBand +[models] ADDED: LoadMaterials(), MTL files loading, same code as OBJ loader (#2872) by @JeffM2501 +[models] REVIEWED: GenMeshHeightmap() (#2716) +[models] REVIEWED: LoadIQM() (#2676) +[models] REVIEWED: Simplify .vox signature check (#2752) by @CrezyDud +[models] REVIEWED: LoadIQM(), support bone names loading if available (#2882) by @PencilAmazing +[models] `WARNING`: REMOVED: DrawCubeTexture(), DrawCubeTextureRec(), functions moved to new example: `models_draw_cube_texture` +[audio] REVIEWED: Clear PCM buffer state when closing audio device (#2736) by @veins1 +[audio] REVIEWED: Android backend selected (#2118, #2875) by @planetis-m +[multi] REVIEWED: Multiple code/comment typos by @sDos280 +[multi] REVIEWED: Use TRACELOG() macro instead of TraceLog() in internal modules (#2881) by @RobLoach +[examples] ADDED: textures_textured_curve (#2821) by @JeffM2501 +[examples] ADDED: shaders_write_depth (#2836) by @BugraAlptekinSari +[examples] RENAMED: Several shaders for naming consistency (#2707) +[examples] RENAMED: lighting_instanced.fs to lighting_instancing.fs (glsl100) (#2805) by @gtrxAC +[examples] REVIEWED: core_custom_logging.c (#2692) by @hartmannathan +[examples] REVIEWED: core_camera_2d_platformer (#2687) by @skylar779 +[examples] REVIEWED: core_custom_frame_control +[examples] REVIEWED: text_rectangle_bounds (#2746) by @SzieberthAdam +[examples] REVIEWED: textures_image_processing, added gaussian blurring (#2775) by @nobytesgiven +[examples] REVIEWED: models_billboard, highlighting rotation and draw order (#2779) by @nobytesgiven +[examples] REVIEWED: core_loading_thread, join thread on completion (#2845) by @planetis-m +[examples] REVIEWED: models_loading_gltf +[examples] REVIEWED: Shader lighting.fs for GLSL120 (#2651) +[parser] REVIEWED: raylib-parser Makefile (#2765) by @Peter0x44 +[build] ADDED: Packaging for distros with deb-based and rpm-based packages (#2877) by @KOLANICH +[build] ADDED: Linkage library -latomic on Linux (only required for ARM32) +[build] ADDED: Required frameworks on macOS (#2793) by @SpexGuy +[build] REVIEWED: CMake project template to easily target raylib version (#2700) by @RobLoach +[build] REVIEWED: PATH for PLATFORM_WEB target (#2647) by @futureapricot +[build] REVIEWED: build.zig to let user decide how to set build mode and linker fixes by @InKryption +[build] REVIEWED: Deprecation error on Android API higher than 23 (#2778) by @anggape +[build] REVIEWED: Android x86 Architecture name (#2783) by @IsaacTCB +[build] REVIEWED: examples/build.zig for the latest Zig version (#2786) by @RomanAkberov +[utils] REVIEWED: ExportDataAsCode() data types (#2787) by @RGDTAB +[build] REVIEWED: Makefile emscripten path (#2785) by @Julianiolo +[build] REVIEWED: Several compilation warnings (for strict rules) +[build] REVIEWED: All github workflows using deprecated actions +[build] REVIEWED: CMake when compiling for web (#2820) by @object71 +[build] REVIEWED: Avoid MSVC warnings in raylib project (#2871) by @JeffM2501 +[build] REVIEWED: Paths in .bat files to build examples (#2870) by @masoudd +[build] REVIEWED: CMake, use GLVND for old cmake versions (#2826) by @simendsjo +[build] REVIEWED: Makefile, multiple tweaks +[build] REVIEWED: CI action: linux_examples.yml +[build] REVIEWED: CI action: cmake.yml +[bindings] ADDED: h-raylib (Haskell) by @Anut-py +[bindings] ADDED: raylib-c3 (C3) by @Its-Kenta +[bindings] ADDED: raylib-umka (Umka) by @RobLoach +[bindings] ADDED: chez-raylib (Chez Scheme) by @Yunoinsky +[bindings] ADDED: raylib-python-ctypes (Python) by @sDos280 +[bindings] ADDED: claylib (Common Lisp) by @shelvick +[bindings] ADDED: raylib-vapi (Vala) by @lxmcf +[bindings] ADDED: TurboRaylib (Object Pascal) by @turborium +[bindings] ADDED: Kaylib (Kotlin/Native) by @Its-Kenta +[bindings] ADDED: Raylib-Nelua (Nelua) by @Its-Kenta +[misc] REVIEWED: Update some external libraries to latest versions + ------------------------------------------------------------------------- Release: raylib 4.2 (11 August 2022) ------------------------------------------------------------------------- diff --git a/examples/audio/audio_raw_stream.c b/examples/audio/audio_raw_stream.c index 142450e83..6befa765a 100644 --- a/examples/audio/audio_raw_stream.c +++ b/examples/audio/audio_raw_stream.c @@ -43,7 +43,7 @@ void AudioInputCallback(void *buffer, unsigned int frames) float incr = audioFrequency/44100.0f; short *d = (short *)buffer; - for (int i = 0; i < frames; i++) + for (unsigned int i = 0; i < frames; i++) { d[i] = (short)(32000.0f*sinf(2*PI*sineIdx)); sineIdx += incr; diff --git a/examples/core/core_custom_frame_control.c b/examples/core/core_custom_frame_control.c index ed0dbc661..9bfd25d3e 100644 --- a/examples/core/core_custom_frame_control.c +++ b/examples/core/core_custom_frame_control.c @@ -86,8 +86,8 @@ int main(void) DrawCircle((int)position, GetScreenHeight()/2 - 25, 50, RED); - DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), position - 40, GetScreenHeight()/2 - 100, 20, MAROON); - DrawText(TextFormat("PosX: %03.0f", position), position - 50, GetScreenHeight()/2 + 40, 20, BLACK); + DrawText(TextFormat("%03.0f ms", timeCounter*1000.0f), (int)position - 40, GetScreenHeight()/2 - 100, 20, MAROON); + DrawText(TextFormat("PosX: %03.0f", position), (int)position - 50, GetScreenHeight()/2 + 40, 20, BLACK); DrawText("Circle is moving at a constant 200 pixels/sec,\nindependently of the frame rate.", 10, 10, 20, DARKGRAY); DrawText("PRESS SPACE to PAUSE MOVEMENT", 10, GetScreenHeight() - 60, 20, GRAY); @@ -115,7 +115,7 @@ int main(void) deltaTime = (float)(currentTime - previousTime); } } - else deltaTime = updateDrawTime; // Framerate could be variable + else deltaTime = (float)updateDrawTime; // Framerate could be variable previousTime = currentTime; //---------------------------------------------------------------------------------- diff --git a/examples/core/core_drop_files.c b/examples/core/core_drop_files.c index 9ebe0f957..cfe03e196 100644 --- a/examples/core/core_drop_files.c +++ b/examples/core/core_drop_files.c @@ -58,7 +58,7 @@ int main(void) { DrawText("Dropped files:", 100, 40, 20, DARKGRAY); - for (int i = 0; i < droppedFiles.count; i++) + for (unsigned int i = 0; i < droppedFiles.count; i++) { if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f)); else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f)); diff --git a/examples/shaders/shaders_hot_reloading.c b/examples/shaders/shaders_hot_reloading.c index e58c45f3c..395d44cfe 100644 --- a/examples/shaders/shaders_hot_reloading.c +++ b/examples/shaders/shaders_hot_reloading.c @@ -38,7 +38,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [shaders] example - hot reloading"); const char *fragShaderFileName = "resources/shaders/glsl%i/reload.fs"; - long fragShaderFileModTime = GetFileModTime(TextFormat(fragShaderFileName, GLSL_VERSION)); + time_t fragShaderFileModTime = GetFileModTime(TextFormat(fragShaderFileName, GLSL_VERSION)); // Load raymarching shader // NOTE: Defining 0 (NULL) for vertex shader forces usage of internal default vertex shader diff --git a/examples/shapes/raygui.h b/examples/shapes/raygui.h index 3e7dea442..112370aca 100644 --- a/examples/shapes/raygui.h +++ b/examples/shapes/raygui.h @@ -1511,7 +1511,7 @@ Rectangle GuiScrollPanel(Rectangle bounds, const char *text, Rectangle content, float horizontalMin = hasHorizontalScrollBar? ((GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)-verticalScrollBarWidth : 0) - (float)GuiGetStyle(DEFAULT, BORDER_WIDTH); float horizontalMax = hasHorizontalScrollBar? content.width - bounds.width + (float)verticalScrollBarWidth + GuiGetStyle(DEFAULT, BORDER_WIDTH) - (((float)GuiGetStyle(LISTVIEW, SCROLLBAR_SIDE) == SCROLLBAR_LEFT_SIDE)? (float)verticalScrollBarWidth : 0) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); - float verticalMin = hasVerticalScrollBar? 0 : -1; + float verticalMin = hasVerticalScrollBar? 0 : -1.0f; float verticalMax = hasVerticalScrollBar? content.height - bounds.height + (float)horizontalScrollBarWidth + (float)GuiGetStyle(DEFAULT, BORDER_WIDTH) : (float)-GuiGetStyle(DEFAULT, BORDER_WIDTH); // Update control @@ -3205,8 +3205,8 @@ Vector2 GuiGrid(Rectangle bounds, const char *text, float spacing, int subdivs) if (CheckCollisionPointRec(mousePoint, bounds)) { // NOTE: Cell values must be rounded to int - currentCell.x = (int)((mousePoint.x - bounds.x)/spacing); - currentCell.y = (int)((mousePoint.y - bounds.y)/spacing); + currentCell.x = (float)((mousePoint.x - bounds.x)/spacing); + currentCell.y = (float)((mousePoint.y - bounds.y)/spacing); } } //-------------------------------------------------------------------- @@ -3842,7 +3842,7 @@ static void GuiDrawText(const char *text, Rectangle bounds, int alignment, Color // NOTE: We get text size after icon has been processed // TODO: REVIEW: We consider text size in case of line breaks! -> MeasureTextEx() depends on raylib! - Vector2 textSize = MeasureTextEx(GuiGetFont(), text, GuiGetStyle(DEFAULT, TEXT_SIZE), GuiGetStyle(DEFAULT, TEXT_SPACING)); + Vector2 textSize = MeasureTextEx(GuiGetFont(), text, (float)GuiGetStyle(DEFAULT, TEXT_SIZE), (float)GuiGetStyle(DEFAULT, TEXT_SPACING)); //int textWidth = GetTextWidth(text); //int textHeight = GuiGetStyle(DEFAULT, TEXT_SIZE); diff --git a/examples/text/text_draw_3d.c b/examples/text/text_draw_3d.c index 0711d54cd..127eb7c6a 100644 --- a/examples/text/text_draw_3d.c +++ b/examples/text/text_draw_3d.c @@ -152,13 +152,13 @@ int main(void) if (IsFileExtension(droppedFiles.paths[0], ".ttf")) { UnloadFont(font); - font = LoadFontEx(droppedFiles.paths[0], fontSize, 0, 0); + font = LoadFontEx(droppedFiles.paths[0], (int)fontSize, 0, 0); } else if (IsFileExtension(droppedFiles.paths[0], ".fnt")) { UnloadFont(font); font = LoadFont(droppedFiles.paths[0]); - fontSize = font.baseSize; + fontSize = (float)font.baseSize; } UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory @@ -742,7 +742,7 @@ static Vector3 MeasureTextWave3D(Font font, const char* text, float fontSize, fl static Color GenerateRandomColor(float s, float v) { const float Phi = 0.618033988749895f; // Golden ratio conjugate - float h = GetRandomValue(0, 360); + float h = (float)GetRandomValue(0, 360); h = fmodf((h + h*Phi), 360.0f); return ColorFromHSV(h, s, v); } diff --git a/examples/textures/textures_fog_of_war.c b/examples/textures/textures_fog_of_war.c index 7c3d66642..433f364a6 100644 --- a/examples/textures/textures_fog_of_war.c +++ b/examples/textures/textures_fog_of_war.c @@ -51,7 +51,7 @@ int main(void) // Load map tiles (generating 2 random tile ids for testing) // NOTE: Map tile ids should be probably loaded from an external map file - for (int i = 0; i < map.tilesY*map.tilesX; i++) map.tileIds[i] = GetRandomValue(0, 1); + for (unsigned int i = 0; i < map.tilesY*map.tilesX; i++) map.tileIds[i] = GetRandomValue(0, 1); // Player position on the screen (pixel coordinates, not tile coordinates) Vector2 playerPosition = { 180, 130 }; @@ -80,12 +80,12 @@ int main(void) // Check player position to avoid moving outside tilemap limits if (playerPosition.x < 0) playerPosition.x = 0; - else if ((playerPosition.x + PLAYER_SIZE) > (map.tilesX*MAP_TILE_SIZE)) playerPosition.x = map.tilesX*MAP_TILE_SIZE - PLAYER_SIZE; + else if ((playerPosition.x + PLAYER_SIZE) > (map.tilesX*MAP_TILE_SIZE)) playerPosition.x = (float)map.tilesX*MAP_TILE_SIZE - PLAYER_SIZE; if (playerPosition.y < 0) playerPosition.y = 0; - else if ((playerPosition.y + PLAYER_SIZE) > (map.tilesY*MAP_TILE_SIZE)) playerPosition.y = map.tilesY*MAP_TILE_SIZE - PLAYER_SIZE; + else if ((playerPosition.y + PLAYER_SIZE) > (map.tilesY*MAP_TILE_SIZE)) playerPosition.y = (float)map.tilesY*MAP_TILE_SIZE - PLAYER_SIZE; // Previous visited tiles are set to partial fog - for (int i = 0; i < map.tilesX*map.tilesY; i++) if (map.tileFog[i] == 1) map.tileFog[i] = 2; + for (unsigned int i = 0; i < map.tilesX*map.tilesY; i++) if (map.tileFog[i] == 1) map.tileFog[i] = 2; // Get current tile position from player pixel position playerTileX = (int)((playerPosition.x + MAP_TILE_SIZE/2)/MAP_TILE_SIZE); @@ -95,7 +95,7 @@ int main(void) // NOTE: We check tilemap limits to avoid processing tiles out-of-array-bounds (it could crash program) for (int y = (playerTileY - PLAYER_TILE_VISIBILITY); y < (playerTileY + PLAYER_TILE_VISIBILITY); y++) for (int x = (playerTileX - PLAYER_TILE_VISIBILITY); x < (playerTileX + PLAYER_TILE_VISIBILITY); x++) - if ((x >= 0) && (x < map.tilesX) && (y >= 0) && (y < map.tilesY)) map.tileFog[y*map.tilesX + x] = 1; + if ((x >= 0) && (x < (int)map.tilesX) && (y >= 0) && (y < (int)map.tilesY)) map.tileFog[y*map.tilesX + x] = 1; //---------------------------------------------------------------------------------- // Draw @@ -103,8 +103,8 @@ int main(void) // Draw fog of war to a small render texture for automatic smoothing on scaling BeginTextureMode(fogOfWar); ClearBackground(BLANK); - for (int y = 0; y < map.tilesY; y++) - for (int x = 0; x < map.tilesX; x++) + for (unsigned int y = 0; y < map.tilesY; y++) + for (unsigned int x = 0; x < map.tilesX; x++) if (map.tileFog[y*map.tilesX + x] == 0) DrawRectangle(x, y, 1, 1, BLACK); else if (map.tileFog[y*map.tilesX + x] == 2) DrawRectangle(x, y, 1, 1, Fade(BLACK, 0.8f)); EndTextureMode(); @@ -113,9 +113,9 @@ int main(void) ClearBackground(RAYWHITE); - for (int y = 0; y < map.tilesY; y++) + for (unsigned int y = 0; y < map.tilesY; y++) { - for (int x = 0; x < map.tilesX; x++) + for (unsigned int x = 0; x < map.tilesX; x++) { // Draw tiles from id (and tile borders) DrawRectangle(x*MAP_TILE_SIZE, y*MAP_TILE_SIZE, MAP_TILE_SIZE, MAP_TILE_SIZE, @@ -129,8 +129,8 @@ int main(void) // Draw fog of war (scaled to full map, bilinear filtering) - DrawTexturePro(fogOfWar.texture, (Rectangle){ 0, 0, fogOfWar.texture.width, -fogOfWar.texture.height }, - (Rectangle){ 0, 0, map.tilesX*MAP_TILE_SIZE, map.tilesY*MAP_TILE_SIZE }, + DrawTexturePro(fogOfWar.texture, (Rectangle){ 0, 0, (float)fogOfWar.texture.width, (float)-fogOfWar.texture.height }, + (Rectangle){ 0, 0, (float)map.tilesX*MAP_TILE_SIZE, (float)map.tilesY*MAP_TILE_SIZE }, (Vector2){ 0, 0 }, 0.0f, WHITE); // Draw player current tile diff --git a/examples/textures/textures_polygon.c b/examples/textures/textures_polygon.c index 18fc95249..cf59af979 100644 --- a/examples/textures/textures_polygon.c +++ b/examples/textures/textures_polygon.c @@ -91,7 +91,7 @@ int main(void) DrawText("textured polygon", 20, 20, 20, DARKGRAY); - DrawTexturePoly(texture, (Vector2){ GetScreenWidth()/2, GetScreenHeight()/2 }, + DrawTexturePoly(texture, (Vector2){ GetScreenWidth()/2.0f, GetScreenHeight()/2.0f }, positions, texcoords, MAX_POINTS, WHITE); EndDrawing(); diff --git a/parser/raylib_parser.c b/parser/raylib_parser.c index 97e1e79a9..7bb8cf7fa 100644 --- a/parser/raylib_parser.c +++ b/parser/raylib_parser.c @@ -70,7 +70,7 @@ #define MAX_ALIASES_TO_PARSE 64 // Maximum number of aliases to parse #define MAX_ENUMS_TO_PARSE 64 // Maximum number of enums to parse #define MAX_CALLBACKS_TO_PARSE 64 // Maximum number of callbacks to parse -#define MAX_FUNCS_TO_PARSE 512 // Maximum number of functions to parse +#define MAX_FUNCS_TO_PARSE 1024 // Maximum number of functions to parse #define MAX_LINE_LENGTH 512 // Maximum length of one line (including comments) diff --git a/projects/VS2022/examples/rlgl_compute_shaders.vcxproj b/projects/VS2022/examples/rlgl_compute_shaders.vcxproj index 14fe2f4ee..2e514f3d4 100644 --- a/projects/VS2022/examples/rlgl_compute_shaders.vcxproj +++ b/projects/VS2022/examples/rlgl_compute_shaders.vcxproj @@ -202,16 +202,15 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) Console true - - - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -220,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -228,9 +227,8 @@ Console true - - - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) @@ -239,16 +237,15 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) Console true - - - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" @@ -261,16 +258,15 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) Console true - - - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" @@ -285,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -295,9 +291,8 @@ true true true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -308,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -318,9 +313,8 @@ true true true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ @@ -331,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -341,9 +335,8 @@ true true true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" @@ -360,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -370,9 +363,8 @@ true true true - opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - - + raylib.lib;opengl32.lib;kernel32.lib;user32.lib;gdi32.lib;winmm.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + $(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\ xcopy /y /d "$(SolutionDir)\build\raylib\bin\$(Platform)\$(Configuration)\raylib.dll" "$(SolutionDir)\build\$(ProjectName)\bin\$(Platform)\$(Configuration)" @@ -382,9 +374,14 @@ - + + + + {e89d61ac-55de-4482-afd4-df7242ebc859} + + diff --git a/projects/VS2022/examples/rlgl_standalone.vcxproj b/projects/VS2022/examples/rlgl_standalone.vcxproj index 466740431..707a73a91 100644 --- a/projects/VS2022/examples/rlgl_standalone.vcxproj +++ b/projects/VS2022/examples/rlgl_standalone.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) @@ -220,7 +220,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -239,7 +239,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) @@ -261,7 +261,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) @@ -285,7 +285,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -308,7 +308,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -331,7 +331,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true @@ -360,7 +360,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;$(SolutionDir)..\..\examples\others\external\include;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/shaders_hot_reloading.vcxproj b/projects/VS2022/examples/shaders_hot_reloading.vcxproj index e10ec74e5..900246daf 100644 --- a/projects/VS2022/examples/shaders_hot_reloading.vcxproj +++ b/projects/VS2022/examples/shaders_hot_reloading.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj b/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj index be37881fc..df61cdb1e 100644 --- a/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj +++ b/projects/VS2022/examples/shapes_draw_circle_sector.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj b/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj index af8ce6fd5..207d38f54 100644 --- a/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj +++ b/projects/VS2022/examples/shapes_draw_rectangle_rounded.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/shapes_draw_ring.vcxproj b/projects/VS2022/examples/shapes_draw_ring.vcxproj index 1488c9522..490e8e2c8 100644 --- a/projects/VS2022/examples/shapes_draw_ring.vcxproj +++ b/projects/VS2022/examples/shapes_draw_ring.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/text_draw_3d.vcxproj b/projects/VS2022/examples/text_draw_3d.vcxproj index c078bb010..0ea41840c 100644 --- a/projects/VS2022/examples/text_draw_3d.vcxproj +++ b/projects/VS2022/examples/text_draw_3d.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/textures_fog_of_war.vcxproj b/projects/VS2022/examples/textures_fog_of_war.vcxproj index aa93c01a8..344a38cc5 100644 --- a/projects/VS2022/examples/textures_fog_of_war.vcxproj +++ b/projects/VS2022/examples/textures_fog_of_war.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/projects/VS2022/examples/textures_polygon.vcxproj b/projects/VS2022/examples/textures_polygon.vcxproj index 9467c8aeb..1788f426a 100644 --- a/projects/VS2022/examples/textures_polygon.vcxproj +++ b/projects/VS2022/examples/textures_polygon.vcxproj @@ -202,7 +202,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -219,7 +219,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) /FS %(AdditionalOptions) @@ -237,7 +237,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -258,7 +258,7 @@ Level3 Disabled - WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) + _CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;PLATFORM_DESKTOP;%(PreprocessorDefinitions) CompileAsC $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) @@ -281,7 +281,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -303,7 +303,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -325,7 +325,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true @@ -353,7 +353,7 @@ MaxSpeed true true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP + _CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions);PLATFORM_DESKTOP $(SolutionDir)..\..\src;%(AdditionalIncludeDirectories) CompileAsC true diff --git a/src/raudio.c b/src/raudio.c index 34ab0702e..46d8223d9 100644 --- a/src/raudio.c +++ b/src/raudio.c @@ -836,6 +836,12 @@ Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int return wave; } +// Checks if wave data is ready +bool IsWaveReady(Wave wave) +{ + return wave.data != NULL; +} + // Load sound from file // NOTE: The entire file is loaded to memory to be played (no-streaming) Sound LoadSound(const char *fileName) @@ -892,6 +898,12 @@ Sound LoadSoundFromWave(Wave wave) return sound; } +// Checks if a sound is ready +bool IsSoundReady(Sound sound) +{ + return sound.stream.buffer != NULL; +} + // Unload wave data void UnloadWave(Wave wave) { @@ -1614,6 +1626,12 @@ Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, return music; } +// Checks if a music stream is ready +bool IsMusicReady(Music music) +{ + return music.ctxData != NULL; +} + // Unload music stream void UnloadMusicStream(Music music) { @@ -1967,6 +1985,12 @@ AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, un return stream; } +// Checks if an audio stream is ready +RLAPI bool IsAudioStreamReady(AudioStream stream) +{ + return stream.buffer != NULL; +} + // Unload audio stream and free memory void UnloadAudioStream(AudioStream stream) { diff --git a/src/raylib.h b/src/raylib.h index 10e69acdf..e0b7a3159 100644 --- a/src/raylib.h +++ b/src/raylib.h @@ -1012,6 +1012,7 @@ RLAPI void UnloadVrStereoConfig(VrStereoConfig config); // Unload VR s // NOTE: Shader functionality is not available on OpenGL 1.1 RLAPI Shader LoadShader(const char *vsFileName, const char *fsFileName); // Load shader from files and bind default locations RLAPI Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode); // Load shader from code strings and bind default locations +RLAPI bool IsShaderReady(Shader shader); // Check if a shader is ready RLAPI int GetShaderLocation(Shader shader, const char *uniformName); // Get shader uniform location RLAPI int GetShaderLocationAttrib(Shader shader, const char *attribName); // Get shader attribute location RLAPI void SetShaderValue(Shader shader, int locIndex, const void *value, int uniformType); // Set shader uniform value @@ -1234,6 +1235,7 @@ RLAPI Image LoadImageAnim(const char *fileName, int *frames); RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load image from memory buffer, fileType refers to extension: i.e. '.png' RLAPI Image LoadImageFromTexture(Texture2D texture); // Load image from GPU texture data RLAPI Image LoadImageFromScreen(void); // Load image from screen buffer and (screenshot) +RLAPI bool IsImageReady(Image image); // Check if an image is ready RLAPI void UnloadImage(Image image); // Unload image from CPU memory (RAM) RLAPI bool ExportImage(Image image, const char *fileName); // Export image data to file, returns true on success RLAPI bool ExportImageAsCode(Image image, const char *fileName); // Export image as code file defining an array of bytes, returns true on success @@ -1309,7 +1311,9 @@ RLAPI Texture2D LoadTexture(const char *fileName); RLAPI Texture2D LoadTextureFromImage(Image image); // Load texture from image data RLAPI TextureCubemap LoadTextureCubemap(Image image, int layout); // Load cubemap from image, multiple image cubemap layouts supported RLAPI RenderTexture2D LoadRenderTexture(int width, int height); // Load texture for rendering (framebuffer) +RLAPI bool IsTextureReady(Texture2D texture); // Check if a texture is ready RLAPI void UnloadTexture(Texture2D texture); // Unload texture from GPU memory (VRAM) +RLAPI bool IsRenderTextureReady(RenderTexture2D target); // Check if a render texture is ready RLAPI void UnloadRenderTexture(RenderTexture2D target); // Unload render texture from GPU memory (VRAM) RLAPI void UpdateTexture(Texture2D texture, const void *pixels); // Update GPU texture with new data RLAPI void UpdateTextureRec(Texture2D texture, Rectangle rec, const void *pixels); // Update GPU texture rectangle with new data @@ -1354,6 +1358,7 @@ RLAPI Font LoadFont(const char *fileName); RLAPI Font LoadFontEx(const char *fileName, int fontSize, int *fontChars, int glyphCount); // Load font from file with extended parameters, use NULL for fontChars and 0 for glyphCount to load the default character set RLAPI Font LoadFontFromImage(Image image, Color key, int firstChar); // Load font from Image (XNA style) RLAPI Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount); // Load font from memory buffer, fileType refers to extension: i.e. '.ttf' +RLAPI bool IsFontReady(Font font); // Check if a font is ready RLAPI GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type); // Load font data for further use RLAPI Image GenImageFontAtlas(const GlyphInfo *chars, Rectangle **recs, int glyphCount, int fontSize, int padding, int packMethod); // Generate image font atlas using chars info RLAPI void UnloadFontData(GlyphInfo *chars, int glyphCount); // Unload font chars info data (RAM) @@ -1438,6 +1443,7 @@ RLAPI void DrawGrid(int slices, float spacing); // Model management functions RLAPI Model LoadModel(const char *fileName); // Load model from files (meshes and materials) RLAPI Model LoadModelFromMesh(Mesh mesh); // Load model from generated mesh (default material) +RLAPI bool IsModelReady(Model model); // Check if a model is ready RLAPI void UnloadModel(Model model); // Unload model (including meshes) from memory (RAM and/or VRAM) RLAPI void UnloadModelKeepMeshes(Model model); // Unload model (but not meshes) from memory (RAM and/or VRAM) RLAPI BoundingBox GetModelBoundingBox(Model model); // Compute model bounding box limits (considers all meshes) @@ -1478,6 +1484,7 @@ RLAPI Mesh GenMeshCubicmap(Image cubicmap, Vector3 cubeSize); // Material loading/unloading functions RLAPI Material *LoadMaterials(const char *fileName, int *materialCount); // Load materials from model file RLAPI Material LoadMaterialDefault(void); // Load default material (Supports: DIFFUSE, SPECULAR, NORMAL maps) +RLAPI bool IsMaterialReady(Material material); // Check if a material is ready RLAPI void UnloadMaterial(Material material); // Unload material from GPU memory (VRAM) RLAPI void SetMaterialTexture(Material *material, int mapType, Texture2D texture); // Set texture for a material map type (MATERIAL_MAP_DIFFUSE, MATERIAL_MAP_SPECULAR...) RLAPI void SetModelMeshMaterial(Model *model, int meshId, int materialId); // Set material for a mesh @@ -1513,8 +1520,10 @@ RLAPI void SetMasterVolume(float volume); // Set mas // Wave/Sound loading/unloading functions RLAPI Wave LoadWave(const char *fileName); // Load wave data from file RLAPI Wave LoadWaveFromMemory(const char *fileType, const unsigned char *fileData, int dataSize); // Load wave from memory buffer, fileType refers to extension: i.e. '.wav' +RLAPI bool IsWaveReady(Wave wave); // Checks if wave data is ready RLAPI Sound LoadSound(const char *fileName); // Load sound from file RLAPI Sound LoadSoundFromWave(Wave wave); // Load sound from wave data +RLAPI bool IsSoundReady(Sound sound); // Checks if a sound is ready RLAPI void UpdateSound(Sound sound, const void *data, int sampleCount); // Update sound buffer with new data RLAPI void UnloadWave(Wave wave); // Unload wave data RLAPI void UnloadSound(Sound sound); // Unload sound @@ -1542,6 +1551,7 @@ RLAPI void UnloadWaveSamples(float *samples); // Unload // Music management functions RLAPI Music LoadMusicStream(const char *fileName); // Load music stream from file RLAPI Music LoadMusicStreamFromMemory(const char *fileType, const unsigned char *data, int dataSize); // Load music stream from data +RLAPI bool IsMusicReady(Music music); // Checks if a music stream is ready RLAPI void UnloadMusicStream(Music music); // Unload music stream RLAPI void PlayMusicStream(Music music); // Start music playing RLAPI bool IsMusicStreamPlaying(Music music); // Check if music is playing @@ -1558,6 +1568,7 @@ RLAPI float GetMusicTimePlayed(Music music); // Get cur // AudioStream management functions RLAPI AudioStream LoadAudioStream(unsigned int sampleRate, unsigned int sampleSize, unsigned int channels); // Load audio stream (to stream raw audio pcm data) +RLAPI bool IsAudioStreamReady(AudioStream stream); // Checks if an audio stream is ready RLAPI void UnloadAudioStream(AudioStream stream); // Unload audio stream and free memory RLAPI void UpdateAudioStream(AudioStream stream, const void *data, int frameCount); // Update audio stream buffers with data RLAPI bool IsAudioStreamProcessed(AudioStream stream); // Check if any audio stream buffers requires refill diff --git a/src/raymath.h b/src/raymath.h index 435ea3c6e..eb244ad44 100644 --- a/src/raymath.h +++ b/src/raymath.h @@ -903,7 +903,7 @@ RMAPI Vector3 Vector3Unproject(Vector3 source, Matrix projection, Matrix view) { Vector3 result = { 0 }; - // Calculate unproject matrix (multiply view patrix by projection matrix) and invert it + // Calculate unproject matrix (multiply view matrix by projection matrix) and invert it Matrix matViewProj = { // MatrixMultiply(view, projection); view.m0*projection.m0 + view.m1*projection.m4 + view.m2*projection.m8 + view.m3*projection.m12, view.m0*projection.m1 + view.m1*projection.m5 + view.m2*projection.m9 + view.m3*projection.m13, diff --git a/src/rcore.c b/src/rcore.c index 1f97edb2a..f2f0cbbe0 100644 --- a/src/rcore.c +++ b/src/rcore.c @@ -2509,6 +2509,12 @@ Shader LoadShaderFromMemory(const char *vsCode, const char *fsCode) return shader; } +// Check if a shader is ready +bool IsShaderReady(Shader shader) +{ + return shader.locs != NULL; +} + // Unload shader from GPU memory (VRAM) void UnloadShader(Shader shader) { diff --git a/src/rmodels.c b/src/rmodels.c index 627666841..5c808f13d 100644 --- a/src/rmodels.c +++ b/src/rmodels.c @@ -1109,6 +1109,12 @@ Model LoadModelFromMesh(Mesh mesh) return model; } +// Check if a model is ready +bool IsModelReady(Model model) +{ + return model.meshes != NULL && model.materials != NULL && model.meshMaterial != NULL && model.meshCount > 0 && model.materialCount > 0; +} + // Unload model (meshes/materials) from memory (RAM and/or VRAM) // NOTE: This function takes care of all model elements, for a detailed control // over them, use UnloadMesh() and UnloadMaterial() @@ -1870,7 +1876,7 @@ bool ExportMesh(Mesh mesh, const char *fileName) static void ProcessMaterialsOBJ(Material *rayMaterials, tinyobj_material_t *materials, int materialCount) { // Init model materials - for (unsigned int m = 0; m < materialCount; m++) + for (int m = 0; m < materialCount; m++) { // Init material to default // NOTE: Uses default shader, which only supports MATERIAL_MAP_DIFFUSE @@ -1950,6 +1956,12 @@ Material LoadMaterialDefault(void) return material; } +// Check if a material is ready +bool IsMaterialReady(Material material) +{ + return material.maps != NULL; +} + // Unload material from memory void UnloadMaterial(Material material) { diff --git a/src/rtext.c b/src/rtext.c index 718fda04b..9908b44df 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -535,6 +535,12 @@ Font LoadFontFromMemory(const char *fileType, const unsigned char *fileData, int return font; } +// Check if a font is ready +bool IsFontReady(Font font) +{ + return font.glyphs != NULL; +} + // Load font data for further use // NOTE: Requires TTF font memory data and can generate SDF data GlyphInfo *LoadFontData(const unsigned char *fileData, int dataSize, int fontSize, int *fontChars, int glyphCount, int type) diff --git a/src/rtextures.c b/src/rtextures.c index 05dacb21a..89a91b051 100644 --- a/src/rtextures.c +++ b/src/rtextures.c @@ -502,6 +502,12 @@ Image LoadImageFromScreen(void) return image; } +// Check if an image is ready +bool IsImageReady(Image image) +{ + return image.data != NULL && image.width > 0 && image.height > 0 && image.format > 0; +} + // Unload image from CPU memory (RAM) void UnloadImage(Image image) { @@ -3324,6 +3330,12 @@ RenderTexture2D LoadRenderTexture(int width, int height) return target; } +// Check if a texture is ready +bool IsTextureReady(Texture2D texture) +{ + return texture.id > 0 && texture.width > 0 && texture.height > 0 && texture.format > 0; +} + // Unload texture from GPU memory (VRAM) void UnloadTexture(Texture2D texture) { @@ -3335,6 +3347,12 @@ void UnloadTexture(Texture2D texture) } } +// Check if a render texture is ready +bool IsRenderTextureReady(RenderTexture2D target) +{ + return target.id > 0 && IsTextureReady(target.depth) && IsTextureReady(target.texture); +} + // Unload render texture from GPU memory (VRAM) void UnloadRenderTexture(RenderTexture2D target) {