Josh's Graphics Library
JGL::Texture Class Reference

Represents texture data loaded on the GPU. Contains a handle that can be passed to OpenGL draw calls. More...

#include <Texture.h>

Public Member Functions

 Texture (const std::string &file, TextureFilteringMode filtering_mode=TextureFilteringMode::BILINEAR, TextureWrappingMode wrapping_mode=TextureWrappingMode::CLAMP_TO_EDGE, const TextureFlag &flags=TextureFlag::INVERT_Y)
 Load a texture from a file,. More...
 
 Texture (Image *software_texture, const Vector2 &size, const TextureFormat &format, TextureFilteringMode filtering_mode, TextureWrappingMode wrapping_mode)
 
 Texture (const Vector2 &size)
 
 Texture (const Texture &rhs)
 
 ~Texture ()
 
GLuint GetGLTextureHandle () const
 
Vector2 GetDimensions () const
 
TextureFilteringMode GetFilteringMode () const
 
TextureWrappingMode GetWrappingMode () const
 
TextureFlag GetFlags () const
 
TextureFormat GetFormat () const
 
std::vector< Color4 > GetPixelData () const
 

Protected Member Functions

void load (Image *software_texture, const Vector2 &size, const TextureFormat &format, TextureFilteringMode filtering_mode, TextureWrappingMode wrapping_mode)
 

Protected Attributes

GLuint texture_handle = 0
 
Vector2 texture_size = {0, 0}
 
ReImage::TextureFlag texture_flags
 
ReImage::TextureFormat texture_format
 
TextureFilteringMode texture_filtering_mode
 
TextureWrappingMode texture_wrapping_mode
 

Detailed Description

Represents texture data loaded on the GPU. Contains a handle that can be passed to OpenGL draw calls.

Constructor & Destructor Documentation

◆ Texture() [1/4]

JGL::Texture::Texture ( const std::string &  file,
TextureFilteringMode  filtering_mode = TextureFilteringMode::BILINEAR,
TextureWrappingMode  wrapping_mode = TextureWrappingMode::CLAMP_TO_EDGE,
const TextureFlag &  flags = TextureFlag::INVERT_Y 
)
explicit

Load a texture from a file,.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Texture() [2/4]

JGL::Texture::Texture ( Image *  software_texture,
const Vector2 &  size,
const TextureFormat &  format,
TextureFilteringMode  filtering_mode,
TextureWrappingMode  wrapping_mode 
)
Here is the call graph for this function:

◆ Texture() [3/4]

JGL::Texture::Texture ( const Vector2 &  size)
explicit

◆ Texture() [4/4]

JGL::Texture::Texture ( const Texture rhs)
Here is the call graph for this function:

◆ ~Texture()

JGL::Texture::~Texture ( )

Member Function Documentation

◆ GetDimensions()

Vector2 JGL::Texture::GetDimensions ( ) const
Here is the caller graph for this function:

◆ GetFilteringMode()

TextureFilteringMode JGL::Texture::GetFilteringMode ( ) const

◆ GetFlags()

TextureFlag JGL::Texture::GetFlags ( ) const
Here is the caller graph for this function:

◆ GetFormat()

TextureFormat JGL::Texture::GetFormat ( ) const

◆ GetGLTextureHandle()

GLuint JGL::Texture::GetGLTextureHandle ( ) const
Here is the caller graph for this function:

◆ GetPixelData()

std::vector< Color4 > JGL::Texture::GetPixelData ( ) const

◆ GetWrappingMode()

TextureWrappingMode JGL::Texture::GetWrappingMode ( ) const
Here is the caller graph for this function:

◆ load()

void JGL::Texture::load ( Image *  software_texture,
const Vector2 &  size,
const TextureFormat &  format,
TextureFilteringMode  filtering_mode,
TextureWrappingMode  wrapping_mode 
)
protected
Here is the caller graph for this function:

Member Data Documentation

◆ texture_filtering_mode

TextureFilteringMode JGL::Texture::texture_filtering_mode
protected

◆ texture_flags

ReImage::TextureFlag JGL::Texture::texture_flags
protected

◆ texture_format

ReImage::TextureFormat JGL::Texture::texture_format
protected

◆ texture_handle

GLuint JGL::Texture::texture_handle = 0
protected

◆ texture_size

Vector2 JGL::Texture::texture_size = {0, 0}
protected

◆ texture_wrapping_mode

TextureWrappingMode JGL::Texture::texture_wrapping_mode
protected

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