PURE API 0.5
PR00F's Ultimate Rendering Engine full documentation
Loading...
Searching...
No Matches
PureTexture::PureTextureImpl Class Reference

Detailed Description

Definition at line 17 of file PureTextureImpl.h.

#include <PureTextureImpl.h>

Public Member Functions

virtual ~PureTextureImpl ()
 
TPURE_TEX_FORMAT getInternalFormat () const
 
GLuint getInternalNum () const
 
TPURE_ISO_TEX_FILTERING getMinFilteringMode () const
 
TPURE_ISO_TEX_FILTERING getMagFilteringMode () const
 
TPureBool setMinFilteringMode (TPURE_ISO_TEX_FILTERING filtering)
 
TPureBool setMagFilteringMode (TPURE_ISO_TEX_FILTERING filtering)
 
TPureBool setIsoFilteringMode (TPURE_ISO_TEX_FILTERING minfilter, TPURE_ISO_TEX_FILTERING magfilter)
 
TPureUInt getMIPmapCount () const
 
TPURE_ANISO_TEX_FILTERING getAnisoFilteringMode () const
 
TPureBool setAnisoFilteringMode (TPURE_ANISO_TEX_FILTERING filtering)
 
TPURE_TEX_WRAPPING getTextureWrappingModeS () const
 
TPURE_TEX_WRAPPING getTextureWrappingModeT () const
 
TPureBool setTextureWrappingMode (TPURE_TEX_WRAPPING tw_s, TPURE_TEX_WRAPPING tw_t)
 
TPureBool getBorder () const
 
TPureBool setBorder (TPureBool state)
 
const PureColorgetBorderColor () const
 
TPureBool setBorderColor (const PureColor &clr)
 
TPureBool uploadPixels ()
 
virtual TPureUInt getUsedSystemMemory () const
 
TPureUInt getUsedTextureMemory () const
 

Static Public Member Functions

static TPURE_ISO_TEX_FILTERING getPureisoTexFilteringNameFromGLname (GLenum value)
 Gets the Pure iso texture filtering value that corresponds to the given GL enum value.
 
static GLenum getGLnameFromPureisoTexFilteringName (TPURE_ISO_TEX_FILTERING value)
 Gets the GL enum value that corresponds to the given Pure iso texture filtering value.
 
static TPURE_TEX_WRAPPING getPuretexWrappingNameFromGLname (GLenum value)
 Gets the Pure texture wrapping mode value that corresponds to the given GL enum value.
 
static GLenum getGLnameFromPuretexWrappingName (TPURE_TEX_WRAPPING value)
 Gets the GL enum value that corresponds to the given Pure texture wrapping mode value.
 

Private Member Functions

 PureTextureImpl (PureTexture *owner)
 Only PureTexture or PureTextureManager creates it.
 
 PureTextureImpl (PureTexture *owner, const PureImage &img)
 Only PureTexture or PureTextureManager creates it this way.
 
 PureTextureImpl (const PureTextureImpl &)
 
PureTextureImploperator= (const PureTextureImpl &)
 
GLenum getTransformedSourceFormat (TPURE_PIXEL_COMPONENT_ORDER oldco)
 Transforms to a proper pixel component order and returns the source format.
 
GLint getTargetInternalFormat ()
 Figures out the target internal format.
 
TPureBool actualUploadProc (GLint internalfmt, GLenum glTexFormat)
 This contains the actual pixel upload code.
 
void DescribeTexFormatAndSize (GLint internalfmt)
 Updates texFormat and nSize members based on given internalfmt.
 

Private Attributes

PureTexture_pOwner
 The owner public object who creates this pimpl object.
 
TPureUInt nSize
 Amount of VRAM allocated (considering compression, MIP mapping, etc...).
 
TPURE_TEX_FORMAT texFormat
 Texture format.
 
TPURE_ISO_TEX_FILTERING filtIsoMin
 Isotropic filtering mode when zooming out (1 texel < 1 pixel).
 
TPURE_ISO_TEX_FILTERING filtIsoMag
 Isotropic filtering mode when zooming in (1 texel > 1 pixel).
 
TPURE_ANISO_TEX_FILTERING filtAniso
 Anisotropic filtering mode.
 
GLuint nInternalNum
 OpenGL texture ID.
 
