texture_from_tga.h 740 B

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