//////////////////////////////////////////////////////////////////////////////
//
//  Copyright (C) Microsoft Corporation.  All Rights Reserved.
//
//  File:       d3dx9.h
//  Content:    D3DX utility library
//
//////////////////////////////////////////////////////////////////////////////

#ifndef __D3DX9_H__
#define __D3DX9_H__


// Defines
#include <limits.h>

#ifdef _XBOX             // Implies compiling for Xbox 360
#include "XObjBase.h"
#else
#include "ObjBase.h"
#endif

#define D3DX_DEFAULT            ((UINT) -1)
#define D3DX_DEFAULT_NONPOW2    ((UINT) -2)
#define D3DX_DEFAULT_FLOAT      FLT_MAX

#ifndef D3DXINLINE
#ifdef _MSC_VER
  #if (_MSC_VER >= 1200)
  #define D3DXINLINE __forceinline
  #else
  #define D3DXINLINE __inline
  #endif
#else
  #ifdef __cplusplus
  #define D3DXINLINE inline
  #else
  #define D3DXINLINE
  #endif
#endif
#endif



// Includes
#include "d3d9.h"
#include "d3dx9math.h"
#include "d3dx9core.h"
#include "d3dx9mesh.h"
#include "d3dx9tex.h"
#include "d3dx9shader.h"
#include "d3dx9effect.h"
#include "d3dx9shape.h"
#include "d3dx9anim.h"
#include "d3dx9xof.h"


// Errors
#define _FACDD  0x876
#define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )

enum _D3DXERR {
    D3DXERR_CANNOTMODIFYINDEXBUFFER     = MAKE_DDHRESULT(2900),
    D3DXERR_INVALIDMESH                 = MAKE_DDHRESULT(2901),
    D3DXERR_CANNOTATTRSORT              = MAKE_DDHRESULT(2902),
    D3DXERR_SKINNINGNOTSUPPORTED        = MAKE_DDHRESULT(2903),
    D3DXERR_TOOMANYINFLUENCES           = MAKE_DDHRESULT(2904),
    D3DXERR_INVALIDDATA                 = MAKE_DDHRESULT(2905),
    D3DXERR_LOADEDMESHASNODATA          = MAKE_DDHRESULT(2906),
    D3DXERR_DUPLICATENAMEDFRAGMENT      = MAKE_DDHRESULT(2907),

    // Xbox 360 Extension
    D3DXERR_MICROCODEEMPTY              = MAKE_DDHRESULT(2920),
    D3DXERR_MICROCODETOOBIG             = MAKE_DDHRESULT(2921),
    D3DXERR_MICROCODEUNSUPPORTEDTARGET  = MAKE_DDHRESULT(2922),
    D3DXERR_MICROCODEOPTIMIZERFAILED    = MAKE_DDHRESULT(2923),
    D3DXERR_MICROCODETOOMANYLEVELS      = MAKE_DDHRESULT(2924),
    D3DXERR_MICROCODETOOMANYREGS        = MAKE_DDHRESULT(2925),
    D3DXERR_MICROCODETOOMANYCONSTS      = MAKE_DDHRESULT(2926),
    D3DXERR_MICROCODETOOMANYRSINSTS     = MAKE_DDHRESULT(2927),
    D3DXERR_MICROCODETOOMANYTEXINSTS    = MAKE_DDHRESULT(2928),
    D3DXERR_MICROCODETOOMANYALUINSTS    = MAKE_DDHRESULT(2929),
    D3DXERR_MICROCODETOOMANYCFINSTS     = MAKE_DDHRESULT(2930),
    D3DXERR_MICROCODETOOMANYTOTALINSTS  = MAKE_DDHRESULT(2931),
    D3DXERR_MICROCODETOOMANYCOMPILERLITERALS = MAKE_DDHRESULT(2932),
    D3DXERR_MICROCODE_DEFB_CONSTANT_OUT_OF_RANGE = MAKE_DDHRESULT(2933),
    D3DXERR_MICROCODE_DEFI_CONSTANT_OUT_OF_RANGE = MAKE_DDHRESULT(2934),
    D3DXERR_MICROCODE_DEF_CONSTANT_OUT_OF_RANGE = MAKE_DDHRESULT(2935),
    D3DXERR_MICROCODE_DEFB_CONSTANT_OUT_OF_ALPHA_PIXEL_SHADER_RANGE = MAKE_DDHRESULT(2936),
    D3DXERR_MICROCODE_DEFI_CONSTANT_OUT_OF_ALPHA_PIXEL_SHADER_RANGE = MAKE_DDHRESULT(2937),
    D3DXERR_MICROCODE_DEF_CONSTANT_OUT_OF_ALPHA_PIXEL_SHADER_RANGE = MAKE_DDHRESULT(2938),
    D3DXERR_MICROCODE_DEFB_CONSTANT_OUT_OF_ALPHA_VERTEX_SHADER_RANGE = MAKE_DDHRESULT(2939),
    D3DXERR_MICROCODE_DEFI_CONSTANT_OUT_OF_ALPHA_VERTEX_SHADER_RANGE = MAKE_DDHRESULT(2940),
    D3DXERR_MICROCODE_DEF_CONSTANT_OUT_OF_ALPHA_VERTEX_SHADER_RANGE = MAKE_DDHRESULT(2941),
    D3DXERR_MICROCODE_DUPLICATE_DEFB_CONSTANT = MAKE_DDHRESULT(2942),
    D3DXERR_MICROCODE_DUPLICATE_DEFI_CONSTANT = MAKE_DDHRESULT(2943),
    D3DXERR_MICROCODE_DUPLICATE_DEF_CONSTANT = MAKE_DDHRESULT(2944),
};


#endif //__D3DX9_H__