TPureUInt nMIPmapCount
 Number of MIP maps (>0).
 
TPURE_TEX_COMPRESSION_MODE texCompr
 Texture compression mode.
 
TPureBool bBorder
 Texture has border or not.
 
PureColor clrBorder
 Texture border color.
 
TPURE_TEX_WRAPPING twS
 
TPURE_TEX_WRAPPING twT
 Texture wrapping mode for S- and T- texture coordinates.
 

Friends

class PureTexture
 
class PureTextureManager
 

Constructor & Destructor Documentation

◆ ~PureTextureImpl()

PureTexture::PureTextureImpl::~PureTextureImpl ( )
virtual

Definition at line 162 of file PureTexture.cpp.

◆ PureTextureImpl() [1/3]

PureTexture::PureTextureImpl::PureTextureImpl ( PureTexture * owner)
private

Only PureTexture or PureTextureManager creates it.

Only PureTextureManager creates it.

Parameters
ownerThe public class owning this pimpl object.

Definition at line 479 of file PureTexture.cpp.

◆ PureTextureImpl() [2/3]

PureTexture::PureTextureImpl::PureTextureImpl ( PureTexture * owner,
const PureImage & img )
private

Only PureTexture or PureTextureManager creates it this way.

Only PureTextureManager creates it this way.

Definition at line 488 of file PureTexture.cpp.

◆ PureTextureImpl() [3/3]

PureTexture::PureTextureImpl::PureTextureImpl ( const PureTextureImpl & )
private

Definition at line 502 of file PureTexture.cpp.

Member Function Documentation

◆ actualUploadProc()

TPureBool PureTexture::PureTextureImpl::actualUploadProc ( GLint internalfmt,
GLenum glTexFormat )
private

This contains the actual pixel upload code.

The following properties of the given texture object should be set properly before calling this method:

  • nMIPmapCount: should be a positive value; if 1, no MIP maps will be generated, otherwise MIP maps will be generated.
  • nWidth, nHeight: although not used by this method (because the method uses sizes of the given Image), it is recommended to be already defined.
Parameters
internalfmtOpenGL target internal format for storing texture in VRAM. Suitable can be selected by getTargetInternalFormat().
glTexFormatOpenGL source format, how to interpret input. Suitable can be selected by getTransformedSourceFormat().
Returns
True on success, false on error.

Definition at line 612 of file PureTexture.cpp.

◆ DescribeTexFormatAndSize()

void PureTexture::PureTextureImpl::DescribeTexFormatAndSize ( GLint internalfmt)
private

Updates texFormat and nSize members based on given internalfmt.

Internal format (texFormat) and used texture memory (nSize) will be updated based on given internalfmt.

This is needed so that real size and compression is queried from OpenGL after the texture has been uploaded. Not doing much when software rendering is selected.

Definition at line 670 of file PureTexture.cpp.

◆ getAnisoFilteringMode()

TPURE_ANISO_TEX_FILTERING PureTexture::PureTextureImpl::getAnisoFilteringMode ( ) const

Definition at line 250 of file PureTexture.cpp.

◆ getBorder()

TPureBool PureTexture::PureTextureImpl::getBorder ( ) const

Definition at line 343 of file PureTexture.cpp.

◆ getBorderColor()

const PureColor & PureTexture::PureTextureImpl::getBorderColor ( ) const

Definition at line 356 of file PureTexture.cpp.

◆ getGLnameFromPureisoTexFilteringName()

GLenum PureTexture::PureTextureImpl::getGLnameFromPureisoTexFilteringName ( TPURE_ISO_TEX_FILTERING value)
static

Gets the GL enum value that corresponds to the given Pure iso texture filtering value.

Returns
A GL texture filtering enum value corresponding to the given value. GL_LINEAR if invalid value is given.

Definition at line 109 of file PureTexture.cpp.

◆ getGLnameFromPuretexWrappingName()

GLenum PureTexture::PureTextureImpl::getGLnameFromPuretexWrappingName ( TPURE_TEX_WRAPPING value)
static

Gets the GL enum value that corresponds to the given Pure texture wrapping mode value.

Returns
A GL texture wrapping enum value corresponding to the given value. GL_REPEAT if invalid value is given.

Definition at line 148 of file PureTexture.cpp.

