Open Game Engine 2D API
 All Functions Variables
Functions
Buffer

Functions

int OGE_GetStaticBuf (int iIndex)
 Get static buffer by index.
int OGE_ClearBuf (int iBufferId)
 Clear the buffer (zero all the bytes)
int OGE_CopyBuf (int iFromId, int iToId, int iStart, int iLen)
 Copy a part from one buffer to another.
char OGE_GetBufByte (int iBufId, int pos, int &next)
 Read a byte from the buffer.
int OGE_GetBufInt (int iBufId, int pos, int &next)
 Read an integer from the buffer.
double OGE_GetBufFloat (int iBufId, int pos, int &next)
 Read a floating-point value from the buffer.
string OGE_GetBufStr (int iBufId, int pos, int len, int &next)
 Read a string from the buffer.
int OGE_PutBufByte (int iBufId, int pos, char value)
 Write a byte into the buffer.
int OGE_PutBufInt (int iBufId, int pos, int value)
 Write an integer into the buffer.
int OGE_PutBufFloat (int iBufId, int pos, double value)
 Write a floating-point value into the buffer.
int OGE_PutBufStr (int iBufId, int pos, string value)
 Write a string into the buffer.

Function Documentation

int OGE_ClearBuf ( int  iBufferId)

Clear the buffer (zero all the bytes)

Parameters:
[in]iBufferIdThe ID of the buffer
Returns:
Returns the size of the buffer
int OGE_CopyBuf ( int  iFromId,
int  iToId,
int  iStart,
int  iLen 
)

Copy a part from one buffer to another.

Parameters:
[in]iFromIdThe ID of the source buffer
[in]iToIdThe ID of the target buffer
[in]iStartThe start position
[in]iLenThe length of the part will be copied
Returns:
Returns the count of the bytes was copied
char OGE_GetBufByte ( int  iBufId,
int  pos,
int &  next 
)

Read a byte from the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent reading position
[out]nextNext reading position
Returns:
The value of the byte
double OGE_GetBufFloat ( int  iBufId,
int  pos,
int &  next 
)

Read a floating-point value from the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent reading position
[out]nextNext reading position
Returns:
The floating-point value
int OGE_GetBufInt ( int  iBufId,
int  pos,
int &  next 
)

Read an integer from the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent reading position
[out]nextNext reading position
Returns:
The value of the integer
string OGE_GetBufStr ( int  iBufId,
int  pos,
int  len,
int &  next 
)

Read a string from the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent reading position
[in]lenThe length of the string
[out]nextNext reading position
Returns:
The string
int OGE_GetStaticBuf ( int  iIndex)

Get static buffer by index.

Parameters:
[in]iIndexThe index if the static buffer
Returns:
The ID of the buffer
int OGE_PutBufByte ( int  iBufId,
int  pos,
char  value 
)

Write a byte into the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent writing position
[in]valueThe value of the byte
Returns:
Next writing position
int OGE_PutBufFloat ( int  iBufId,
int  pos,
double  value 
)

Write a floating-point value into the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent writing position
[in]valueThe floating-point value
Returns:
Next writing position
int OGE_PutBufInt ( int  iBufId,
int  pos,
int  value 
)

Write an integer into the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent writing position
[in]valueThe value of the integer
Returns:
Next writing position
int OGE_PutBufStr ( int  iBufId,
int  pos,
string  value 
)

Write a string into the buffer.

Parameters:
[in]iBufIdThe ID of the buffer
[in]posCurrent writing position
[in]valueThe string
Returns:
Next writing position