diff --git a/include/load_texture.h b/include/load_texture.h new file mode 100644 index 0000000..0c3cf9a --- /dev/null +++ b/include/load_texture.h @@ -0,0 +1,10 @@ +#ifndef LOAD_TEXTURE_H_ +#define LOAD_TEXTURE_H_ + +#include + +namespace Texture { + void LoadTexture(const char* filePath); +} + +#endif // LOAD_TEXTURE_H_ \ No newline at end of file diff --git a/source/load_texture.cpp b/source/load_texture.cpp new file mode 100644 index 0000000..1f70c2f --- /dev/null +++ b/source/load_texture.cpp @@ -0,0 +1,16 @@ +#include "load_texture.h" + +#include + +namespace Texture { + void LoadTexture(const char* filePath) { + FIBITMAP* bitmap = FreeImage_Load(FIF_TIFF, filePath, TIFF_DEFAULT); + + if(!bitmap) { + std::cerr << "Failed to load TIFF image: " << filePath << std::endl; + } + + FIBITMAP* bitmap32 = FreeImage_ConvertTo32Bits(bitmap); + FreeImage_Unload(bitmap); + } +} \ No newline at end of file diff --git a/source/main.cpp b/source/main.cpp index ca19995..9a049b3 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -35,6 +35,8 @@ #include #include +#include + #include "callbacks.h" #include "scene.h" @@ -146,6 +148,7 @@ int main() { Callbacks::Register(window, &scene); scene.Init(); InitializeImGui(window); + FreeImage_Initialise(); // Check if we're in test mode const char* testEnv = std::getenv("TEST_MODE");