load_shader.h 703 B

123456789101112131415161718192021222324252627282930313233
  1. #ifndef IGL_LOAD_SHADER_H
  2. #define IGL_LOAD_SHADER_H
  3. #include "igl_inline.h"
  4. #ifdef __APPLE__
  5. # include <OpenGL/gl.h>
  6. #else
  7. # ifdef _WIN32
  8. # define NOMINMAX
  9. # include <Windows.h>
  10. # undef NOMINMAX
  11. # endif
  12. # include <GL/gl.h>
  13. #endif
  14. namespace igl
  15. {
  16. // Creates and compiles a shader from a given string
  17. // Inputs:
  18. // src string containing GLSL shader code
  19. // type GLSL type of shader, one of:
  20. // GL_VERTEX_SHADER
  21. // GL_FRAGMENT_SHADER
  22. // GL_GEOMETRY_SHADER
  23. // Returns index id of the newly created shader, 0 on error
  24. IGL_INLINE GLuint load_shader(const char *src,const GLenum type);
  25. }
  26. #ifdef IGL_HEADER_ONLY
  27. # include "load_shader.cpp"
  28. #endif
  29. #endif