load_shader.h 947 B

123456789101112131415161718192021222324252627282930313233
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_LOAD_SHADER_H
  9. #define IGL_LOAD_SHADER_H
  10. #ifndef IGL_NO_OPENGL
  11. #include "igl_inline.h"
  12. #include "OpenGL_convenience.h"
  13. namespace igl
  14. {
  15. // Creates and compiles a shader from a given string
  16. // Inputs:
  17. // src string containing GLSL shader code
  18. // type GLSL type of shader, one of:
  19. // GL_VERTEX_SHADER
  20. // GL_FRAGMENT_SHADER
  21. // GL_GEOMETRY_SHADER
  22. // Returns index id of the newly created shader, 0 on error
  23. IGL_INLINE GLuint load_shader(const char *src,const GLenum type);
  24. }
  25. #ifndef IGL_STATIC_LIBRARY
  26. # include "load_shader.cpp"
  27. #endif
  28. #endif
  29. #endif