stuff
This commit is contained in:
parent
dc5654ba9a
commit
3ffed086b1
7 changed files with 54 additions and 9 deletions
|
|
@ -96,4 +96,9 @@ namespace engine::Backend
|
|||
void scroll_callback(GLFWwindow* window2, double xoffset, double yoffset)
|
||||
{
|
||||
}
|
||||
|
||||
GLFWwindow* getWindow()
|
||||
{
|
||||
return window;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,4 +18,6 @@ namespace engine::Backend
|
|||
|
||||
bool Init(const char* title, int width, int height);
|
||||
void Cleanup();
|
||||
|
||||
GLFWwindow* getWindow();
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue