Brenta Engine 1.1
Loading...
Searching...
No Matches
brenta::texture Class Reference

Texture class. More...

#include <texture.hpp>

Static Public Member Functions

static unsigned int load_texture (std::string path, GLint wrapping=GL_REPEAT, GLint filtering_min=GL_NEAREST, GLint filtering_mag=GL_NEAREST, GLboolean has_mipmap=GL_TRUE, GLint mipmap_min=GL_LINEAR_MIPMAP_LINEAR, GLint mipmap_mag=GL_LINEAR, bool flip=true)
 Load a texture from a file.
 
static void active_texture (GLenum texture)
 Activate a texture unit.
 
static void bind_texture (GLenum target, unsigned int texture, GLint wrapping=GL_REPEAT, GLint filtering_min=GL_NEAREST, GLint filtering_mag=GL_NEAREST, GLboolean hasMipmap=GL_TRUE, GLint mipmap_min=GL_LINEAR_MIPMAP_LINEAR, GLint mipmap_mag=GL_LINEAR)
 Bind a texture.
 

Detailed Description

Texture class.

This class is used to load and manage textures.

Definition at line 40 of file texture.hpp.

Member Function Documentation

◆ active_texture()

void texture::active_texture ( GLenum texture)
static

Activate a texture unit.

This method activates a texture unit.

Definition at line 52 of file texture.cpp.

◆ bind_texture()

void texture::bind_texture ( GLenum target,
unsigned int texture,
GLint wrapping = GL_REPEAT,
GLint filtering_min = GL_NEAREST,
GLint filtering_mag = GL_NEAREST,
GLboolean hasMipmap = GL_TRUE,
GLint mipmap_min = GL_LINEAR_MIPMAP_LINEAR,
GLint mipmap_mag = GL_LINEAR )
static

Bind a texture.

This method binds a texture to a target. The texture is bound with the specified wrapping and filtering modes.

You need to bind the texture before using it in the shader.

Definition at line 57 of file texture.cpp.

◆ load_texture()

unsigned int texture::load_texture ( std::string path,
GLint wrapping = GL_REPEAT,
GLint filtering_min = GL_NEAREST,
GLint filtering_mag = GL_NEAREST,
GLboolean has_mipmap = GL_TRUE,
GLint mipmap_min = GL_LINEAR_MIPMAP_LINEAR,
GLint mipmap_mag = GL_LINEAR,
bool flip = true )
static

Load a texture from a file.

This method loads a texture from a file and returns the texture ID. The texture is loaded using the stb_image library. The texture is loaded with the specified wrapping and filtering modes. The texture can also have mipmaps.

Parameters
pathPath to the texture file
wrappingWrapping mode of the texture
filtering_minFiltering mode of the texture
filtering_magFiltering mode of the texture
has_mipmapIf the texture has mipmaps
mipmap_minMipmap filtering mode of the texture
mipmap_magMipmap filtering mode of the texture
flipIf the texture should be flipped
Returns
The texture ID

Definition at line 37 of file texture.cpp.


The documentation for this class was generated from the following files: