scg3  0.6
scg::TextureCoreFactory Class Reference

A factory to create textures. More...

#include "TextureCoreFactory.h"

Collaboration diagram for scg::TextureCoreFactory:
[legend]

Public Member Functions

 TextureCoreFactory ()
 
 TextureCoreFactory (const std::string &filePath)
 
virtual ~TextureCoreFactory ()
 
void addFilePath (const std::string &filePath)
 
Texture2DCoreSP create2DTextureFromFile (const std::string &fileName, GLenum wrapModeS, GLenum wrapModeT, GLenum minFilter, GLenum magFilter)
 
BumpMapCoreSP createBumpMapFromFiles (const std::string &texFileName, const std::string &normalFileName, GLenum wrapModeS, GLenum wrapModeT, GLenum minFilter, GLenum magFilter)
 
CubeMapCoreSP createCubeMapFromFiles (const std::vector< std::string > &fileNames)
 
CubeMapCoreSP createCubeMapFromFiles (std::vector< std::string > &&fileNames)
 

Protected Attributes

std::vector< std::string > filePaths_
 

Detailed Description

A factory to create textures.

Examples
scg3_table_scene_example.cpp.

Definition at line 39 of file TextureCoreFactory.h.

Constructor & Destructor Documentation

◆ TextureCoreFactory() [1/2]

scg::TextureCoreFactory::TextureCoreFactory ( )

Constructor.

◆ TextureCoreFactory() [2/2]

scg::TextureCoreFactory::TextureCoreFactory ( const std::string &  filePath)

Constructor with one or more file paths to be searched for texture files. More than one file paths can be defined using ';' or ',' as delimiter.

Example: addFilePath("../textures1;../textures2")

◆ ~TextureCoreFactory()

virtual scg::TextureCoreFactory::~TextureCoreFactory ( )
virtual

Destructor.

Member Function Documentation

◆ addFilePath()

void scg::TextureCoreFactory::addFilePath ( const std::string &  filePath)

Add one or more file paths to be searched for texture files. More than one file paths can be defined using ';' or ',' as delimiter.

Example: addFilePath("../textures1;../textures2")

◆ create2DTextureFromFile()

Texture2DCoreSP scg::TextureCoreFactory::create2DTextureFromFile ( const std::string &  fileName,
GLenum  wrapModeS,
GLenum  wrapModeT,
GLenum  minFilter,
GLenum  magFilter 
)

Load texture image from source file and create a 2D texture with given parameters. If minFilter is GL_*_MIPMAP_* (see below), a mipmap is created from the given image.

Parameters
fileNamefile name to be searched for in known file paths
wrapModeSGL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT
wrapModeTsee wrapModeS
minFilterGL_NEAREST, GL_LINEAR,
GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR
magFilterGL_NEAREST or GL_LINEAR

◆ createBumpMapFromFiles()

BumpMapCoreSP scg::TextureCoreFactory::createBumpMapFromFiles ( const std::string &  texFileName,
const std::string &  normalFileName,
GLenum  wrapModeS,
GLenum  wrapModeT,
GLenum  minFilter,
GLenum  magFilter 
)

Load texture (optional) and normal map images from source files and create a bump map with given parameters. If minFilter is GL_*_MIPMAP_* (see below), mipmaps are created from the given images.

Parameters
texFileNametexture file name to be searched for in known file paths
normalFileNamenormal map file name to be searched for in known file paths
wrapModeSGL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT
wrapModeTsee wrapModeS
minFilterGL_NEAREST, GL_LINEAR,
GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR
magFilterGL_NEAREST or GL_LINEAR

◆ createCubeMapFromFiles() [1/2]

CubeMapCoreSP scg::TextureCoreFactory::createCubeMapFromFiles ( const std::vector< std::string > &  fileNames)

Load texture images from source files and create a cube map.

Parameters
fileNames6 texture file names for directions +x, -x, +y, -y, +z, -z to be searched for in known file paths

◆ createCubeMapFromFiles() [2/2]

CubeMapCoreSP scg::TextureCoreFactory::createCubeMapFromFiles ( std::vector< std::string > &&  fileNames)

Load texture images from source files and create a cube map.

Parameters
fileNames6 texture file names for directions +x, -x, +y, -y, +z, -z to be searched for in known file paths

Member Data Documentation

◆ filePaths_

std::vector<std::string> scg::TextureCoreFactory::filePaths_
protected

Definition at line 122 of file TextureCoreFactory.h.


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