Main Page | Class List | File List | File Members

oma.h File Reference

Header for the core libOMA library. More...

Go to the source code of this file.


Functions

OMAAPI OMAenum OMAAPIENTRY omaGetError (void)
 Return error information.

OMAAPI const OMAubyte *OMAAPIENTRY omaGetString (OMAenum pname)
 Return a string describing OMA.

OMAAPI void *OMAAPIENTRY omaGetProcAddress (const OMAubyte *which)
 Returns the address of a function.

OMAAPI OMAboolean OMAAPIENTRY omaGetBoolean (OMAenum pname)
 Return the value of a selected boolean parameter.

OMAAPI void OMAAPIENTRY omaGetBooleanv (OMAenum pname, OMAboolean *params)
 Return the value or values of a selected boolean parameter.

OMAAPI OMAint OMAAPIENTRY omaGetInteger (OMAenum pname)
 Return the value of a selected integer parameter.

OMAAPI void OMAAPIENTRY omaGetIntegerv (OMAenum pname, OMAint *params)
 Return the value or values of a selected integer parameter.

OMAAPI void OMAAPIENTRY omaGetFloatv (OMAenum pname, OMAfloat *params)
 Return the value or values of a selected floating point parameter.

OMAAPI void OMAAPIENTRY omaGetDoublev (OMAenum pname, OMAdouble *params)
 Return the value or values of a selected double precision floating point parameter.

OMAAPI void OMAAPIENTRY omaInit (void)
 Initializes an OMA context.

OMAAPI void OMAAPIENTRY omaShutdown (void)
 Shuts down an OMA context.

OMAAPI void OMAAPIENTRY omaPushAttrib (OMAbitfield mask)
 Push the server attribute stack.

OMAAPI void OMAAPIENTRY omaPopAttrib (void)
 Pop the server attribute stack.

OMAAPI void OMAAPIENTRY omaBindChunk (OMAuint name)
 Bind a named chunk.

OMAAPI void OMAAPIENTRY omaDeleteChunks (OMAsizei n, const OMAuint *chunks)
 Delete named chunks.

OMAAPI void OMAAPIENTRY omaGenChunks (OMAsizei n, OMAuint *chunks)
 Generate chunk names.

OMAAPI OMAboolean OMAAPIENTRY omaIsChunk (OMAuint name)
 Determine if a name corresponds to a chunk.

OMAAPI OMAint OMAAPIENTRY omaGetChunkParameteri (OMAenum pname)
 Return integer chunk parameter values.

OMAAPI void OMAAPIENTRY omaGetChunkParameteriv (OMAenum pname, OMAint *params)
 Return integer chunk parameter values.

OMAAPI void *OMAAPIENTRY omaGetChunkPointer (OMAenum pname)
 Return chunk pointer values.

OMAAPI void OMAAPIENTRY omaGetChunkPointerv (OMAenum pname, void **params)
 Return chunk pointer values.

OMAAPI void OMAAPIENTRY omaChunkData (OMAenum type, OMAsizeiptr size, const OMAvoid *data)
 Define the type and data of a chunk.

OMAAPI void OMAAPIENTRY omaChunkSubData (OMAintptr offset, OMAsizeiptr size, const OMAvoid *data)
 Specify a subregion of chunk data.

OMAAPI void OMAAPIENTRY omaGetChunkSubData (OMAintptr offset, OMAsizeiptr size, OMAvoid *data)
 Queries the data contents of a chunk object.

OMAAPI void *OMAAPIENTRY omaMapChunk (OMAenum access)
 Maps the data store of a chunk into the client's address space.

OMAAPI void OMAAPIENTRY omaUnmapChunk (void)
 Unmaps the data store of a chunk.

OMAAPI void OMAAPIENTRY omaLoadPath (OMAenum format, const OMAubyte *path)
 Loads a path into the currently bound chunk.

OMAAPI void OMAAPIENTRY omaLoadBuffer (OMAenum format, const OMAubyte *buffer, OMAsizeiptr size)
 Loads a buffer into the currently bound chunk.


