Start load texture logic
I just wanted to get something in here to make sure the branch is working with automatic tests and that FreeImage wouldn't throw errors now that I'm actually using it.
This commit is contained in:
parent
c3508f28a5
commit
347d46c900
|
@ -0,0 +1,10 @@
|
|||
#ifndef LOAD_TEXTURE_H_
|
||||
#define LOAD_TEXTURE_H_
|
||||
|
||||
#include <FreeImage.h>
|
||||
|
||||
namespace Texture {
|
||||
void LoadTexture(const char* filePath);
|
||||
}
|
||||
|
||||
#endif // LOAD_TEXTURE_H_
|
|
@ -0,0 +1,16 @@
|
|||
#include "load_texture.h"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -35,6 +35,8 @@
|
|||
#include <imgui_impl_glfw.h>
|
||||
#include <imgui_impl_opengl3.h>
|
||||
|
||||
#include <FreeImage.h>
|
||||
|
||||
#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");
|
||||
|
|
Loading…
Reference in New Issue