texture_from_file.h 700 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef IGL_TEXTURE_FROM_FILE_H
  2. #define IGL_TEXTURE_FROM_FILE_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 an image file and use it as a texture. Officially, only
  10. // .tga and .png are supported. Any filetype read by ImageMagick's `convert`
  11. // will work via an unsafe system call.
  12. //
  13. // Input:
  14. // filename path to image file
  15. // Output:
  16. // id of generated openGL texture
  17. // Returns true on success, false on failure
  18. IGL_INLINE bool texture_from_file(const std::string filename, GLuint & id);
  19. }
  20. #ifdef IGL_HEADER_ONLY
  21. # include "texture_from_file.cpp"
  22. #endif
  23. #endif
  24. #endif