cat3d
A tiny OpenGL 3D engine library written in and for C++.
Public Member Functions | List of all members
cat3d::gl::texture Class Reference

Internal opengl texture representation. More...

#include <texture.hpp>

Public Member Functions

void del ()
 Delete the internal opengl representation.
 
void load_file (const std::string &path)
 Load a file from the given path. More...
 
void load_color (color col)
 Load a 1x1 pixel texture of a given color. More...
 
void set_wrap_mode (texture_wrap_mode mode)
 Set the texture's wrapping mode. More...
 
void set_border_color (color col)
 When the texture's wrapping mode is set to CLAMP_TO_BORDER, there needs to be a configured border color. More...
 
void set_filter_mode (texture_filter_mode mode)
 Sets the texture's filtering mode. More...
 
void bind ()
 Bind the texture to the opengl context.
 
void unbind ()
 Unbind the texture.
 

Detailed Description

Internal opengl texture representation.

Member Function Documentation

◆ load_color()

void cat3d::gl::texture::load_color ( color  col)

Load a 1x1 pixel texture of a given color.

Remarks
set_wrap_mode() should be set to REPEAT to copy the color throughout any model using this texture.
Parameters
colThe color to use.

◆ load_file()

void cat3d::gl::texture::load_file ( const std::string &  path)

Load a file from the given path.

Parameters
pathThe path to the file

◆ set_border_color()

void cat3d::gl::texture::set_border_color ( color  col)

When the texture's wrapping mode is set to CLAMP_TO_BORDER, there needs to be a configured border color.

Parameters
colThe color to set the border to.

◆ set_filter_mode()

void cat3d::gl::texture::set_filter_mode ( texture_filter_mode  mode)

Sets the texture's filtering mode.

Parameters
modeThe texture filtering mode
Remarks
NEAREST appears more pixellated, while LINEAR appears more interpolated.

◆ set_wrap_mode()

void cat3d::gl::texture::set_wrap_mode ( texture_wrap_mode  mode)

Set the texture's wrapping mode.

Parameters
mode

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