load_shader.h 597 B

1234567891011121314151617181920212223242526
  1. #ifndef IGL_LOAD_SHADER_H
  2. #define IGL_LOAD_SHADER_H
  3. #ifndef IGL_NO_OPENGL
  4. #include "igl_inline.h"
  5. #include "OpenGL_convenience.h"
  6. namespace igl
  7. {
  8. // Creates and compiles a shader from a given string
  9. // Inputs:
  10. // src string containing GLSL shader code
  11. // type GLSL type of shader, one of:
  12. // GL_VERTEX_SHADER
  13. // GL_FRAGMENT_SHADER
  14. // GL_GEOMETRY_SHADER
  15. // Returns index id of the newly created shader, 0 on error
  16. IGL_INLINE GLuint load_shader(const char *src,const GLenum type);
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "load_shader.cpp"
  20. #endif
  21. #endif
  22. #endif