|
@@ -10,6 +10,7 @@
|
|
|
|
|
|
#include "load_shader.h"
|
|
|
#include "print_program_info_log.h"
|
|
|
+#include <iostream>
|
|
|
#include <cstdio>
|
|
|
|
|
|
IGL_INLINE bool igl::create_shader_program(
|
|
@@ -18,12 +19,12 @@ IGL_INLINE bool igl::create_shader_program(
|
|
|
const std::map<std::string,GLuint> & attrib,
|
|
|
GLuint & id)
|
|
|
{
|
|
|
+ using namespace std;
|
|
|
if(vert_source == "" && frag_source == "")
|
|
|
{
|
|
|
- fprintf(
|
|
|
- stderr,
|
|
|
- "Error: create_shader_program() could not create shader program,"
|
|
|
- " both .vert and .frag source given were empty\n");
|
|
|
+ cerr<<
|
|
|
+ "create_shader_program() could not create shader program,"
|
|
|
+ " both .vert and .frag source given were empty"<<endl;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -31,9 +32,7 @@ IGL_INLINE bool igl::create_shader_program(
|
|
|
id = glCreateProgram();
|
|
|
if(id == 0)
|
|
|
{
|
|
|
- fprintf(
|
|
|
- stderr,
|
|
|
- "Error: create_shader_program() could not create shader program.\n");
|
|
|
+ cerr<<"create_shader_program() could not create shader program."<<endl;
|
|
|
return false;
|
|
|
}
|
|
|
|
|
@@ -43,6 +42,7 @@ IGL_INLINE bool igl::create_shader_program(
|
|
|
GLuint v = igl::load_shader(vert_source.c_str(),GL_VERTEX_SHADER);
|
|
|
if(v == 0)
|
|
|
{
|
|
|
+ cerr<<"vertex shader failed to compile."<<endl;
|
|
|
return false;
|
|
|
}
|
|
|
glAttachShader(id,v);
|
|
@@ -54,6 +54,7 @@ IGL_INLINE bool igl::create_shader_program(
|
|
|
GLuint f = igl::load_shader(frag_source.c_str(),GL_FRAGMENT_SHADER);
|
|
|
if(f == 0)
|
|
|
{
|
|
|
+ cerr<<"fragment shader failed to compile."<<endl;
|
|
|
return false;
|
|
|
}
|
|
|
glAttachShader(id,f);
|