fastest 3D software for linux

Linux 3D
interactive ray-tracing
[Introduction] [Overview] [Core reference] [3D reference] [GUI]

Index

 ERes_ResourceListDefinitionToBinaryImage
 ERes_ResourceListDefinitionFromBinaryImage
 ERes_ToBinaryImage
 ERes_ListsToBinaryImage
 EResourceList_Copy
 EResource_Offset
 EResource_OffsetByType
 EResources_CountBySemantic
 EResource_OffsetByIndex

ERes_ResourceListDefinitionToBinaryImage

Convert Resource list definition to a binary image "dictionary"

Syntax
EIndex ERes_ResourceListDefinitionToBinaryImage(EResContext* PContext, const EResourceList* PResources, uint8_t** PBinaryImage)

Arguments
PContext Resource context that contains the current byte buffer PResources Resource list PBinaryImage Target position in PContext->BinaryImage
Description
Converts a Resource list definition to an architecture-independent binary format to be saved into a file or sent through the network. This "definition" may then be used for multiple instances of a class that uses those Resources. This allows for the Resource values for those multiple instances to be stored in a more efficient way (the Resource names and types won't be stored with every instance). PBinaryImage specifies where to store the data. It's not necessarily stored a the beginning of the buffer (PContext->BinaryImage) because the caller may want to buffer several things before sending the data to the output (e.g. to a file). PContext->BinaryImage is grown as necessary, to accomodate the data.

Return value
None.

ERes_ResourceListDefinitionFromBinaryImage

Load Resource "dictionary" (Name/Type pairs) from a binary image

Syntax
EIndex ERes_ResourceListDefinitionFromBinaryImage(EResContext* PContext, const uint8_t* PBinaryImage, EResClassEntry* PClassEntry)

Arguments
PContext Resource context that contains the current byte buffer PBinaryImage The source binary data PWrapped If TRUE, the data was wrapped with a magic number and chunk size
Description
Loads a Resource list definition list from an architecture-independent binary format.

Return value
None.

See also
ERes_ResourceListDefinitionToBinaryImage

ERes_ToBinaryImage

Convert a Resource list to a binary image (serializing)

Syntax
EIndex ERes_ToBinaryImage(EResContext* PContext, const EResourceList* PResources, const void* PStructAddress, uint8_t** PBufferPtr, ESize* PBytesAllocatedPtr, uint8_t** PBinaryImagePtr)

Arguments
PResources Resource list. Terminated by Type = 0. PStructAddress Address of the struct in which the resource values are, or NULL PBufferPtr Beginning of the memory buffer to be used PBytesAllocatedPtr Total bytes allocated in the buffer PBinaryImagePtr The resulting binary image PReferencedObjectsP Cumulative list of EObjects referenced in PResources
Description
Converts a resource list to an architecture-independent binary format to be saved into a file, sent through the network, etc. If (PContext->FormatFlags & EResNAMES) != 0, the names of Resources will be saved. If (PContext->FormatFlags & EResTYPES) != 0, the types of Resources will be saved. The better alternative is to save a "dictionary" of type/name lists for each oblect class, and just refer to those, then pass FALSE for this function. For example, E3dScene_CollectClassesAndObjects() does this in libE3D (EQUINOX-3D, FusionEngine etc.). However, if you don't want to implement dictionary saving / restoring, you can just pass TRUE here. If PStructAddress is NULL, the addresses in PResources will be considered absolute addresses, otherwise as offsets relative to PStructAddress. PBufferPtr holds the address to the beginning of the WHOLE memory buffer, while PBinaryImagePtr has the pointer to where the image should be stored. These may be different if there is already data in the LAllocatedBuffer. This allows for storing multiple binary images in a contigous memory block. If PBinaryImagePtr is NULL, the binary image will be stored from the beginning of PBufferPtr. EResources can reference reflective objects (derived from ECoreObject) and PReferencedObjectsP (treated as ECoreObject***) will contain a list of those. This list is accumulated through multiple calls to ERes_ToBinaryImage and each ECoreObject will only occur once in the list. This allows for saving a global list of object references and then rebuilding references when the database is reloaded. For example, the construction history for the "Revolve" tool in EQUINOX-3D references the original profile Spline as an EResource.

Return value
None.

ERes_ListsToBinaryImage

Convert resource list to binary image

Syntax
EIndex ERes_ListsToBinaryImage(EResContext* PContext, const EResourceList* PResourceLists, const EIndex PNLists, const void* PStructAddress, uint8_t** PBufferPtr, ESize* PBytesAllocatedPtr, uint8_t** PBinaryImagePtr)

Arguments
PContext Resource list context PResourceLists Resource lists PNumOfLists Number of Resource lists PStructAddress Address of the Object in which the Resource values are, or NULL PBufferPtr Beginning of the memory buffer to be used PBytesAllocatedPtr Total bytes allocated in the buffer PBinaryImagePtr The resulting binary image
Description
Converts a resource list to an architecture-independent binary format to be saved into a file or sent through the network. If PStructAddress is NULL, the addresses in PResources will be considered as absolute addresses, otherwise as offsets relative to PStructAddress. PBufferPtr holds the address to the beginning of the WHOLE memory buffer, while PBinaryImagePtr has the pointer to where the image should be stored. If PBinaryImagePtr is NULL, the result will be stored at the beginning of the Buffer. These might be different if there is already data in the LAllocatedBuffer. This allows for storing multiple binary images in a contigous memory block.

Return value
None.

EResourceList_Copy

Copy Resource list

Syntax
int EResourceList_Copy(const EResourceList* PSrcResources, EResourceList* PDstResources, const uint16_t PFlags, const uint16_t PUIType)

Arguments
PSrcResources Source list PDstResources Destination PFlags OR-ed flags (EResNAME_STATIC) PUIType The type of the UI fields. EResSTRING or EResARGS
Description
Copies a Resource list. If PDstResources points to a non-empty list that list will be freed first. If PFlags contains EResNAME_STATIC: - Any non-NULL Name members will be freed of a non-empty list. - Names will be deep-copied (vs the pointer being assigned directly)

Return value
E_SUCCESS, or an error code.

EResource_Offset

Compute byte offset of a Resource, specified by semantic and index

Syntax
EIndex EResource_Offset(const EResourceList* PList, const char* PSemantic, const char* PName, const int PIndex, const EResource** PResource)

Arguments
PList Resource list PSemantic Semantic PName Attribute name PIndex Index (if there are multiple Resources with the same Semantic) PResource If not NULL, returns the pointer to the EResource (if found)
Description
Returns the byte offset of the given Resource. If PIndex is >=0, it's is used to identify the Attribute with the same If PIndex is -1, PIndex is used instead.

Return value
None.

EResource_OffsetByType

Compute byte offset of a Resource, specified by semantic and index

Syntax
EIndex EResource_OffsetByType(const EResourceList* PList, const char* PSemantic, const char* PName, const uint16_t PType, const EIndex PCount, const int PIndex, EResource const** PResource)

Arguments
PList Resource list PSemantic Semantic PName Attribute name PType Type. E.g. EResFLOAT32 PCount Number of elements in the type PIndex Index (if there are multiple Resources with the same Semantic) PResource If not NULL, return the EResource here
Description
Returns the byte offset of the given Resource. If PIndex is >=0, it's is used to identify the Attribute with the same Semantic If PIndex is -1, PName is used instead.

Return value
The byte offset of the EResource found, or -1 if no match exists.

EResources_CountBySemantic

Count the number or EResources in a list by Semantic

Syntax
EIndex EResources_CountBySemantic(const EResourceList* PList, const char* PSemantic)

Arguments
PList Resource list PSemantic The Semantic string
Description
Returns number or EResources in PList that have the given Semantic.

Return value
The number or EResources found.

EResource_OffsetByIndex

Compute byte offset of a Resource, specified by the index

Syntax
EIndex EResource_OffsetByIndex(const EResourceList* PList, const int PIndex)

Arguments
PList Resource list PIndex Index (if there are multiple Resources with the same Semantic)
Description
Returns the byte offset of the given Resource.

Return value
None.
© 1996-2025 By Gabor Nagy