◆ getInternalFormat()

TPURE_TEX_FORMAT PureTexture::PureTextureImpl::getInternalFormat ( ) const

Definition at line 174 of file PureTexture.cpp.

◆ getInternalNum()

GLuint PureTexture::PureTextureImpl::getInternalNum ( ) const

Definition at line 180 of file PureTexture.cpp.

◆ getMagFilteringMode()

TPURE_ISO_TEX_FILTERING PureTexture::PureTextureImpl::getMagFilteringMode ( ) const

Definition at line 192 of file PureTexture.cpp.

◆ getMinFilteringMode()

TPURE_ISO_TEX_FILTERING PureTexture::PureTextureImpl::getMinFilteringMode ( ) const

Definition at line 186 of file PureTexture.cpp.

◆ getMIPmapCount()

TPureUInt PureTexture::PureTextureImpl::getMIPmapCount ( ) const

Definition at line 244 of file PureTexture.cpp.

◆ getPureisoTexFilteringNameFromGLname()

TPURE_ISO_TEX_FILTERING PureTexture::PureTextureImpl::getPureisoTexFilteringNameFromGLname ( GLenum value)
static

Gets the Pure iso texture filtering value that corresponds to the given GL enum value.

Returns
A GL texture filtering enum value corresponding to the given value. PURE_ISO_LINEAR if invalid value is given.

Definition at line 89 of file PureTexture.cpp.

◆ getPuretexWrappingNameFromGLname()

TPURE_TEX_WRAPPING PureTexture::PureTextureImpl::getPuretexWrappingNameFromGLname ( GLenum value)
static

Gets the Pure texture wrapping mode value that corresponds to the given GL enum value.

Returns
A Pure texture wrapping mode value corresponding to the given GL value. PURE_TW_REPEAT if invalid value is given.

Definition at line 129 of file PureTexture.cpp.

◆ getTargetInternalFormat()

GLint PureTexture::PureTextureImpl::getTargetInternalFormat ( )
private

Figures out the target internal format.

Used when uploading pixels as a texture to the VGA.

Returns
OpenGL target internal format for storing texture in VRAM.

Definition at line 575 of file PureTexture.cpp.

◆ getTextureWrappingModeS()

TPURE_TEX_WRAPPING PureTexture::PureTextureImpl::getTextureWrappingModeS ( ) const

Definition at line 312 of file PureTexture.cpp.

◆ getTextureWrappingModeT()

TPURE_TEX_WRAPPING PureTexture::PureTextureImpl::getTextureWrappingModeT ( ) const

Definition at line 318 of file PureTexture.cpp.

◆ getTransformedSourceFormat()

GLenum PureTexture::PureTextureImpl::getTransformedSourceFormat ( TPURE_PIXEL_COMPONENT_ORDER oldco)
private

Transforms to a proper pixel component order and returns the source format.

Transforms to a proper pixel component order and returns the proper OpenGL source format.

For example, if the image's color component order is PURE_BGR and OpenGL driver supports that format natively, no transform is needed, respective OpenGL source format will be returned quickly. However if driver doesn't have support for that, then color component order first gets transformed to PURE_RGB, and then respective OpenGL source format will be returned.

Returns
OpenGL source format enum. GL_INVALID_ENUM in case of error.

Definition at line 521 of file PureTexture.cpp.

◆ getUsedSystemMemory()

TPureUInt PureTexture::PureTextureImpl::getUsedSystemMemory ( ) const
virtual

Definition at line 455 of file PureTexture.cpp.

◆ getUsedTextureMemory()

TPureUInt PureTexture::PureTextureImpl::getUsedTextureMemory ( ) const

Definition at line 462 of file PureTexture.cpp.

◆ operator=()

PureTexture::PureTextureImpl & PureTexture::PureTextureImpl::operator= ( const PureTextureImpl & )
private

Definition at line 508 of file PureTexture.cpp.

◆ setAnisoFilteringMode()

TPureBool PureTexture::PureTextureImpl::setAnisoFilteringMode ( TPURE_ANISO_TEX_FILTERING filtering)

Definition at line 256 of file PureTexture.cpp.

◆ setBorder()

TPureBool PureTexture::PureTextureImpl::setBorder ( TPureBool state)

Definition at line 349 of file PureTexture.cpp.

