예제 #1
0
static void
LinkProgram(GLProgram &program)
{
  program.Link();

  if (program.GetLinkStatus() != GL_TRUE) {
    char log[4096];
    program.GetInfoLog(log, sizeof(log));
    fprintf(stderr, "Shader linker failed: %s\n", log);
  }
}
예제 #2
0
static GLProgram *
CompileProgram(const char *vertex_shader, const char *fragment_shader)
{
  GLProgram *program = new GLProgram();
  CompileAttachShader(*program, GL_VERTEX_SHADER, vertex_shader);
  CompileAttachShader(*program, GL_FRAGMENT_SHADER, fragment_shader);
  program->Link();

  if (program->GetLinkStatus() != GL_TRUE) {
    char log[4096];
    program->GetInfoLog(log, sizeof(log));
    fprintf(stderr, "Shader linker failed: %s\n", log);
  }

  return program;
}