summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorRay <[email protected]>2021-10-16 22:36:47 +0200
committerRay <[email protected]>2021-10-16 22:36:47 +0200
commit1b793e76dc1639e7acb05f34d68bc26145c1f6dd (patch)
tree09a930d88f3e61c1262b35b51be23bc4e5cf778e /src
parent226c0e362c6784edf7e86e94624da655d185b259 (diff)
downloadraylib-1b793e76dc1639e7acb05f34d68bc26145c1f6dd.tar.gz
raylib-1b793e76dc1639e7acb05f34d68bc26145c1f6dd.zip
Reviewed memory usage
Diffstat (limited to 'src')
-rw-r--r--src/rlgl.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index f9ca1a77..1a087668 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -1860,14 +1860,8 @@ void rlLoadExtensions(void *loader)
#if defined(RLGL_SHOW_GL_DETAILS_INFO)
// Get supported extensions list
// WARNING: glGetStringi() not available on OpenGL 2.1
- char **extList = RL_MALLOC(numExt*sizeof(char *));
TRACELOG(RL_LOG_INFO, "GL: OpenGL extensions:");
- for (int i = 0; i < numExt; i++)
- {
- extList[i] = (char *)glGetStringi(GL_EXTENSIONS, i);
- TRACELOG(RL_LOG_INFO, " %s", extList[i]);
- }
- RL_FREE(extList); // Free extensions pointers
+ for (int i = 0; i < numExt; i++) TRACELOG(RL_LOG_INFO, " %s", glGetStringi(GL_EXTENSIONS, i));
#endif
// Register supported extensions flags
@@ -2036,9 +2030,10 @@ void rlLoadExtensions(void *loader)
#endif
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &capability);
TRACELOG(RL_LOG_INFO, " GL_NUM_COMPRESSED_TEXTURE_FORMATS: %i", capability);
- GLint format[32] = { 0 };
- glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, format);
- for (int i = 0; i < capability; i++) TRACELOG(RL_LOG_INFO, " %s", rlGetCompressedFormatName(format[i]));
+ GLint *compFormats = (GLint *)RL_CALLOC(capability, sizeof(GLint));
+ glGetIntegerv(GL_COMPRESSED_TEXTURE_FORMATS, compFormats);
+ for (int i = 0; i < capability; i++) TRACELOG(RL_LOG_INFO, " %s", rlGetCompressedFormatName(compFormats[i]));
+ RL_FREE(compFormats);
/*
// Following capabilities are only supported by OpenGL 4.3 or greater