destroy_shader_program.h 878 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef IGL_DESTROY_SHADER_PROGRAM_H
  2. #define IGL_DESTROY_SHADER_PROGRAM_H
  3. #include "igl_inline.h"
  4. #ifdef __APPLE__
  5. # include <OpenGL/gl.h>
  6. #elif defined(_WIN32)
  7. # define NOMINMAX
  8. # include <Windows.h>
  9. # undef NOMINMAX
  10. # include <GL/gl.h>
  11. #else
  12. # define GL_GLEXT_PROTOTYPES
  13. # include <GL/gl.h>
  14. # include <GL/glext.h>
  15. #endif
  16. namespace igl
  17. {
  18. // Properly destroy a shader program. Detach and delete each of its shaders
  19. // and delete it
  20. // Inputs:
  21. // id index id of created shader, set to 0 on error
  22. // Returns true on success, false on error
  23. //
  24. // Note: caller is responsible for making sure he doesn't foolishly continue
  25. // to use id as if it still contains a program
  26. //
  27. // See also: create_shader_program
  28. IGL_INLINE bool destroy_shader_program(const GLuint id);
  29. }
  30. #ifdef IGL_HEADER_ONLY
  31. # include "destroy_shader_program.cpp"
  32. #endif
  33. #endif