Update texture.cpp
Swap texture for missing texture if it couldn't be loaded.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
#include <types/texture.h>
|
||||
#include <SOIL/SOIL.h>
|
||||
#include <iostream>
|
||||
|
||||
void Texture::load(const char* file) {
|
||||
id = SOIL_load_OGL_texture(file, SOIL_LOAD_AUTO, SOIL_CREATE_NEW_ID, SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y);
|
||||
|
||||
if (id == 0)
|
||||
{
|
||||
printf("Couldn't Load Texture: '%s'\n", SOIL_last_result());
|
||||
exit(0);
|
||||
std::cerr << "Couldn't Load Texture: " << file << std::endl;
|
||||
load("assets/textures/missing.png");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user