VisioMove SDK (Android)  2.1.22
 All Classes Functions Variables Pages
VgITextureManager Class Reference

Public Member Functions

VgITextureRefPtr createTexture (VgBinaryBufferConstRefPtr pBuffer, boolean pGenerateMipmaps)
 
VgITextureRefPtr createTexture (VgBinaryBufferConstRefPtr pBuffer)
 
VgITextureRefPtr createTexture (long pWidth, long pHeight, VgPixelFormat pPixelFormat, String pData, long pLength, boolean pGenerateMipmaps)
 
VgITextureRefPtr createTexture (long pWidth, long pHeight, VgPixelFormat pPixelFormat, String pData, long pLength)
 
VgITextureRefPtr createTextureWithUniformColor (VgColor pColor, long pWidth, long pHeight)
 
VgITextureRefPtr createTextureWithUniformColor (VgColor pColor, long pWidth)
 
VgITextureRefPtr createTextureWithUniformColor (VgColor pColor)
 
VgITextureRefPtr getTexture (String pTextureName)
 

Detailed Description

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();
...

Member Function Documentation

VgITextureRefPtr VgITextureManager.createTexture ( VgBinaryBufferConstRefPtr  pBuffer,
boolean  pGenerateMipmaps 
)

Creates a Texture from a VgBinaryBuffer .

Remarks
Once the VgBinaryBuffer is used to create a VgITexture , it should not be modified afterwards. The graphic's context should be active when this call is made.
Under iOS, if the VgBinaryBuffer contains a png file. It must not be compressed (Uncheck "Compress PNG Files" under XCode), and the internal png reader does not handle Apple proprietary png extensions.
Textures should be square.
Parameters
pBufferThe buffer from where the texture will be loaded.
pGenerateMipmapsDefault true, indicates whether mipmaps should be auto-generated; if set to true it will generate mipmaps for zoomed levels if supported by the hardware. This is used to avoid flickering at the expense of some fuzziness.
Version
2.0.8955
2.1.2 Added support for non power of 2 square textures
VgITextureRefPtr VgITextureManager.createTexture ( VgBinaryBufferConstRefPtr  pBuffer)
VgITextureRefPtr VgITextureManager.createTexture ( long  pWidth,
long  pHeight,
VgPixelFormat  pPixelFormat,
String  pData,
long  pLength,
boolean  pGenerateMipmaps 
)
VgITextureRefPtr VgITextureManager.createTexture ( long  pWidth,
long  pHeight,
VgPixelFormat  pPixelFormat,
String  pData,
long  pLength 
)
VgITextureRefPtr VgITextureManager.createTextureWithUniformColor ( VgColor  pColor,
long  pWidth,
long  pHeight 
)

Creates a WxH pixel uniform color VgITexture useful for backgrounds and debugging.

Parameters
pColorcolor of texture.
pWidthwidth of texture, 1 by default.
pHeightcolor of texture, 1 by default.
Version
2.1.0
2.1.2 added possibility to make it a rectangular texture
VgITextureRefPtr VgITextureManager.createTextureWithUniformColor ( VgColor  pColor,
long  pWidth 
)
VgITextureRefPtr VgITextureManager.createTextureWithUniformColor ( VgColor  pColor)
VgITextureRefPtr VgITextureManager.getTexture ( String  pTextureName)

Returns a named texture from the registered textures. This method is mainly used to get back textures from the ones declared in vg_config.xml in the <resources> section.

Parameters
pTextureNameThe name of the texture. In vg_config this is the 'id' attribute of the 'texture' tag.
Version
2.0.9263
Returns
A referenced pointer on the texture if any, null if none. Check the isValid method before use.

The documentation for this class was generated from the following file:
VisioMove 2.1.22, Visioglobe® 2016