Solar System OpenGL v1.0.0
Loading...
Searching...
No Matches
texture_loader.cpp File Reference

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.
 

Detailed Description

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.

Function Documentation

◆ loadTexture()

GLuint loadTexture ( const char * filename)

Loads a texture from a file and creates an OpenGL texture object.

Loads a texture from a file.

Parameters
filenamePath to the texture file.
Returns
The OpenGL texture ID.

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.