ReactOS  0.4.14-dev-50-g13bb5e2
d3dx8core.h File Reference
#include <objbase.h>
#include <d3d8.h>
#include <d3d8types.h>
#include <d3d8caps.h>
Include dependency graph for d3dx8core.h:

Go to the source code of this file.

Macros

#define D3DXASM_DEBUG   1
 
#define D3DXASM_SKIPVALIDATION   2
 
#define _FACD3D   0x876
 
#define MAKE_D3DXHRESULT(code)   MAKE_HRESULT( 1, _FACD3D, code )
 
#define D3DXERR_CANNOTATTRSORT   MAKE_D3DXHRESULT(2158)
 
#define D3DXERR_CANNOTMODIFYINDEXBUFFER   MAKE_D3DXHRESULT(2159)
 
#define D3DXERR_INVALIDMESH   MAKE_D3DXHRESULT(2160)
 
#define D3DXERR_SKINNINGNOTSUPPORTED   MAKE_D3DXHRESULT(2161)
 
#define D3DXERR_TOOMANYINFLUENCES   MAKE_D3DXHRESULT(2162)
 
#define D3DXERR_INVALIDDATA   MAKE_D3DXHRESULT(2163)
 
#define INTERFACE   ID3DXBuffer
 
#define ID3DXBuffer_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ID3DXBuffer_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ID3DXBuffer_Release(p)   (p)->lpVtbl->Release(p)
 
#define ID3DXBuffer_GetBufferPointer(p)   (p)->lpVtbl->GetBufferPointer(p)
 
#define ID3DXBuffer_GetBufferSize(p)   (p)->lpVtbl->GetBufferSize(p)
 
#define INTERFACE   ID3DXFont
 
#define ID3DXFont_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ID3DXFont_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ID3DXFont_Release(p)   (p)->lpVtbl->Release(p)
 
#define ID3DXFont_Begin(p)   (p)->lpVtbl->Begin(p)
 
#define ID3DXFont_DrawTextA(p, a, b, c, d, e)   (p)->lpVtbl->DrawText(p,a,b,c,d,e)
 
#define ID3DXFont_End(p)   (p)->lpVtbl->End(p)
 

Typedefs

typedef struct ID3DXBuffer ID3DXBuffer
 
typedef struct ID3DXBufferLPD3DXBUFFER
 
typedef struct ID3DXFont ID3DXFont
 
typedef struct ID3DXFontLPD3DXFONT
 

Functions

 DEFINE_GUID (IID_ID3DXBuffer, 0x1, 0x1, 0x4, 0xB0, 0xCF, 0x98, 0xFE, 0xFD, 0xFF, 0x95, 0x12)
 
 DEFINE_GUID (IID_ID3DXFont, 0x1, 0x1, 0x4, 0xB0, 0xCF, 0x98, 0xFE, 0xFD, 0xFF, 0x95, 0x13)
 
 DECLARE_INTERFACE_ (ID3DXBuffer, IUnknown)
 
 DECLARE_INTERFACE_ (ID3DXFont, IUnknown)
 
HRESULT WINAPI D3DXCreateBuffer (DWORD NumBytes, LPD3DXBUFFER *ppBuffer)
 
HRESULT WINAPI D3DXCreateFont (LPDIRECT3DDEVICE8 pDevice, HFONT hFont, LPD3DXFONT *ppFont)
 
UINT WINAPI D3DXGetFVFVertexSize (DWORD FVF)
 
HRESULT WINAPI D3DXAssembleShader (LPCVOID pSrcData, UINT SrcDataLen, DWORD Flags, LPD3DXBUFFER *ppConstants, LPD3DXBUFFER *ppCompiledShader, LPD3DXBUFFER *ppCompilationErrors)
 
HRESULT WINAPI D3DXAssembleShaderFromFileA (LPSTR pSrcFile, DWORD Flags, LPD3DXBUFFER *ppConstants, LPD3DXBUFFER *ppCompiledShader, LPD3DXBUFFER *ppCompilationErrors)
 
HRESULT WINAPI D3DXAssembleShaderFromFileW (LPSTR pSrcFile, DWORD Flags, LPD3DXBUFFER *ppConstants, LPD3DXBUFFER *ppCompiledShader, LPD3DXBUFFER *ppCompilationErrors)
 

Macro Definition Documentation

◆ _FACD3D

#define _FACD3D   0x876

Definition at line 34 of file d3dx8core.h.

