texture_from_tga.h 717 B

123456789101112131415161718192021222324252627282930313233343536
  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/gl.h>
  11. #else
  12. # define GL_GLEXT_PROTOTYPES
  13. # include <GL/gl.h>
  14. # include <GL/glext.h>
  15. #endif
  16. #include <string>
  17. namespace igl
  18. {
  19. // Read an image from a .tga file and use it as a texture
  20. //
  21. // Input:
  22. // tga_file path to .tga file
  23. // Output:
  24. // id of generated openGL texture
  25. // Returns true on success, false on failure
  26. IGL_INLINE bool texture_from_tga(const std::string tga_file, GLuint & id);
  27. }
  28. #ifdef IGL_HEADER_ONLY
  29. # include "texture_from_tga.cpp"
  30. #endif
  31. #endif