Initial commit

This commit is contained in:
github-classroom[bot] 2024-11-29 09:50:03 +00:00 committed by GitHub
commit 686dcaf351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 6230 additions and 0 deletions

View file

@ -0,0 +1,36 @@
#ifndef PRINT_PROGRAM_INFO_LOG_H
#define PRINT_PROGRAM_INFO_LOG_H
#include <string>
// Print information about a given glsl shader program.
//
// Inputs:
// obj id of object we're querying
// Returns true if printed anything.
bool print_program_info_log(const GLuint obj);
// Implementation
#include "REDRUM.h"
#include "STR.h"
bool print_program_info_log(const GLuint obj)
{
GLint infologLength = 0;
GLint charsWritten = 0;
glGetProgramiv(obj, GL_INFO_LOG_LENGTH,&infologLength);
if (infologLength > 0)
{
char * infoLog = new char[infologLength];
glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog);
std::string log(infoLog);
std::cerr<<log<<std::endl;
delete[] infoLog;
return true;
}
return false;
}
#endif