texture_from_png.h 552 B

12345678910111213141516171819202122232425262728
  1. #ifndef IGL_TEXTURE_FROM_PNG_H
  2. #define IGL_TEXTURE_FROM_PNG_H
  3. #ifndef IGL_NO_OPENGL
  4. #include "../igl_inline.h"
  5. #include "../OpenGL_convenience.h"
  6. #include <string>
  7. namespace igl
  8. {
  9. // Read an image from a .png file and use it as a texture
  10. //
  11. // Input:
  12. // png_file path to .png file
  13. // Output:
  14. // id of generated openGL texture
  15. // Returns true on success, false on failure
  16. IGL_INLINE bool texture_from_png(const std::string png_file, GLuint & id);
  17. }
  18. #ifdef IGL_HEADER_ONLY
  19. # include "texture_from_png.cpp"
  20. #endif
  21. #endif
  22. #endif