Detailed Description


Function Documentation

OMAAPI void OMAAPIENTRY omaBindChunk OMAuint  name  ) 
 

omaBindChunk binds the chunk named name. If the name does not exist, it is created. When a chunk is bound, the previous binding is broken.

Parameters:
name Specifies the name of a chunk.

OMAAPI void OMAAPIENTRY omaChunkData OMAenum  type,
OMAsizeiptr  size,
const OMAvoid *  data
 

omaChunkData sets the type and data of the bound chunk.

Parameters:
type The type of data to be stored. One of:
  • OMA_TEXT
    UTF-8 formated text.
  • OMA_INT
    An array of integers.
  • OMA_FLOAT
    An array of floats.
  • OMA_FLOAT2
    An array of pairs of floats.
  • OMA_FLOAT3
    An array of sets of three floats.
  • OMA_FLOAT4
    An array of sets of four floats.
  • OMA_SET
    An array of chunk names.
  • OMA_QUAT
    An array of quaternions stored as sets of four floats.
  • OMA_MATRIX
    An array of four by four matrices stored as sets of sixteen floats in column-major order.
  • OMA_FRAME
  • OMA_OBJECT
  • OMA_KEYFRAME
size The size of the data to store in basic machine units.
data A pointer to the source data in client memory or null.
Possible errors:
  • OMA_INVALID_VALUE
    • If size is negative.
    • If there is no way to create a chunk of type type with the specified size.
  • OMA_OUT_OF_MEMORY
    • If memory could not be allocated to store the chunk data.

OMAAPI void OMAAPIENTRY omaChunkSubData OMAintptr  offset,
OMAsizeiptr  size,
const OMAvoid *  data
 

omaChunkSubData redefines a contiguous subregion of an existing chunk.

Parameters:
offset The offset of the beginning of the subregion.
size The size of the data to store in basic machine units.
data A pointer to the source data in client memory.
Possible errors:
  • OMA_INVALID_OPERATION
    • If the chunk is currently mapped.
  • OMA_INVALID_VALUE
    • If offset is negative.
    • If the range created by offset and size does not fit in the bound chunk's data.

OMAAPI void OMAAPIENTRY omaDeleteChunks OMAsizei  n,
const OMAuint *  chunks
 

omaDeleteChunks deletes n chunks named by the elements of the array chunks. After a chunk is deleted, it has no contents, and its name is free for reuse (for example by omaGenChunks). If a chunk that is currently bound is deleted, the binding reverts to 0 (the default chunk). omaDeleteChunks silently ignores zeros and names that do not correspond to existing chunks.

Parameters:
n Specifies the number of chunks to be deleted.
chunks Specifies an array of chunks to be deleted.
Possible errors:
  • OMA_INVALID_VALUE
    • If n is negative.

OMAAPI void OMAAPIENTRY omaGenChunks OMAsizei  n,
OMAuint *  chunks
 

omaGenChunks returns n chunk names in chunks. There is no guarantee that the names form a contiguous set of integers; however, it is guaranteed that none of the returned names was in use immediately before the call to omaGenChunks. The generated chunks can initially be of any type and contain no data. Chunk names returned by a call to omaGenChunks are not returned by subsequent calls, unless they are first deleted with omaDeleteChunks.

Parameters:
n Specifies the number of chunk names to be generated.
chunks Specifies an array in which the generated chunk names are stored.
Possible errors:
  • OMA_INVALID_VALUE
    • If n is negative.

OMAAPI OMAboolean OMAAPIENTRY omaGetBoolean OMAenum  pname  ) 
 

Returns simple boolean state variables in OMA.

Returns:
The boolean value requested.
Parameters:
pname A symbolic constant indicating the state variable to be returned. At this time, there are no defined constants that can be passed.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaGetBooleanv OMAenum  pname,
OMAboolean *  params
 

Returns simple boolean state variables in OMA.

