The VgITextureManager class is used to create VgITexture given a VgBinaryBuffer. More...
Public Member Functions | |
virtual | ~VgITextureManager () |
Destructor. | |
virtual VgEngine::VgRefPtr < VgEngine::VgITexture > | createTexture (VgEngine::VgConstRefPtr< VgEngine::VgBinaryBuffer >const &pBuffer, bool pGenerateMipmaps=true)=0 |
Creates a Texture from a VgBinaryBuffer. | |
Static Public Member Functions | |
static VgEngine::VgRefPtr < VgBinaryBuffer > | prepareTextureBuffer (VgEngine::UInt pWidth, VgEngine::UInt pHeight, VgEngine::VgPixelFormat pPixelFormat, VgEngine::Byte *&pOutData) |
Creates a buffer that can receive an image with the specific pixel format. | |
Protected Member Functions | |
VgITextureManager () | |
Constructor. |
The VgITextureManager class is used to create VgITexture given a VgBinaryBuffer.
The VgITextureManager class is in charge of passing the VgBinaryBuffer data to the graphics engine and creates internal objects that allows usage of the returned texture.
The below code snippet demonstrates how a VgITexture can be created.
... VgApplication::VgIApplication* mVgApplication; VgEngine::VgRefPtr< VgEngine::VgITexture > mTexture; ... // Create VgITexture from an image file and assign it to a member variable VgEngine::VgRefPtr< VgEngine::VgBinaryBuffer > lBuffer = mVgApplication->editEngine()->editResourceManager()->readFromFileOrURL("/path/to/file.png"); VgEngine::VgITextureManager* lTextureManager = lEngine->editTextureManager(); VgEngine::VgRefPtr< VgEngine::VgITexture > lTexture = lTextureManager->createTexture(*lBuffer); mTexture = lTexture.get(); ...
VgEngine::VgITextureManager::VgITextureManager | ( | ) | [inline, protected] |
Constructor.
virtual VgEngine::VgITextureManager::~VgITextureManager | ( | ) | [inline, virtual] |
Destructor.
virtual VgEngine::VgRefPtr< VgEngine::VgITexture > VgEngine::VgITextureManager::createTexture | ( | VgEngine::VgConstRefPtr< VgEngine::VgBinaryBuffer >const & | pBuffer, |
bool | pGenerateMipmaps = true |
||
) | [pure virtual] |
Creates a Texture from a VgBinaryBuffer.
pBuffer | The buffer from where the texture will be loaded. |
pGenerateMipmaps | Indicates whether mipmaps should be auto-generated. |
static VgEngine::VgRefPtr< VgBinaryBuffer > VgEngine::VgITextureManager::prepareTextureBuffer | ( | VgEngine::UInt | pWidth, |
VgEngine::UInt | pHeight, | ||
VgEngine::VgPixelFormat | pPixelFormat, | ||
VgEngine::Byte *& | pOutData | ||
) | [static] |
Creates a buffer that can receive an image with the specific pixel format.
pWidth | width of the image | |
pHeight | height of the image | |
pPixelFormat | the pixel format to use. | |
[out] | pOutData | pointer that will be updated and that will later receive the image width*height*4*sizeof(char). This is done to minimize copies. |