diff options
| author | Berni8k <[email protected]> | 2018-10-20 12:34:40 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2018-10-20 12:34:40 +0200 |
| commit | 464a55902063b526f85f98440fa87498c042a843 (patch) | |
| tree | a26012a935734bed12ff776beb4bf42ae4400099 | |
| parent | 3b674cd2810499d05a8edb0a7392cb90d0b95e3f (diff) | |
| parent | 161b18edea6649a108ef3f7aa37464688adcba07 (diff) | |
| download | raylib-464a55902063b526f85f98440fa87498c042a843.tar.gz raylib-464a55902063b526f85f98440fa87498c042a843.zip | |
Merge pull request #1 from raysan5/master
Update
| -rw-r--r-- | examples/models/models_yaw_pitch_roll.c | 3 | ||||
| -rw-r--r-- | src/Makefile | 3 | ||||
| -rw-r--r-- | src/audio.c | 5 | ||||
| -rw-r--r-- | src/core.c | 2 | ||||
| -rw-r--r-- | src/rlgl.h | 26 |
5 files changed, 26 insertions, 13 deletions
diff --git a/examples/models/models_yaw_pitch_roll.c b/examples/models/models_yaw_pitch_roll.c index 0dcf8c70..88b0a610 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 2932e7bb..0cfc82c1 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 dcde6e65..f0362b2d 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 @@ -125,7 +125,7 @@ #include <ctype.h> // Required for: tolower() [Used in IsFileExtension()] #include <sys/stat.h> // 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 <dirent.h> // Required for: DIR, opendir(), closedir() [Used in GetDirectoryFiles()] @@ -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); |