Parameters:
pname A symbolic constant indicating the state variable to be returned.
params A pointer to an address to store the value or values requested.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI OMAint OMAAPIENTRY omaGetChunkParameteri OMAenum  pname  ) 
 

omaGetChunkParameteri returns the value of the chunk parameter specified as pname.

Returns:
The value of the chunk parameter.
Parameters:
pname Specifies the symbolic name of a chunk parameter. Can be one of:
  • OMA_CHUNK_TYPE
    Returns the type of data contained in the chunk.
  • OMA_CHUNK_SIZE
    Returns the size in basic machine units of the data in the chunk.
  • OMA_CHUNK_ELEM_COUNT
    Returns the number of elements contained in the chunk.
  • OMA_CHUNK_ELEM_SIZE
    Returns the size of each element contained in the chunk.
  • OMA_CHUNK_ACCESS
    Returns the access allowed to the mapped chunk.
  • OMA_CHUNK_MAPPED
    Returns OMA_TRUE if the chunk is currently mapped, OMA_FALSE otherwise.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaGetChunkParameteriv OMAenum  pname,
OMAint *  params
 

omaGetChunkParameteriv returns in params the value or values of the chunk parameter specified as pname.

Parameters:
pname Specifies the symbolic name of a chunk parameter. Can be one of:
  • OMA_CHUNK_TYPE
    Returns the type of data contained in the chunk.
  • OMA_CHUNK_SIZE
    Returns the size in basic machine units of the data in the chunk.
  • OMA_CHUNK_ELEM_COUNT
    Returns the number of elements contained in the chunk.
  • OMA_CHUNK_ELEM_SIZE
    Returns the size of each element contained in the chunk.
  • OMA_CHUNK_ACCESS
    Returns the access allowed to the mapped chunk.
  • OMA_CHUNK_MAPPED
    Returns OMA_TRUE if the chunk is currently mapped, OMA_FALSE otherwise.
params Returns the chunk parameters.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void* OMAAPIENTRY omaGetChunkPointer OMAenum  pname  ) 
 

omaGetChunkPointer returns the value of the chunk pointer specified as pname.

Returns:
The value of the chunk parameter.
Parameters:
pname Specifies the symbolic name of a chunk parameter. Can be one of:
  • OMA_CHUNK_MAP_POINTER
    Returns the pointer of the currently mapped address of chunk or NULL if chunk is not mapped.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaGetChunkPointerv OMAenum  pname,
void **  params
 

omaGetChunkPointerv returns in params the value of the chunk pointer specified as pname.

Parameters:
pname Specifies the symbolic name of a chunk parameter. Can be one of:
  • OMA_CHUNK_MAP_POINTER
    Returns the pointer of the currently mapped address of chunk or NULL if chunk is not mapped.
params Returns the chunk parameters.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaGetChunkSubData OMAintptr  offset,
OMAsizeiptr  size,
OMAvoid *  data
 

omaGetChunkSubData queries the data contents of a chunk object and stores the results in data.

Parameters:
offset The offset of the beginning of the subregion.
size The size of the data to store in basic machine units.
data A pointer to data in the client memory to store the queried data.
Possible errors:
  • OMA_INVALID_OPERATION
    • If the chunk is currently mapped.
  • OMA_INVALID_VALUE
    • If offset is negative.
    • If the range created by offset and size does not fit in the bound chunk's data.

OMAAPI void OMAAPIENTRY omaGetDoublev OMAenum  pname,
OMAdouble *  params
 

Returns simple double precision floating point state variables in OMA.

Parameters:
pname A symbolic constant indicating the state variable to be returned. At this time, there are no defined constants that can be passed.
params A pointer to an address to store the value or values requested.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI OMAenum OMAAPIENTRY omaGetError void   ) 
 

