diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index 0dcf8c70f..88b0a6109 100644 --- a/examples/models/models_yaw_pitch_roll.c +++ b/examples/models/models_yaw_pitch_roll.c @@ -5,8 +5,7 @@ * This example has been created using raylib 1.8 (www.raylib.com) * raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details) * -* Example based on Berni work on Raspberry Pi: -* http://forum.raylib.com/index.php?p=/discussion/124/line-versus-triangle-drawing-order +* Example based on Berni work on Raspberry Pi. * * Copyright (c) 2017 Ramon Santamaria (@raysan5) * diff --git a/src/Makefile b/src/Makefile index 2932e7bbc..0cfc82c16 100644 --- a/src/Makefile +++ b/src/Makefile @@ -342,9 +342,6 @@ endif INCLUDE_PATHS = -I. -Iexternal/glfw/include ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(PLATFORM_OS),WINDOWS) - INCLUDE_PATHS += -Iexternal - endif ifeq ($(PLATFORM_OS),BSD) INCLUDE_PATHS += -I/usr/local/include LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) diff --git a/src/audio.c b/src/audio.c index dcde6e650..f0362b2d0 100644 --- a/src/audio.c +++ b/src/audio.c @@ -1158,8 +1158,9 @@ Music LoadMusicStream(const char *fileName) music->stream = InitAudioStream(music->ctxMp3.sampleRate, 32, music->ctxMp3.channels); - // TODO: It seems the total number of samples is not obtained correctly... - music->totalSamples = (unsigned int)music->ctxMp3.framesRemaining*music->ctxMp3.channels; + // TODO: There is not an easy way to compute the total number of samples available + // in an MP3, frames size could be variable... we tried with a 60 seconds music... but crashes... + music->totalSamples = 60*music->ctxMp3.sampleRate*music->ctxMp3.channels; music->samplesLeft = music->totalSamples; music->ctxType = MUSIC_AUDIO_MP3; music->loopCount = -1; // Infinite loop by default diff --git a/src/core.c b/src/core.c index 41aa181b9..91022b11d 100644 --- a/src/core.c +++ b/src/core.c @@ -125,7 +125,7 @@ #include // Required for: tolower() [Used in IsFileExtension()] #include // Required for stat() [Used in GetLastWriteTime()] -#if defined(_WIN32) && defined(_MSC_VER) +#if defined(PLATFORM_DESKTOP) && defined(_WIN32) && defined(_MSC_VER) #include "external/dirent.h" // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] #else #include // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] diff --git a/src/rlgl.h b/src/rlgl.h index d2b52a472..96c91d020 100644 --- a/src/rlgl.h +++ b/src/rlgl.h @@ -1506,9 +1506,17 @@ void rlDeleteTextures(unsigned int id) void rlDeleteRenderTextures(RenderTexture2D target) { #if defined(GRAPHICS_API_OPENGL_33) || defined(GRAPHICS_API_OPENGL_ES2) - if (target.id > 0) glDeleteFramebuffers(1, &target.id); if (target.texture.id > 0) glDeleteTextures(1, &target.texture.id); - if (target.depth.id > 0) glDeleteTextures(1, &target.depth.id); + if (target.depth.id > 0) + { +#if defined(GRAPHICS_API_OPENGL_ES2) + glDeleteRenderbuffers(1, &target.depth.id); +#elif defined(GRAPHICS_API_OPENGL_33) + glDeleteTextures(1, &target.depth.id); +#endif + } + + if (target.id > 0) glDeleteFramebuffers(1, &target.id); TraceLog(LOG_INFO, "[FBO ID %i] Unloaded render texture data from VRAM (GPU)", target.id); #endif @@ -2171,7 +2179,7 @@ void rlUnloadTexture(unsigned int id) // Load a texture to be used for rendering (fbo with color and depth attachments) RenderTexture2D rlLoadRenderTexture(int width, int height) { - RenderTexture2D target; + RenderTexture2D target = { 0 }; target.id = 0; @@ -2251,8 +2259,16 @@ RenderTexture2D rlLoadRenderTexture(int width, int height) default: break; } - glDeleteTextures(1, &target.texture.id); - glDeleteTextures(1, &target.depth.id); + if (target.texture.id > 0) glDeleteTextures(1, &target.texture.id); + if (target.depth.id > 0) + { +#if defined(GRAPHICS_API_OPENGL_ES2) + glDeleteRenderbuffers(1, &target.depth.id); +#elif defined(GRAPHICS_API_OPENGL_33) + glDeleteTextures(1, &target.depth.id); +#endif + } + glDeleteFramebuffers(1, &target.id); } else TraceLog(LOG_INFO, "[FBO ID %i] Framebuffer object created successfully", target.id);