destroy_shader_program.h 861 B

123456789101112131415161718192021222324252627282930313233343536
  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. #else
  11. #define GL_GLEXT_PROTOTYPES
  12. # include <GL/gl.h>
  13. # include <GL/glext.h>
  14. #endif
  15. namespace igl
  16. {
  17. // Properly destroy a shader program. Detach and delete each of its shaders
  18. // and delete it
  19. // Inputs:
  20. // id index id of created shader, set to 0 on error
  21. // Returns true on success, false on error
  22. //
  23. // Note: caller is responsible for making sure he doesn't foolishly continue
  24. // to use id as if it still contains a program
  25. //
  26. // See also: create_shader_program
  27. IGL_INLINE bool destroy_shader_program(const GLuint id);
  28. }
  29. #ifdef IGL_HEADER_ONLY
  30. # include "destroy_shader_program.cpp"
  31. #endif
  32. #endif