This commit is contained in:
Claire Schwarzer 2026-07-09 18:38:46 +02:00
parent dc5654ba9a
commit 3ffed086b1
7 changed files with 54 additions and 9 deletions

View file

@ -96,4 +96,9 @@ namespace engine::Backend
void scroll_callback(GLFWwindow* window2, double xoffset, double yoffset)
{
}
GLFWwindow* getWindow()
{
return window;
}
}

View file

@ -18,4 +18,6 @@ namespace engine::Backend
bool Init(const char* title, int width, int height);
void Cleanup();
GLFWwindow* getWindow();
}

View file

@ -187,7 +187,7 @@ vector<Texture> Model::loadMaterialTextures(aiMaterial *mat, aiTextureType type,
string defaultPath = "DefaultTexture.jpg";
Texture texture;
texture.id = TextureFromFile(defaultPath.c_str(), "assets/");
texture.id = TextureFromFile(defaultPath.c_str(), "assets");
texture.type = typeName;
texture.path = defaultPath;
textures.push_back(texture);
@ -201,8 +201,7 @@ vector<Texture> Model::loadMaterialTextures(aiMaterial *mat, aiTextureType type,
unsigned inline int TextureFromFile(const char *path, const string &directory, bool gamma)
{
string filename = string(path);
filename = directory + '/' + filename;
string filename = directory + '/' + path;
unsigned int textureID;
glGenTextures(1, &textureID);
@ -232,7 +231,8 @@ unsigned inline int TextureFromFile(const char *path, const string &directory, b
}
else
{
std::cout << "Texture failed to load at path: " << path << std::endl;
std::cout << "Texture failed to load at path: " << filename << std::endl;
std::cerr << "STB Reason: " << stbi_failure_reason() << "\n";
stbi_image_free(data);
}

View file

@ -3,7 +3,6 @@
#include <iostream>
#include <glad/glad.h>
#define STB_IMAGE_IMPLEMENTATION
#include <stb/stb_image.h>
Texture::Texture(const char* texturePath, bool flip)