![]() |
scg3
0.6
|
A factory to create textures. More...
#include "TextureCoreFactory.h"
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_ |
A factory to create textures.
Definition at line 39 of file TextureCoreFactory.h.
scg::TextureCoreFactory::TextureCoreFactory | ( | ) |
Constructor.
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")
|
virtual |
Destructor.
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")
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.
fileName | file name to be searched for in known file paths |
wrapModeS | GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT |
wrapModeT | see wrapModeS |
minFilter | GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR |
magFilter | GL_NEAREST or GL_LINEAR |
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.
texFileName | texture file name to be searched for in known file paths |
normalFileName | normal map file name to be searched for in known file paths |
wrapModeS | GL_CLAMP, GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE, GL_MIRRORED_REPEAT, or GL_REPEAT |
wrapModeT | see wrapModeS |
minFilter | GL_NEAREST, GL_LINEAR, GL_NEAREST_MIPMAP_NEAREST, GL_LINEAR_MIPMAP_NEAREST, GL_NEAREST_MIPMAP_LINEAR, or GL_LINEAR_MIPMAP_LINEAR |
magFilter | GL_NEAREST or GL_LINEAR |
CubeMapCoreSP scg::TextureCoreFactory::createCubeMapFromFiles | ( | const std::vector< std::string > & | fileNames | ) |
Load texture images from source files and create a cube map.
fileNames | 6 texture file names for directions +x, -x, +y, -y, +z, -z to be searched for in known file paths |
CubeMapCoreSP scg::TextureCoreFactory::createCubeMapFromFiles | ( | std::vector< std::string > && | fileNames | ) |
Load texture images from source files and create a cube map.
fileNames | 6 texture file names for directions +x, -x, +y, -y, +z, -z to be searched for in known file paths |
|
protected |
Definition at line 122 of file TextureCoreFactory.h.