diff options
| author | Ray <[email protected]> | 2021-10-16 22:36:47 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2021-10-16 22:36:47 +0200 |
| commit | 1b793e76dc1639e7acb05f34d68bc26145c1f6dd (patch) | |
| tree | 09a930d88f3e61c1262b35b51be23bc4e5cf778e /src | |
| parent | 226c0e362c6784edf7e86e94624da655d185b259 (diff) | |
| download | raylib-1b793e76dc1639e7acb05f34d68bc26145c1f6dd.tar.gz raylib-1b793e76dc1639e7acb05f34d68bc26145c1f6dd.zip | |
Reviewed memory usage
Diffstat (limited to 'src')
| -rw-r--r-- | src/rlgl.h | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -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 |