omaGetError returns the value of the error flag. Each detectable error is assigned a numeric code and symbolic name. When an error occurs, the error flag is set to the appropriate error code value. No other errors are recorded until omaGetError is called, the error code is returned, and the flag is reset to OMA_NO_ERROR. If a call to omaGetError returns OMA_NO_ERROR, there has been no detectable error since the last call to omaGetError, or since OMA was initialized.

The following errors are currently defined:

  • OMA_NO_ERROR
    No error has been recorded. The value of this symbolic constant is guaranteed to be 0.
  • OMA_INVALID_ENUM
    An unacceptable value is specified for an enumerated argument. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_INVALID_VALUE
    A numeric argument is out of range. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_INVALID_OPERATION
    The specified operation is not allowed in the current state. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_OUT_OF_MEMORY
    There is not enough memory left to execute the command. The state of OMA is undefined, except for the state of the error flags, after this error is recorded.
  • OMA_INTERNAL_ERROR
    An unexplainable error has occured due to some implementation detail. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_FILE_IO_ERROR
    Some interaction with a file has failed. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_STACK_OVERFLOW
    This command would cause a stack overflow. The offending command is ignored, and has no other side effect than to set the error flag.
  • OMA_STACK_UNDERFLOW
    This command would cause a stack underflow. The offending command is ignored, and has no other side effect than to set the error flag.
Returns:
The value of the error flag.

OMAAPI void OMAAPIENTRY omaGetFloatv OMAenum  pname,
OMAfloat *  params
 

Returns simple floating point state variables in OMA.

Parameters:
pname A symbolic constant indicating the state variable to be returned. At this time, there are no defined constants that can be passed.
params A pointer to an address to store the value or values requested.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI OMAint OMAAPIENTRY omaGetInteger OMAenum  pname  ) 
 

Returns simple integer state variables in OMA.

Returns:
The integer value requested.
Parameters:
pname A symbolic constant indicating the state variable to be returned. Can be one of the following:
  • OMA_CHUNK_BINDING
    Returns the name of the chunk currently bound.
  • OMA_CHUNK_STACK_DEPTH
    Returns depth of the chunk stack. If the stack is empty, zero is returned.
  • OMA_MAX_CHUNK_STACK_DEPTH
    The maximum supported depth of the chunk stack. This depth may not be acheivable due to memory contraints if the implementation uses a dynamically allocated stack.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaGetIntegerv OMAenum  pname,
OMAint *  params
 

Returns simple integer state variables in OMA.

Parameters:
pname A symbolic constant indicating the state variable to be returned.
params A pointer to an address to store the value or values requested. Can be one of the following:
  • OMA_CHUNK_BINDING
    Returns a single value, the name of the chunk currently bound.
  • OMA_CHUNK_STACK_DEPTH
    Returns a single value, the depth of the chunk stack. If the stack is empty, zero is returned.
  • OMA_MAX_CHUNK_STACK_DEPTH
    Returns a single value, the maximum supported depth of the chunk stack. This depth may not be acheivable due to memory contraints if the implementation uses a dynamically allocated stack.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void* OMAAPIENTRY omaGetProcAddress const OMAubyte *  which  ) 
 

omaGetProcAddress returns a pointer to a function looked up by name.

Returns:
A pointer to the function requested.
Parameters:
which A function name described by an extension can be used.

OMAAPI const OMAubyte* OMAAPIENTRY omaGetString OMAenum  pname  ) 
 

omaGetString returns a pointer to a static string describing some aspect of OMA.

Returns:
A pointer to the static string requested.
Parameters:
pname Can be one of the following:
  • OMA_VENDOR
    Returns the organization responsible for this OMA implementation. This name does not change from release to release.
  • OMA_VERSION
    Returns a version or release number.
  • OMA_EXTENSIONS
    Returns a space-separated list of supported extensions to OMA.
Possible errors:
  • OMA_INVALID_ENUM
    • If pname is unrecognized.

OMAAPI void OMAAPIENTRY omaInit void   ) 
 

Sets up a usable OMA context for this process. Prior to calling this function, no other OMA functions can be called. omaShutdown must be called at some point after this being called.

