mmstypes.cpp File Reference

#include "mmstools/mmstypes.h"
#include "mmstools/tools.h"
#include <string.h>
#include <math.h>
#include <stdlib.h>

Include dependency graph for mmstypes.cpp:

Go to the source code of this file.


Functions

string getMMSFBBackendString (MMSFBBackend be)
MMSFBBackend getMMSFBBackendFromString (string be)
string getMMSFBOutputTypeString (MMSFBOutputType ot)
MMSFBOutputType getMMSFBOutputTypeFromString (string ot)
string getMMSFBFullScreenModeString (MMSFBFullScreenMode fsm)
MMSFBFullScreenMode getMMSFBFullScreenModeFromString (string fsm)
string getMMSFBPixelFormatString (MMSFBSurfacePixelFormat pf)
MMSFBSurfacePixelFormat getMMSFBPixelFormatFromString (string pf)
bool getMMSFBColorFromString (string input, MMSFBColor *color)
 Convert a color string into MMSFBColor.
string getMMSFBColorString (MMSFBColor color)
 Convert MMSFBColor to a color string.
string getMMSFBPointerModeString (MMSFBPointerMode pm)
MMSFBPointerMode getMMSFBPointerModeFromString (string pm)
const char * convertMMSKeySymbolToXKeysymString (MMSKeySymbol key)
string getMMSLanguageString (MMSLanguage lang)
MMSLanguage getMMSLanguageFromString (string lang)
MMS_HALF_FLOAT convertFloat2HalfFloat (float f)
float convertHalfFloat2Float (MMS_HALF_FLOAT hf)
bool initVertexArray (MMS_VERTEX_ARRAY *array, int eSize, int eNum, MMS_VERTEX_DATA_TYPE dtype, void *data)
 Initialize a MMS_VERTEX_ARRAY.
void freeVertexArray (MMS_VERTEX_ARRAY *array)
 Release allocated space of a MMS_VERTEX_ARRAY.
unsigned int getVertexArraySize (MMS_VERTEX_ARRAY *array)
 Get size of a MMS_VERTEX_ARRAY in bytes.
bool initIndexArray (MMS_INDEX_ARRAY *array, MMS_INDEX_ARRAY_TYPE type, int eNum, unsigned int *data)
 Initialize a MMS_INDEX_ARRAY.
void freeIndexArray (MMS_INDEX_ARRAY *array)
 Release allocated space of a MMS_INDEX_ARRAY.
unsigned int getIndexArraySize (MMS_INDEX_ARRAY *array)
 Get size of a MMS_INDEX_ARRAY in bytes.
void multiplyMatrix (MMSMatrix result, MMSMatrix srcA, MMSMatrix srcB)
void copyMatrix (MMSMatrix result, MMSMatrix src)
bool equalMatrix (MMSMatrix result, MMSMatrix src)
void loadIdentityMatrix (MMSMatrix result)
void scaleMatrix (MMSMatrix result, float sx, float sy, float sz)
void translateMatrix (MMSMatrix result, float tx, float ty, float tz)
void rotateMatrix (MMSMatrix result, float angle, float x, float y, float z)
void frustumMatrix (MMSMatrix result, float left, float right, float bottom, float top, float nearZ, float farZ)
void perspectiveMatrix (MMSMatrix result, float fovy, float aspect, float nearZ, float farZ)
void orthoMatrix (MMSMatrix result, float left, float right, float bottom, float top, float nearZ, float farZ)
bool isMMS3DObjectShown (MMS3D_OBJECT *object)

Function Documentation

MMS_HALF_FLOAT convertFloat2HalfFloat ( float  f  ) 

Definition at line 510 of file mmstypes.cpp.

float convertHalfFloat2Float ( MMS_HALF_FLOAT  hf  ) 

Definition at line 551 of file mmstypes.cpp.

const char* convertMMSKeySymbolToXKeysymString ( MMSKeySymbol  key  ) 

Definition at line 310 of file mmstypes.cpp.

void copyMatrix ( MMSMatrix  result,
MMSMatrix  src 
)

Definition at line 703 of file mmstypes.cpp.

bool equalMatrix ( MMSMatrix  result,
MMSMatrix  src 
)

Definition at line 707 of file mmstypes.cpp.

void freeIndexArray ( MMS_INDEX_ARRAY array  ) 

Release allocated space of a MMS_INDEX_ARRAY.

Definition at line 663 of file mmstypes.cpp.

void freeVertexArray ( MMS_VERTEX_ARRAY array  ) 

Release allocated space of a MMS_VERTEX_ARRAY.

Definition at line 621 of file mmstypes.cpp.

void frustumMatrix ( MMSMatrix  result,
float  left,
float  right,
float  bottom,
float  top,
float  nearZ,
float  farZ 
)

Definition at line 799 of file mmstypes.cpp.

unsigned int getIndexArraySize ( MMS_INDEX_ARRAY array  ) 

Get size of a MMS_INDEX_ARRAY in bytes.

Definition at line 670 of file mmstypes.cpp.

MMSFBBackend getMMSFBBackendFromString ( string  be  ) 

Definition at line 52 of file mmstypes.cpp.

string getMMSFBBackendString ( MMSFBBackend  be  ) 

