summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2021-07-30 11:56:14 +0200
committerraysan5 <[email protected]>2021-07-30 11:56:14 +0200
commitbd70a224127207e1483eda4538cc482c9c7f49a0 (patch)
tree12a16487633d1e3b8b7856d51b0fd04a96a278df /src
parent8b7f43f89b88c75f7353fe85f7cb6465ad6be7b5 (diff)
downloadraylib-bd70a224127207e1483eda4538cc482c9c7f49a0.tar.gz
raylib-bd70a224127207e1483eda4538cc482c9c7f49a0.zip
Review some issues
Diffstat (limited to 'src')
-rw-r--r--src/core.c10
-rw-r--r--src/rlgl.h2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/core.c b/src/core.c
index 8ccc1e08..5e46d2c6 100644
--- a/src/core.c
+++ b/src/core.c
@@ -121,6 +121,11 @@
#include "utils.h" // Required for: TRACELOG() macros
+#if (defined(__linux__) || defined(PLATFORM_WEB)) && _POSIX_C_SOURCE < 199309L
+ #undef _POSIX_C_SOURCE
+ #define _POSIX_C_SOURCE 199309L // Required for: CLOCK_MONOTONIC if compiled with c99 without gnu ext.
+#endif
+
#define RLGL_IMPLEMENTATION
#include "rlgl.h" // OpenGL abstraction layer to OpenGL 1.1, 3.3+ or ES2
@@ -154,11 +159,6 @@
#include "external/sdefl.h" // Deflate (RFC 1951) compressor
#endif
-#if (defined(__linux__) || defined(PLATFORM_WEB)) && _POSIX_C_SOURCE < 199309L
- #undef _POSIX_C_SOURCE
- #define _POSIX_C_SOURCE 199309L // Required for: CLOCK_MONOTONIC if compiled with c99 without gnu ext.
-#endif
-
#include <stdlib.h> // Required for: srand(), rand(), atexit()
#include <stdio.h> // Required for: sprintf() [Used in OpenURL()]
#include <string.h> // Required for: strrchr(), strcmp(), strlen()
diff --git a/src/rlgl.h b/src/rlgl.h
index 8edccf2d..74701372 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -2968,7 +2968,7 @@ void *rlReadTexturePixels(unsigned int id, int width, int height, int format)
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, id, 0);
// We read data as RGBA because FBO texture is configured as RGBA, despite binding another texture format
- pixels = (unsigned char *)RL_MALLOC(rlGetPixelDataSize(texture.width, texture.height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8));
+ pixels = (unsigned char *)RL_MALLOC(rlGetPixelDataSize(width, height, PIXELFORMAT_UNCOMPRESSED_R8G8B8A8));
glReadPixels(0, 0, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
glBindFramebuffer(GL_FRAMEBUFFER, 0);