Utilities

Assorted utility functions.

Functions


int VRBlobToDDSProperty(HNode node,
const char * propName,
const void * data,
uint32_t glFormat,
uint32_t glType,
uint32_t width,
uint32_t height,
char compress
)

Helper function for converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

data

buffer containing the image data to convert to DDS

glFormat

the opengl format of the buffer data

glType

the opengl type of the buffer data

width

the pixel width of the buffer data

height

the pixel height of the buffer data

compress

whether to compress the texture using DXT1

Returns

0 if property is successfully populated with DDS data


int VRBlobToDDSPropertyEx(HNode node,
uint32_t prop,
const void * data,
uint32_t glFormat,
uint32_t glType,
uint32_t width,
uint32_t height,
char compress
)

Helper function for converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

data

buffer containing the image data to convert to DDS

glFormat

the opengl format of the buffer data

glType

the opengl type of the buffer data

width

the pixel width of the buffer data

height

the pixel height of the buffer data

compress

whether to compress the texture using DXT1

Returns

0 if property is successfully populated with DDS data


int VRBlobToDDSPropertyV2(HNode node,
const char * propName,
const void * data,
uint32_t glFormat,
uint32_t glType,
uint32_t transparency,
uint32_t width,
uint32_t height,
uint32_t depth,
char compress,
uint32_t mipLevels
)

Helper function for converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

data

buffer containing the image data to convert to DDS

glFormat

the opengl format of the buffer data

glType

the opengl type of the buffer data

transparency

( 0 = completely opaque, 1 = transarency mask, 2 = translucent )

width

the pixel width of the buffer data

height

the pixel height of the buffer data

compress

whether to compress the texture using DXT1

number

of mipMap levels

Returns

0 if property is successfully populated with DDS data


int VRBlobToDDSPropertyV2Ex(HNode node,
uint32_t prop,
const void * data,
uint32_t glFormat,
uint32_t glType,
uint32_t transparency,
uint32_t width,
uint32_t height,
uint32_t depth,
char compress,
uint32_t mipLevels
)

Helper function for converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

data

buffer containing the image data to convert to DDS

glFormat

the opengl format of the buffer data

glType

the opengl type of the buffer data

transparency

( 0 = completely opaque, 1 = transarency mask, 2 = translucent )

width

the pixel width of the buffer data

height

the pixel height of the buffer data

compress

whether to compress the texture using DXT1

number

of mipMap levels

Returns

0 if property is successfully populated with DDS data


int VRFileToDDSProperty(HNode node,
const char * propName,
const char * file,
char compress
)

Helper function for loading an image file from disk, converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

file

path to the file to read, if not found, an error pattern is set instead

compress

whether to compress the texture using DXT1

Returns

0 if property is successfully populated with data from the file in DDS format


int VRFileToDDSPropertyEx(HNode node,
uint32_t prop,
const char * file,
char compress
)

Helper function for loading an image file from disk, converting it to DDS, and storing it in the specified char vector property.

Parameters
node

handle to the node to set the property on

propName

name of the property

file

path to the file to read, if not found, an error pattern is set instead

compress

whether to compress the texture using DXT1

Returns

0 if property is successfully populated with data from the file in DDS format


uint32_t VRGetTextureFormat(HNode textureNode)

Helper function for getting the OpenGL texture format out of a texture node.

Parameters
textureNode

handle to the texture node

Returns

0 if node has no DDSData property, otherwise the GLenum value representing the texture format


TextureInfo VRGetTextureInfo(HNode textureNode)

Helper function for getting the OpenGL texture information out of a texture node.

Parameters
textureNode

handle to the texture node

Returns

information reguarding texture paramaters, values will be 0 on faliure

No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtree_cppCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API