◆ D3DXASM_DEBUG

#define D3DXASM_DEBUG   1

Definition at line 31 of file d3dx8core.h.

◆ D3DXASM_SKIPVALIDATION

#define D3DXASM_SKIPVALIDATION   2

Definition at line 32 of file d3dx8core.h.

◆ D3DXERR_CANNOTATTRSORT

#define D3DXERR_CANNOTATTRSORT   MAKE_D3DXHRESULT(2158)

Definition at line 40 of file d3dx8core.h.

◆ D3DXERR_CANNOTMODIFYINDEXBUFFER

#define D3DXERR_CANNOTMODIFYINDEXBUFFER   MAKE_D3DXHRESULT(2159)

Definition at line 41 of file d3dx8core.h.

◆ D3DXERR_INVALIDDATA

#define D3DXERR_INVALIDDATA   MAKE_D3DXHRESULT(2163)

Definition at line 45 of file d3dx8core.h.

◆ D3DXERR_INVALIDMESH

#define D3DXERR_INVALIDMESH   MAKE_D3DXHRESULT(2160)

Definition at line 42 of file d3dx8core.h.

◆ D3DXERR_SKINNINGNOTSUPPORTED

#define D3DXERR_SKINNINGNOTSUPPORTED   MAKE_D3DXHRESULT(2161)

Definition at line 43 of file d3dx8core.h.

◆ D3DXERR_TOOMANYINFLUENCES

#define D3DXERR_TOOMANYINFLUENCES   MAKE_D3DXHRESULT(2162)

Definition at line 44 of file d3dx8core.h.

◆ ID3DXBuffer_AddRef

#define ID3DXBuffer_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 74 of file d3dx8core.h.

◆ ID3DXBuffer_GetBufferPointer

#define ID3DXBuffer_GetBufferPointer (   p)    (p)->lpVtbl->GetBufferPointer(p)

Definition at line 77 of file d3dx8core.h.

◆ ID3DXBuffer_GetBufferSize

#define ID3DXBuffer_GetBufferSize (   p)    (p)->lpVtbl->GetBufferSize(p)

Definition at line 78 of file d3dx8core.h.

◆ ID3DXBuffer_QueryInterface

#define ID3DXBuffer_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 73 of file d3dx8core.h.

◆ ID3DXBuffer_Release

#define ID3DXBuffer_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 75 of file d3dx8core.h.

◆ ID3DXFont_AddRef

#define ID3DXFont_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 101 of file d3dx8core.h.

◆ ID3DXFont_Begin

#define ID3DXFont_Begin (   p)    (p)->lpVtbl->Begin(p)

Definition at line 104 of file d3dx8core.h.

◆ ID3DXFont_DrawTextA

#define ID3DXFont_DrawTextA (   p,
  a,
  b,
  c,
  d,
  e 
)    (p)->lpVtbl->DrawText(p,a,b,c,d,e)

Definition at line 105 of file d3dx8core.h.

◆ ID3DXFont_End

#define ID3DXFont_End (   p)    (p)->lpVtbl->End(p)

Definition at line 106 of file d3dx8core.h.

◆ ID3DXFont_QueryInterface

#define ID3DXFont_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 100 of file d3dx8core.h.

◆ ID3DXFont_Release

#define ID3DXFont_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 102 of file d3dx8core.h.

◆ INTERFACE [1/2]

Definition at line 84 of file d3dx8core.h.

◆ INTERFACE [2/2]

Definition at line 84 of file d3dx8core.h.

◆ MAKE_D3DXHRESULT

#define MAKE_D3DXHRESULT (   code)    MAKE_HRESULT( 1, _FACD3D, code )

Definition at line 35 of file d3dx8core.h.

Typedef Documentation

◆ ID3DXBuffer

Definition at line 51 of file d3dx8core.h.

◆ ID3DXFont

Definition at line 53 of file d3dx8core.h.

◆ LPD3DXBUFFER

Definition at line 51 of file d3dx8core.h.

◆ LPD3DXFONT

Definition at line 53 of file d3dx8core.h.

Function Documentation

◆ D3DXAssembleShader()

HRESULT WINAPI D3DXAssembleShader ( LPCVOID  pSrcData,
UINT  SrcDataLen,
DWORD  Flags,
LPD3DXBUFFER ppConstants,
LPD3DXBUFFER ppCompiledShader,
LPD3DXBUFFER ppCompilationErrors 
)

◆ D3DXAssembleShaderFromFileA()

