destroy_shader_program.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  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_OPENGL_DESTROY_SHADER_PROGRAM_H
  9. #define IGL_OPENGL_DESTROY_SHADER_PROGRAM_H
  10. #include "../igl_inline.h"
  11. #include "OpenGL_convenience.h"
  12. namespace igl
  13. {
  14. namespace opengl
  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. }
  29. #ifndef IGL_STATIC_LIBRARY
  30. # include "destroy_shader_program.cpp"
  31. #endif
  32. #endif