ReactOS 0.4.16-dev-109-gf4cb10f
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 131 of file core.c.

132{
133 struct ID3DXBufferImpl *object;
134 HRESULT hr;
135
136 TRACE("size %u, buffer %p.\n", size, buffer);
137
138 if (!buffer)
139 {
140 WARN("Invalid buffer specified.\n");
141 return D3DERR_INVALIDCALL;
142 }
143
144 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
145 if (!object)
146 return E_OUTOFMEMORY;
147
148 hr = d3dx9_buffer_init(object, size);
149 if (FAILED(hr))
150 {
151 WARN("Failed to initialize buffer, hr %#x.\n", hr);
152 HeapFree(GetProcessHeap(), 0, object);
153 return hr;
154 }
155
156 *buffer = &object->ID3DXBuffer_iface;
157
158 TRACE("Created ID3DXBuffer %p.\n", *buffer);
159
160 return D3D_OK;
161}
#define WARN(fmt,...)
Definition: precomp.h:61
#define D3D_OK
Definition: d3d.h:106
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static HRESULT d3dx9_buffer_init(struct ID3DXBufferImpl *buffer, DWORD size)
Definition: core.c:115
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLsizeiptr size
Definition: glext.h:5919
GLuint buffer
Definition: glext.h:5915
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
#define TRACE(s)
Definition: solgame.cpp:4

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

◆ D3DXCreateFont()

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

◆ D3DXGetFVFVertexSize()

UINT WINAPI D3DXGetFVFVertexSize ( DWORD  FVF)

Definition at line 2289 of file mesh.c.

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

Referenced by check_vertex_buffer_(), compare_mesh(), compare_text_outline_mesh(), d3dx9_skin_info_UpdateSkinnedMesh(), D3DXComputeBoundingBoxTest(), D3DXComputeBoundingSphereTest(), 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 PURE
Definition: basetyps.h:64
#define THIS_
Definition: basetyps.h:65
#define THIS
Definition: basetyps.h:66
#define STDMETHOD_(t, m)
Definition: basetyps.h:63
_In_ BOOLEAN Release
Definition: cdrom.h:920
REFIID riid
Definition: atlbase.h:39
static HRESULT QueryInterface(REFIID, void **)
Definition: events.c:2587
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
#define REFIID
Definition: guiddef.h:118
uint32_t ULONG
Definition: typedefs.h:59
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

◆ 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};
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:1301
#define STDMETHOD(m)
Definition: basetyps.h:62
INT WINAPI DrawTextA(HDC hdc, LPCSTR str, INT count, LPRECT rect, UINT flags)
Definition: font.c:373

◆ 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   
)