polyadvent

A game engine from scratch in C
git clone git://jb55.com/polyadvent
Log | Files | Refs | README

debug.c (386B)


      1 
      2 #include "debug.h"
      3 #include <stdlib.h>
      4 #include <stdio.h>
      5 
      6 void show_info_log(GLuint shader) {
      7 	GLint msgLen = 0;
      8 	glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &msgLen);
      9 
     10 	// The maxLength includes the NULL character
     11 	char *buffer = malloc(msgLen);
     12 	glGetShaderInfoLog(shader, msgLen, &msgLen, buffer);
     13 
     14   printf("shader error: (%d) %.*s\n", msgLen, msgLen, buffer);
     15 
     16   free(buffer);
     17 }
     18 
     19