1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-13 12:17:10 +00:00

Eliminate VLAs for the benefit of MSVC.

This commit is contained in:
Arthur O'Dwyer
2018-06-27 15:35:45 -07:00
parent 6753cc2e39
commit 62db7ee250
7 changed files with 21 additions and 22 deletions

View File

@@ -172,10 +172,10 @@ int compileShader(int type, const string& s) {
GLint logLength;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
char log[logLength];
glGetShaderInfoLog(shader, logLength, &logLength, log);
std::vector<char> log(logLength);
glGetShaderInfoLog(shader, logLength, &logLength, log.data());
if(logLength > 0)
printf("compiler log (%d): '%s'\n", logLength, log);
printf("compiler log (%d): '%s'\n", logLength, log.data());
}
glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
@@ -232,10 +232,10 @@ struct GLprogram {
GLint logLength;
glGetProgramiv(_program, GL_INFO_LOG_LENGTH, &logLength);
if (logLength > 0) {
char log[logLength];
glGetProgramInfoLog(_program, logLength, &logLength, log);
std::vector<char> log(logLength);
glGetProgramInfoLog(_program, logLength, &logLength, log.data());
if(logLength > 0)
printf("linking log (%d): %s\n", logLength, log);
printf("linking log (%d): %s\n", logLength, log.data());
}
glGetProgramiv(_program, GL_LINK_STATUS, &status);