Solar System OpenGL v1.0.0
|
Provides texture loading functionality. More...
Go to the source code of this file.
Macros | |
#define | STB_IMAGE_IMPLEMENTATION |
Defines implementation of the STB image library. | |
Functions | |
GLuint | loadTexture (const char *filename) |
Loads a texture from a file. | |
Provides texture loading functionality.
This file declares functions and includes necessary libraries for loading textures using the STB image library and OpenGL.
#define STB_IMAGE_IMPLEMENTATION |
Defines implementation of the STB image library.
This macro should be defined exactly once in the project to include the implementation of the STB image functions.
GLuint loadTexture | ( | const char * | filename | ) |
Loads a texture from a file.
filename | Path to the texture file. |
This function loads an image from the specified file and generates 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
.