◆ setBorderColor()

TPureBool PureTexture::PureTextureImpl::setBorderColor ( const PureColor & clr)

Definition at line 362 of file PureTexture.cpp.

◆ setIsoFilteringMode()

TPureBool PureTexture::PureTextureImpl::setIsoFilteringMode ( TPURE_ISO_TEX_FILTERING minfilter,
TPURE_ISO_TEX_FILTERING magfilter )

Definition at line 238 of file PureTexture.cpp.

◆ setMagFilteringMode()

TPureBool PureTexture::PureTextureImpl::setMagFilteringMode ( TPURE_ISO_TEX_FILTERING filtering)

Definition at line 217 of file PureTexture.cpp.

◆ setMinFilteringMode()

TPureBool PureTexture::PureTextureImpl::setMinFilteringMode ( TPURE_ISO_TEX_FILTERING filtering)

Definition at line 198 of file PureTexture.cpp.

◆ setTextureWrappingMode()

TPureBool PureTexture::PureTextureImpl::setTextureWrappingMode ( TPURE_TEX_WRAPPING tw_s,
TPURE_TEX_WRAPPING tw_t )

Definition at line 324 of file PureTexture.cpp.

◆ uploadPixels()

TPureBool PureTexture::PureTextureImpl::uploadPixels ( )

Definition at line 387 of file PureTexture.cpp.

Friends And Related Symbol Documentation

◆ PureTexture

friend class PureTexture
friend

Definition at line 113 of file PureTextureImpl.h.

◆ PureTextureManager

friend class PureTextureManager
friend

Definition at line 114 of file PureTextureImpl.h.

Member Data Documentation

◆ _pOwner

PureTexture* PureTexture::PureTextureImpl::_pOwner
private

The owner public object who creates this pimpl object.

Definition at line 78 of file PureTextureImpl.h.

◆ bBorder

TPureBool PureTexture::PureTextureImpl::bBorder
private

Texture has border or not.

Definition at line 88 of file PureTextureImpl.h.

◆ clrBorder

PureColor PureTexture::PureTextureImpl::clrBorder
private

Texture border color.

Black by default.

Definition at line 89 of file PureTextureImpl.h.

◆ filtAniso

TPURE_ANISO_TEX_FILTERING PureTexture::PureTextureImpl::filtAniso
private

Anisotropic filtering mode.

Definition at line 84 of file PureTextureImpl.h.

◆ filtIsoMag

TPURE_ISO_TEX_FILTERING PureTexture::PureTextureImpl::filtIsoMag
private

Isotropic filtering mode when zooming in (1 texel > 1 pixel).

Definition at line 83 of file PureTextureImpl.h.

◆ filtIsoMin

TPURE_ISO_TEX_FILTERING PureTexture::PureTextureImpl::filtIsoMin
private

Isotropic filtering mode when zooming out (1 texel < 1 pixel).

Definition at line 82 of file PureTextureImpl.h.

◆ nInternalNum

GLuint PureTexture::PureTextureImpl::nInternalNum
private

OpenGL texture ID.

Definition at line 85 of file PureTextureImpl.h.

◆ nMIPmapCount

TPureUInt PureTexture::PureTextureImpl::nMIPmapCount
private

Number of MIP maps (>0).

Definition at line 86 of file PureTextureImpl.h.

◆ nSize

TPureUInt PureTexture::PureTextureImpl::nSize
private

Amount of VRAM allocated (considering compression, MIP mapping, etc...).

Definition at line 80 of file PureTextureImpl.h.

◆ texCompr

TPURE_TEX_COMPRESSION_MODE PureTexture::PureTextureImpl::texCompr
private

Texture compression mode.

Definition at line 87 of file PureTextureImpl.h.

◆ texFormat

TPURE_TEX_FORMAT PureTexture::PureTextureImpl::texFormat
private

Texture format.

Definition at line 81 of file PureTextureImpl.h.

◆ twS

TPURE_TEX_WRAPPING PureTexture::PureTextureImpl::twS
private

Definition at line 90 of file PureTextureImpl.h.

◆ twT

TPURE_TEX_WRAPPING PureTexture::PureTextureImpl::twT
private

Texture wrapping mode for S- and T- texture coordinates.

Definition at line 90 of file PureTextureImpl.h.


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