destroy_shader_program.h 812 B

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