Main Page -
Class Hierarchy -
Class List -
File List -
Class Members -
Related Pages -

Information | Reference | SourceForge Project | Author
Muli3D

Reference: Muli3D: m3dbase.h File Reference

m3dbase.h File Reference


Detailed Description

#include <stdlib.h>
#include <memory.h>
#include <vector>

Go to the source code of this file.

Classes

class  IBase
 IBase is the base class for all Muli3D classes. It implements a reference-counter with functions AddRef() and Release() known from COM interfaces. More...

Defines

#define FUNC_FAILED(res)   ( res != s_ok )
#define FUNC_FAILING   ( void )
#define FUNC_NOTIFY   ( void )
#define FUNC_SUCCESSFUL(res)   ( res == s_ok )
#define SAFE_DELETE(p)   { if( p ) { delete p; p = 0; } }
#define SAFE_DELETE_ARRAY(p)   { if( p ) { delete[] p; p = 0; } }
#define SAFE_RELEASE(p)   { if( p ) { ( p )->Release(); p = 0; } }

Typedefs

typedef unsigned char byte
typedef float float32
typedef double float64
typedef signed short int16
typedef signed int int32
typedef signed char int8
typedef unsigned short uint16
typedef unsigned int uint32
typedef unsigned char uint8

Enumerations

enum  result {
  s_ok = 0, e_unknown, e_invalidparameters,
  e_outofmemory, e_invalidformat, e_invalidstate
}

Functions

int32 ftol (float32 f)


Define Documentation

#define FUNC_FAILED res   )     ( res != s_ok )
 

Macro to test for failure.

Parameters:
[in] res a function return value.
Returns:
true if the function failed.

#define FUNC_FAILING   ( void )
 

Function is only available in debug-builds.

#define FUNC_NOTIFY   ( void )
 

Function is only available in debug-builds.

#define FUNC_SUCCESSFUL res   )     ( res == s_ok )
 

Macro to test for success.

Parameters:
[in] res a function return value.
Returns:
true if the function succeeded.

#define SAFE_DELETE  )     { if( p ) { delete p; p = 0; } }
 

If the pointer is not null, the memory it is pointing to is deleted and the pointer is set to null to ease debugging and to make sure it is not deleted again using SAFE_DELETE().

Parameters:
[in] p a pointer.

#define SAFE_DELETE_ARRAY  )     { if( p ) { delete[] p; p = 0; } }
 

If the pointer is not null, the memory it is pointing to is deleted and the pointer is set to null to ease debugging and to make sure it is not deleted again using SAFE_DELETE_ARRAY().

Parameters:
[in] p a pointer to an array.

#define SAFE_RELEASE  )     { if( p ) { ( p )->Release(); p = 0; } }
 

If the pointer is not null, the object it is pointing to is released and the pointer is set to null to ease debugging and to make sure it is not released again using SAFE_RELEASE().

Parameters:
[in] p a pointer to a reference counted object.


Typedef Documentation

typedef unsigned char byte
 

byte

typedef float float32
 

32-bit float

typedef double float64
 

64-bit float

typedef signed short int16
 

16-bit signed integer

typedef signed int int32
 

32-bit signed integer

typedef signed char int8
 

8-bit signed integer

typedef unsigned short uint16
 

16-bit unsigned integer

typedef unsigned int uint32
 

32-bit unsigned integer

typedef unsigned char uint8
 

8-bit unsigned integer


Enumeration Type Documentation

enum result
 

Describes function return values.

Enumeration values:
s_ok  No errors were encountered, function returned successfully.
e_unknown  An unknown error has occured.
e_invalidparameters  One or more parameters were invalid.
e_outofmemory  Allocation of memory within the function failed.
e_invalidformat  A format is invalid for a specific task.
e_invalidstate  An invalid state has been found and the function cannot continue.


Function Documentation

int32 ftol float32  f  )  [inline]
 

ftol() performs fast float to integer-conversion. Ensure that fpuTruncate() has been called before using this function, otherwise ftol() will round to the nearest integer. After calling fpuTruncate() it is advised to reset the fpu to rounding-mode using fpuReset().

Parameters:
[in] f The floating pointer number to be converted to an integer.
Returns:
an integer.

Documentation created with doxygen SourceForge.net Logo