OMAAPI OMAboolean OMAAPIENTRY omaIsChunk OMAuint  name  ) 
 

omaIsChunk returns OMA_TRUE if name is currently the name of a chunk. If chunk is zero, or is a non-zero value that is not currently the name of a chunk, or if an error occurs, omaIsChunk returns OMA_FALSE.

Returns:
OMA_TRUE if name is a chunk, OMA_FALSE otherwise.
Parameters:
name The name to check.

OMAAPI void OMAAPIENTRY omaLoadBuffer OMAenum  format,
const OMAubyte *  buffer,
OMAsizeiptr  size
 

omaLoadBuffer sets the current chunk to an OMA_SET of names loaded from the specified buffer.

Parameters:
format The type of the file held in buffer. One of:
  • OMA_3DS
  • OMA_MD2
  • OMA_MD3
  • OMA_OMA
  • OMA_OMX
  • OMA_WFOBJ
buffer A pointer to data to interpret.
size The size in basic machine units of the buffer supplied.
Possible errors:
  • OMA_INTERNAL_ERROR
    • If the underlying loader library returned an error.

OMAAPI void OMAAPIENTRY omaLoadPath OMAenum  format,
const OMAubyte *  path
 

omaLoadPath sets the current chunk to an OMA_SET of names loaded from the specified path.

Parameters:
format The type of the file path refers to. One of:
  • OMA_3DS
  • OMA_MD2
  • OMA_MD3
  • OMA_OMA
  • OMA_OMX
  • OMA_WFOBJ
path The environment-specific path to load the chunks from.
Possible errors:
  • OMA_FILE_IO_ERROR
    • If the file associated with the path could not be loaded.
  • OMA_INTERNAL_ERROR
    • If the underlying loader library returned an error.

OMAAPI void* OMAAPIENTRY omaMapChunk OMAenum  access  ) 
 

omaMapChunk maps the entire data store of a chunk object into the client's address space.

Returns:
A client space address of the data store.
Parameters:
access The access that will be required to the mapped address space. One of:
  • OMA_READ_ONLY
    Read only access.
  • OMA_WRITE_ONLY
    Write only access.
  • OMA_READ_WRITE
    Read and write access.
Possible errors:
  • OMA_INVALID_OPERATION
    • If the chunk is currently mapped.

OMAAPI void OMAAPIENTRY omaPopAttrib void   ) 
 

omaPopAttrib restores the values of the state variables saved with the last omaPushAttrib command. Those not saved are left unchanged. It is an error to push attributes onto a full stack, or to pop attributes off an empty stack. In either case, the error flag is set and no other change is made to OMA state. Initially, the attribute stack is empty.

Possible errors:
  • OMA_STACK_UNDERFLOW
    • If the stack is empty.

OMAAPI void OMAAPIENTRY omaPushAttrib OMAbitfield  mask  ) 
 

omaPushAttrib takes one argument, a mask that indicates which groups of state variables to save on the attribute stack. Symbolic constants are used to set bits in the mask. mask is typically constructed by ORing several of these constants together. The special mask OMA_ALL_ATTRIB_BITS can be used to save all stackable states.

The symbolic mask constants and their associated OMA state are as follows:

Parameters:
mask Specifies a mask that indicates which attributes to save. Values for mask are listed below:
  • OMA_CHUNK_BIT
    • The currently bound chunk.
Possible errors:
  • OMA_STACK_OVERFLOW
    • If the stack is full.

OMAAPI void OMAAPIENTRY omaShutdown void   ) 
 

Releases all resources pertaining to this process's OMA context. After calling this function no OMA functions besides omaInit can be called.

OMAAPI void OMAAPIENTRY omaUnmapChunk void   ) 
 

omaUnmapChunk unmaps the chunk's data store from the client memory.

Possible errors:
  • OMA_INVALID_OPERATION
    • If the chunk is not currently mapped.
SourceForge.net Logo Created with DoxygenValid CSS!