Definition at line 40 of file mmstypes.cpp.

bool getMMSFBColorFromString ( string  input,
MMSFBColor color 
)

Convert a color string into MMSFBColor.

The input string has the syntax "#rrggbbaa".

rr - hex value for red gg - hex value for green bb - hex value for blue aa - hex value for alpha channel (value ff means full opaque)

Parameters:
input the input string
color pointer to the color to be returned
Returns:
true if input is correct
Note:
If the function fails, the color is set to "#00000000".

Definition at line 245 of file mmstypes.cpp.

string getMMSFBColorString ( MMSFBColor  color  ) 

Convert MMSFBColor to a color string.

The output string has the syntax "#rrggbbaa".

rr - hex value for red gg - hex value for green bb - hex value for blue aa - hex value for alpha channel (value ff means full opaque)

Parameters:
color color to be converted
Returns:
color string

Definition at line 276 of file mmstypes.cpp.

MMSFBFullScreenMode getMMSFBFullScreenModeFromString ( string  fsm  ) 

Definition at line 122 of file mmstypes.cpp.

string getMMSFBFullScreenModeString ( MMSFBFullScreenMode  fsm  ) 

Definition at line 112 of file mmstypes.cpp.

MMSFBOutputType getMMSFBOutputTypeFromString ( string  ot  ) 

Definition at line 88 of file mmstypes.cpp.

string getMMSFBOutputTypeString ( MMSFBOutputType  ot  ) 

Definition at line 66 of file mmstypes.cpp.

MMSFBSurfacePixelFormat getMMSFBPixelFormatFromString ( string  pf  ) 

Definition at line 174 of file mmstypes.cpp.

string getMMSFBPixelFormatString ( MMSFBSurfacePixelFormat  pf  ) 

Definition at line 136 of file mmstypes.cpp.

MMSFBPointerMode getMMSFBPointerModeFromString ( string  pm  ) 

Definition at line 297 of file mmstypes.cpp.

string getMMSFBPointerModeString ( MMSFBPointerMode  pm  ) 

Definition at line 287 of file mmstypes.cpp.

MMSLanguage getMMSLanguageFromString ( string  lang  ) 

Definition at line 466 of file mmstypes.cpp.

string getMMSLanguageString ( MMSLanguage  lang  ) 

Definition at line 428 of file mmstypes.cpp.

unsigned int getVertexArraySize ( MMS_VERTEX_ARRAY array  ) 

Get size of a MMS_VERTEX_ARRAY in bytes.

Definition at line 628 of file mmstypes.cpp.

bool initIndexArray ( MMS_INDEX_ARRAY array,
MMS_INDEX_ARRAY_TYPE  type,
int  eNum = 0,
unsigned int *  data = NULL 
)

Initialize a MMS_INDEX_ARRAY.

Parameters:
array MMS_INDEX_ARRAY to initialize
type specifies what kind of primitives to render
eNum number of indices or 0, default is 0
data pointer to existing index data or NULL, default is NULL
Returns:
true if the array is successfully initialized
Note:
It is possible to have an index array with 0 indices.

If no data pointer is given by the caller, the function will allocate new space for index data.

Definition at line 640 of file mmstypes.cpp.

bool initVertexArray ( MMS_VERTEX_ARRAY array,
int  eSize,
int  eNum,
MMS_VERTEX_DATA_TYPE  dtype = MMS_VERTEX_DATA_TYPE_FLOAT,
void *  data = NULL 
)

Initialize a MMS_VERTEX_ARRAY.

Parameters:
array MMS_VERTEX_ARRAY to initialize
eSize number of values per vertex
eNum number of vertices
dtype type of vertex data, default is MMS_VERTEX_DATA_TYPE_FLOAT
data pointer to existing vertex data or NULL, default is NULL
Returns:
true if the array is successfully initialized
Note:
If no data pointer is given by the caller, the function will allocate new space for vertex data.

Definition at line 598 of file mmstypes.cpp.

bool isMMS3DObjectShown ( MMS3D_OBJECT object  ) 

Definition at line 858 of file mmstypes.cpp.

void loadIdentityMatrix ( MMSMatrix  result  ) 

Definition at line 713 of file mmstypes.cpp.

void multiplyMatrix ( MMSMatrix  result,
MMSMatrix  srcA,
MMSMatrix  srcB 
)

Definition at line 675 of file mmstypes.cpp.

void orthoMatrix ( MMSMatrix  result,
float  left,
float  right,
float  bottom,
float  top,
float  nearZ,
float  farZ 
)

Definition at line 836 of file mmstypes.cpp.

void perspectiveMatrix ( MMSMatrix  result,
float  fovy,
float  aspect,
float  nearZ,
float  farZ 
)

Definition at line 827 of file mmstypes.cpp.

void rotateMatrix ( MMSMatrix  result,
float  angle,
float  x,
float  y,
float  z 
)

Definition at line 748 of file mmstypes.cpp.

void scaleMatrix ( MMSMatrix  result,
float  sx,
float  sy,
float  sz 
)

Definition at line 722 of file mmstypes.cpp.

void translateMatrix ( MMSMatrix  result,
float  tx,
float  ty,
float  tz 
)

Definition at line 740 of file mmstypes.cpp.