texture_from_tga.h 648 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IGL_TEXTURE_FROM_TGA_H
  2. #define IGL_TEXTURE_FROM_TGA_H
  3. #include "igl_inline.h"
  4. #if __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. #include <string>
  15. namespace igl
  16. {
  17. // Read an image from a .tga file and use it as a texture
  18. //
  19. // Input:
  20. // tga_file path to .tga file
  21. // Output:
  22. // id of generated openGL texture
  23. // Returns true on success, false on failure
  24. IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id);
  25. }
  26. #ifdef IGL_HEADER_ONLY
  27. # include "texture_from_tga.cpp"
  28. #endif
  29. #endif