HRESULT WINAPI D3DXAssembleShaderFromFileA ( LPSTR  pSrcFile,
DWORD  Flags,
LPD3DXBUFFER ppConstants,
LPD3DXBUFFER ppCompiledShader,
LPD3DXBUFFER ppCompilationErrors 
)

◆ D3DXAssembleShaderFromFileW()

HRESULT WINAPI D3DXAssembleShaderFromFileW ( LPSTR  pSrcFile,
DWORD  Flags,
LPD3DXBUFFER ppConstants,
LPD3DXBUFFER ppCompiledShader,
LPD3DXBUFFER ppCompilationErrors 
)

◆ D3DXCreateBuffer()

HRESULT WINAPI D3DXCreateBuffer ( DWORD  NumBytes,
LPD3DXBUFFER ppBuffer 
)

Definition at line 129 of file core.c.

130 {
131  struct ID3DXBufferImpl *object;
132  HRESULT hr;
133 
134  if (!buffer)
135  {
136  WARN("Invalid buffer specified.\n");
137  return D3DERR_INVALIDCALL;
138  }
139 
140  object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
141  if (!object)
142  return E_OUTOFMEMORY;
143 
144  hr = d3dx9_buffer_init(object, size);
145  if (FAILED(hr))
146  {
147  WARN("Failed to initialize buffer, hr %#x.\n", hr);
148  HeapFree(GetProcessHeap(), 0, object);
149  return hr;
150  }
151 
152  *buffer = &object->ID3DXBuffer_iface;
153 
154  TRACE("Created ID3DXBuffer %p.\n", *buffer);
155 
156  return D3D_OK;
157 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DERR_INVALIDCALL
GLuint buffer
Definition: glext.h:5915
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG HRESULT
Definition: typedefs.h:77
#define D3D_OK
Definition: d3d.h:106
static HRESULT d3dx9_buffer_init(struct ID3DXBufferImpl *buffer, DWORD size)
Definition: core.c:113
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:394
void * object
Definition: jmemsys.h:48

Referenced by compact_mesh(), d3dx9_mesh_OptimizeInplace(), D3DXCreateBox(), D3DXCreateCylinder(), D3DXCreatePolygon(), D3DXCreateSphere(), D3DXCreateTorus(), D3DXDisassembleShader(), D3DXLoadMeshFromXInMemory(), D3DXLoadSkinMeshFromXof(), D3DXSaveSurfaceToFileInMemory(), generate_effects(), and save_dds_surface_to_memory().

◆ D3DXCreateFont()

HRESULT WINAPI D3DXCreateFont ( LPDIRECT3DDEVICE8  pDevice,
HFONT  hFont,
LPD3DXFONT ppFont 
)

◆ D3DXGetFVFVertexSize()

UINT WINAPI D3DXGetFVFVertexSize ( DWORD  FVF)

Definition at line 2290 of file mesh.c.

2291 {
2292  DWORD size = 0;
2293  UINT i;
2294  UINT numTextures = (FVF & D3DFVF_TEXCOUNT_MASK) >> D3DFVF_TEXCOUNT_SHIFT;
2295 
2296  if (FVF & D3DFVF_NORMAL) size += sizeof(D3DXVECTOR3);
2297  if (FVF & D3DFVF_DIFFUSE) size += sizeof(DWORD);
2298  if (FVF & D3DFVF_SPECULAR) size += sizeof(DWORD);
2299  if (FVF & D3DFVF_PSIZE) size += sizeof(DWORD);
2300 
2301  switch (FVF & D3DFVF_POSITION_MASK)
2302  {
2303  case D3DFVF_XYZ: size += sizeof(D3DXVECTOR3); break;
2304  case D3DFVF_XYZRHW: size += 4 * sizeof(FLOAT); break;
2305  case D3DFVF_XYZB1: size += 4 * sizeof(FLOAT); break;
2306  case D3DFVF_XYZB2: size += 5 * sizeof(FLOAT); break;
2307  case D3DFVF_XYZB3: size += 6 * sizeof(FLOAT); break;
2308  case D3DFVF_XYZB4: size += 7 * sizeof(FLOAT); break;
2309  case D3DFVF_XYZB5: size += 8 * sizeof(FLOAT); break;
2310  case D3DFVF_XYZW: size += 4 * sizeof(FLOAT); break;
2311  }
2312 
2313  for (i = 0; i < numTextures; i++)
2314  {
2315  size += Get_TexCoord_Size_From_FVF(FVF, i) * sizeof(FLOAT);
2316  }
2317 
2318  return size;
2319 }
#define D3DFVF_XYZB1
Definition: d3d8types.h:115
#define D3DFVF_XYZRHW
Definition: d3d8types.h:114
#define D3DFVF_PSIZE
Definition: d3d8types.h:121
#define FLOAT
Definition: i386-dis.c:516
#define D3DFVF_NORMAL
Definition: d3d8types.h:120
#define DWORD
Definition: nt_native.h:44
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define D3DFVF_TEXCOUNT_MASK
Definition: d3d8types.h:124
#define D3DFVF_POSITION_MASK
Definition: d3d8types.h:112
#define D3DFVF_SPECULAR
Definition: d3d8types.h:123
#define D3DFVF_XYZB2
Definition: d3d8types.h:116
GLsizeiptr size
Definition: glext.h:5919
#define D3DFVF_XYZB5
Definition: d3d8types.h:119
#define D3DFVF_XYZ
Definition: d3d8types.h:113
struct _D3DVECTOR D3DXVECTOR3
Definition: d3dx9math.h:97
unsigned long DWORD
Definition: ntddk_ex.h:95
static UINT Get_TexCoord_Size_From_FVF(DWORD FVF, int tex_num)
Definition: mesh.c:2285
#define D3DFVF_XYZB3
Definition: d3d8types.h:117
#define D3DFVF_XYZB4
Definition: d3d8types.h:118
#define D3DFVF_TEXCOUNT_SHIFT
Definition: d3d8types.h:125
unsigned int UINT
Definition: ndis.h:50
#define D3DFVF_DIFFUSE
Definition: d3d8types.h:122
#define D3DFVF_XYZW
Definition: d3d9types.h:143

Referenced by d3dx9_skin_info_UpdateSkinnedMesh(), and D3DXLoadSkinMeshFromXof().

◆ DECLARE_INTERFACE_() [1/2]

DECLARE_INTERFACE_ ( ID3DXBuffer  ,
IUnknown   
)

Definition at line 59 of file d3dx8core.h.

60 {
61  /*** IUnknown methods ***/
65  /*** ID3DXBuffer methods ***/
66  STDMETHOD_(LPVOID,GetBufferPointer)(THIS) PURE;
67  STDMETHOD_(DWORD,GetBufferSize)(THIS) PURE;
68 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define PURE
Definition: basetyps.h:64
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DECLARE_INTERFACE_() [2/2]

DECLARE_INTERFACE_ ( ID3DXFont  ,
IUnknown   
)

Definition at line 85 of file d3dx8core.h.

86 {
87  /*** IUnknown methods ***/
91  /*** ID3DXFont methods ***/
94  STDMETHOD(End)(THIS) PURE;
95 };
#define REFIID
Definition: guiddef.h:118
#define THIS_
Definition: basetyps.h:65
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define THIS
Definition: basetyps.h:66
REFIID riid
Definition: precomp.h:44
NTSTATUS QueryInterface(IN PDEVICE_OBJECT DeviceObject, IN CONST GUID InterfaceType, IN LONG Size, IN LONG Version, OUT PVOID Interface)
Definition: fdo.c:532
#define STDMETHOD(m)
Definition: basetyps.h:62
LONG HRESULT
Definition: typedefs.h:77
REFIID LPVOID * ppvObject
Definition: precomp.h:44
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
Definition: font.c:373
#define PURE
Definition: basetyps.h:64
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
unsigned int ULONG
Definition: retypes.h:1
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 ACPI_STATUS const char UINT32 ACPI_STATUS const char UINT32 const char const char UINT32 const char BOOLEAN Begin
Definition: acpixf.h:1287
#define STDMETHOD_(t, m)
Definition: basetyps.h:63

◆ DEFINE_GUID() [1/2]

DEFINE_GUID ( IID_ID3DXBuffer  ,
0x1  ,
0x1  ,
0x4  ,
0xB0  ,
0xCF  ,
0x98  ,
0xFE  ,
0xFD  ,
0xFF  ,
0x95  ,
0x12   
)

◆ DEFINE_GUID() [2/2]

DEFINE_GUID ( IID_ID3DXFont  ,
0x1  ,
0x1  ,
0x4  ,
0xB0  ,
0xCF  ,
0x98  ,
0xFE  ,
0xFD  ,
0xFF  ,
0x95  ,
0x13   
)