Solar System OpenGL v1.0.0
|
Implements texture loading functionality. More...
#include "texture_loader.h"
Go to the source code of this file.
Functions | |
GLuint | loadTexture (const char *filename) |
Loads a texture from a file and creates an OpenGL texture object. | |
Implements texture loading functionality.
This file provides the implementation of the loadTexture
function, which loads a texture from a file and generates an OpenGL texture object.
GLuint loadTexture | ( | const char * | filename | ) |
Loads a texture from a file and creates an OpenGL texture object.
Loads a texture from a file.
filename | Path to the texture file. |
This function uses the STB image library to load an image from the specified file, creates an OpenGL texture object, and sets its parameters. If the image fails to load, an error message is printed to std::cerr
.