destroy_shader_program.h 901 B

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