2 * Copyright 2017 Fabian Maurer
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #pragma makedep register
23 #include
"d3d8types.h"
25 interface Direct3DDevice8
;
28 interface Direct3DSurface8
;
29 interface Direct3DTexture8
;
30 interface Direct3DCubeTexture8
;
31 interface Direct3DVolume8
;
35 interface D3DXBaseMesh
;
36 interface D3DXSkinMesh
;
38 interface D3DXRenderToSurface
;
39 interface Direct3DBaseTexture8
;
40 interface DirectSound8
;
41 interface DirectSoundCapture8
;
42 interface DirectSoundEnum8
;
43 interface DirectSoundEnum8
;
44 interface DirectInput8
;
45 interface DirectMusicLoader8
;
46 interface DirectMusicComposer8
;
47 interface DirectMusicPerformance8
;
48 interface DirectXEvent8
;
49 interface DirectPlayVoiceClient8
;
50 interface DirectPlayVoiceServer8
;
51 interface DirectPlayVoiceTest8
;
52 interface DirectXFile
;
53 interface DirectPlay8Peer
;
54 interface DirectPlay8Server
;
55 interface DirectPlay8Client
;
56 interface DirectPlay8Address
;
58 interface DirectPlay8LobbyClient
;
59 interface DirectPlay8LobbiedApplication
;
69 D3DXIFF_FORCE_DWORD
= 0x7fffffff
70 } D3DXIMAGE_FILEFORMAT
;
72 typedef struct tagD3DXDECLARATOR
{
76 typedef struct tagD3DXMATERIAL
{
81 typedef struct tagD3DXBONECOMBINATION
{
88 } D3DXBONECOMBINATION
;
92 uuid(3ac50043
-cf82
-4c44
-862e
-b206b4f03301
),
95 interface ID3DX8
: IUnknown
{
97 [in] Direct3DDevice8
*device
,
99 [out, retval] D3DXFont
**retFont
102 [in] D3DXFont
*d3dFont
,
108 HRESULT GetFVFVertexSize
(
110 [out, retval] LONG *size
112 HRESULT AssembleShaderFromFile
(
116 [in, out] D3DXBuffer
**constants
,
117 [out, retval] D3DXBuffer
**ppVertexShader
119 HRESULT AssembleShader
(
122 [in, out] D3DXBuffer
**constants
,
123 [in, out, optional] BSTR *log
,
124 [out, retval] D3DXBuffer
**ppVertexShader
126 HRESULT GetErrorString
(
128 [out, retval] BSTR *retStr
130 HRESULT LoadSurfaceFromFile
(
131 [in] Direct3DSurface8
*destSurface
,
132 [in] void *destPalette
,
138 [in, out] void *srcInfo
140 HRESULT LoadSurfaceFromFileInMemory
(
141 [in] Direct3DSurface8
*destSurface
,
142 [in] void *destPalette
,
145 [in] LONG lengthInBytes
,
149 [in, out] void *srcInfo
151 HRESULT LoadSurfaceFromSurface
(
152 [in] Direct3DSurface8
*destSurface
,
153 [in] void *destPalette
,
155 [in] Direct3DSurface8
*srcSurface
,
156 [in] void *srcPalette
,
161 HRESULT LoadSurfaceFromMemory
(
162 [in] Direct3DSurface8
*destSurface
,
163 [in] void *destPalette
,
166 [in] D3DFORMAT formatSrc
,
168 [in] void *srcPalette
,
173 HRESULT CheckTextureRequirements
(
174 [in, out] Direct3DDevice8
*device
,
175 [in, out] LONG *width
,
176 [in, out] LONG *height
,
177 [in, out] LONG *mipLevels
,
179 [in, out] D3DFORMAT
*pixelformat
,
182 HRESULT CreateTexture
(
183 [in] Direct3DDevice8
*device
,
188 [in] D3DFORMAT pixelformat
,
190 [out, retval] Direct3DTexture8
**ppTexture
192 HRESULT CreateTextureFromResource
(
193 [in] Direct3DDevice8
*device
,
195 [in] BSTR srcResource
,
196 [out, retval] Direct3DTexture8
**ppTexture
198 HRESULT CreateTextureFromFile
(
199 [in] Direct3DDevice8
*device
,
201 [out, retval] Direct3DTexture8
**ppTexture
203 HRESULT CreateTextureFromFileEx
(
204 [in] Direct3DDevice8
*device
,
210 [in] D3DFORMAT pixelformat
,
215 [in, out] void *srcInfo
,
217 [out, retval] Direct3DTexture8
**ppTexture
219 HRESULT CreateTextureFromFileInMemory
(
220 [in] Direct3DDevice8
*device
,
222 [in] LONG lengthInBytes
,
223 [out, retval] Direct3DTexture8
**ppTexture
225 HRESULT CreateTextureFromFileInMemoryEx
(
226 [in] Direct3DDevice8
*device
,
228 [in] LONG lengthInBytes
,
233 [in] D3DFORMAT pixelformat
,
238 [in, out] void *srcInfo
,
240 [out, retval] Direct3DTexture8
**ppTexture
242 HRESULT FilterTexture
(
243 [in] Direct3DTexture8
*texture
,
248 HRESULT CheckCubeTextureRequirements
(
249 [in] Direct3DDevice8
*device
,
250 [in, out] LONG *size
,
251 [in, out] LONG *mipLevels
,
253 [in, out] D3DFORMAT
*pixelformat
,
256 HRESULT CreateCubeTexture
(
257 [in] Direct3DDevice8
*device
,
261 [in] D3DFORMAT pixelformat
,
263 [out, retval] Direct3DCubeTexture8
**ppCubeTexture
265 HRESULT CreateCubeTextureFromFile
(
266 [in] Direct3DDevice8
*device
,
268 [out, retval] Direct3DCubeTexture8
**ppCubeTexture
270 HRESULT CreateCubeTextureFromFileEx
(
271 [in] Direct3DDevice8
*device
,
273 [in] LONG textureSize
,
276 [in] D3DFORMAT pixelformat
,
281 [in, out] void *srcInfo
,
283 [out, retval] Direct3DCubeTexture8
**ppTexture
285 HRESULT CreateCubeTextureFromFileInMemory
(
286 [in] Direct3DDevice8
*device
,
288 [in] LONG lengthInBytes
,
289 [out, retval] Direct3DCubeTexture8
**ppTexture
291 HRESULT CreateCubeTextureFromFileInMemoryEx
(
292 [in] Direct3DDevice8
*device
,
294 [in] LONG lengthInBytes
,
295 [in] LONG textureSize
,
298 [in] D3DFORMAT pixelformat
,
303 [in, out] void *srcInfo
,
305 [out, retval] Direct3DCubeTexture8
**ppTexture
307 HRESULT FilterCubeTexture
(
308 [in] Direct3DCubeTexture8
*cubeTexture
,
313 HRESULT CheckVolumeTextureRequirements
(
314 [in] Direct3DDevice8
*device
,
318 [out] LONG *mipLevels
,
320 [in, out] D3DFORMAT
*pixelformat
,
323 HRESULT CreateTextureFromResourceEx
(
324 [in] Direct3DDevice8
*device
,
325 [in] LONG hSrcModule
,
326 [in] BSTR srcResource
,
331 [in] D3DFORMAT pixelformat
,
336 [in, out] void *srcInfo
,
338 [out, retval] Direct3DTexture8
**retTexture
340 HRESULT CreateVolumeTexture
(
341 [in] Direct3DDevice8
*device
,
347 [in] D3DFORMAT pixelformat
,
349 [out, retval] Direct3DVolume8
**ppVolumeTexture
351 HRESULT FilterVolumeTexture
(
352 [in] Direct3DVolume8
*volumeTexture
,
357 HRESULT LoadSurfaceFromResource
(
358 [in] Direct3DSurface8
*destSurface
,
359 [in] void *destPalette
,
361 [in] LONG hSrcModule
,
362 [in] BSTR srcResource
,
366 [in, out] void *srcInfo
368 HRESULT LoadVolumeFromVolume
(
369 [in] Direct3DVolume8
*destVolume
,
370 [in] void *destPalette
,
372 [in] Direct3DVolume8
*srcVolume
,
373 [in] void *srcPalette
,
378 HRESULT LoadVolumeFromMemory
(
379 [in] Direct3DVolume8
*destVolume
,
380 [in] void *destPalette
,
382 [in] void *srcMemory
,
384 [in] LONG srcRowPitch
,
385 [in] LONG srcSlicePitch
,
386 [in] void *srcPalette
,
393 [in] LONG numVertices
,
395 [in] void *declaration
,
396 [in] Direct3DDevice8
*pD3D
,
397 [out, retval] D3DXMesh
**ppMesh
399 HRESULT CreateMeshFVF
(
401 [in] LONG numVertices
,
404 [in] Direct3DDevice8
*pD3D
,
405 [out, retval] D3DXMesh
**ppMesh
407 HRESULT CreateSPMesh
(
408 [in] D3DXMesh
*pMesh
,
409 [in] void *adjacency
,
410 [in] void *vertexAttributeWeights
,
411 [in] void *vertexWeights
,
412 [out, retval] D3DXSPMesh
**ppSMesh
414 HRESULT GeneratePMesh
(
416 [in] void *adjacency
,
417 [in] void *vertexAttributeWeights
,
418 [in] void *vertexWeights
,
421 [out, retval] D3DXPMesh
**ppPMesh
423 HRESULT SimplifyMesh
(
425 [in] void *adjacency
,
426 [in] void *vertexAttributeWeights
,
427 [in] void *vertexWeights
,
430 [out, retval] D3DXMesh
**ppMesh
432 HRESULT ComputeBoundingSphere
(
433 [in] void *pointsFVF
,
434 [in] LONG numVertices
,
436 [in] D3DVECTOR
*centers
,
437 [in, out] float *radiusArray
439 HRESULT ComputeBoundingBox
(
440 [in] void *pointsFVF
,
441 [in] LONG numVertices
,
443 [in, out] D3DVECTOR
*minVert
,
444 [in, out] D3DVECTOR
*maxVert
446 HRESULT ComputeNormals
(
447 [in] D3DXBaseMesh
*pMesh
449 HRESULT DeclaratorFromFVF
(
451 [out] D3DXDECLARATOR
*declarator
453 HRESULT FVFFromDeclarator
(
454 [in] D3DXDECLARATOR
*declarator
,
455 [out, retval] LONG *fvf
457 HRESULT CreateBuffer
(
459 [out, retval] D3DXBuffer
**ppBuffer
461 HRESULT LoadMeshFromX
(
464 [in] Direct3DDevice8
*device
,
465 [in, out] D3DXBuffer
**retAdjacency
,
466 [in, out] D3DXBuffer
**retMaterials
,
467 [in, out] LONG *retMaterialCount
,
468 [out, retval] D3DXMesh
**retMesh
473 [in] void *adjacencyArray
,
474 [in] D3DXMATERIAL
*materialArray
,
475 [in] LONG materialCount
,
478 HRESULT LoadMeshFromXof
(
479 [in] IUnknown
*xofobjMesh
,
481 [in] Direct3DDevice8
*device
,
482 [in, out] D3DXBuffer
**retBufAdjacency
,
483 [in, out] D3DXBuffer
**retMaterials
,
484 [in, out] LONG *retMaterialCount
,
485 [out, retval] D3DXMesh
**retMesh
487 HRESULT TessellateNPatches
(
488 [in] D3DXMesh
*meshIn
,
489 [in] void *adjacencyIn
,
491 [in] VARIANT_BOOL quadraticInterpNormals
,
492 [in, out, optional] D3DXBuffer
**adjacencyOut
,
493 [out, retval] D3DXMesh
**meshOut
495 HRESULT BufferGetMaterial
(
496 [in] D3DXBuffer
*materialBuffer
,
498 [out] D3DMATERIAL8
*mat
500 HRESULT BufferGetTextureName
(
501 [in] D3DXBuffer
*materialBuffer
,
503 [out, retval] BSTR *retName
505 HRESULT BufferGetData
(
506 [in] D3DXBuffer
*buffer
,
512 HRESULT BufferSetData
(
513 [in] D3DXBuffer
*buffer
,
520 [in] D3DXMesh
*meshIn
,
521 [in] D3DVECTOR
*rayPos
,
522 [in] D3DVECTOR
*rayDir
,
524 [out] LONG *retFaceIndex
,
527 [out] float *retDist
,
528 [out] LONG *countHits
,
529 [out, retval] D3DXBuffer
**allHits
531 HRESULT SphereBoundProbe
(
532 [in] D3DVECTOR
*center
,
534 [in] D3DVECTOR
*rayPosition
,
535 [in] D3DVECTOR
*rayDirection
,
536 [out, retval] VARIANT_BOOL *retHit
538 HRESULT ComputeBoundingSphereFromMesh
(
539 [in] D3DXMesh
*meshIn
,
540 [in, out] D3DVECTOR
*centers
,
541 [in, out] float *radiusArray
543 HRESULT ComputeBoundingBoxFromMesh
(
544 [in] D3DXMesh
*meshIn
,
545 [in, out] D3DVECTOR
*minArray
,
546 [in, out] D3DVECTOR
*maxArray
548 HRESULT CreateSkinMesh
(
550 [in] LONG numVertices
,
553 [in] void *declaration
,
554 [in] Direct3DDevice8
*device
,
555 [out, retval] D3DXSkinMesh
**ppSkinMesh
557 HRESULT CreateSkinMeshFVF
(
559 [in] LONG numVertices
,
563 [in] Direct3DDevice8
*device
,
564 [out, retval] D3DXSkinMesh
**ppSkinMesh
566 HRESULT CreateSkinMeshFromMesh
(
569 [out, retval] D3DXSkinMesh
**ppSkinMesh
571 HRESULT LoadSkinMeshFromXof
(
572 [in] IUnknown
*xofobjMesh
,
574 [in] Direct3DDevice8
*device
,
575 [in, out] D3DXBuffer
**adjacencyOut
,
576 [in, out] D3DXBuffer
**materialsOut
,
577 [in, out] LONG *numMatOut
,
578 [in, out] D3DXBuffer
**boneNamesOut
,
579 [in, out] D3DXBuffer
**boneTransformsOut
,
580 [out, retval] D3DXSkinMesh
**ppMesh
582 HRESULT CreatePolygon
(
583 [in] Direct3DDevice8
*device
,
586 [in, out] D3DXBuffer
**retAdjacency
,
587 [out, retval] D3DXMesh
**retMesh
590 [in] Direct3DDevice8
*device
,
594 [in, out] D3DXBuffer
**retAdjacency
,
595 [out, retval] D3DXMesh
**retMesh
597 HRESULT CreateCylinder
(
598 [in] Direct3DDevice8
*device
,
604 [in, out] D3DXBuffer
**retAdjacency
,
605 [out, retval] D3DXMesh
**retMesh
607 HRESULT CreateSphere
(
608 [in] Direct3DDevice8
*device
,
612 [in, out] D3DXBuffer
**retAdjacency
,
613 [out, retval] D3DXMesh
**retMesh
616 [in] Direct3DDevice8
*device
,
617 [in] float innerRadius
,
618 [in] float outerRadius
,
621 [in, out] D3DXBuffer
**retAdjacency
,
622 [out, retval] D3DXMesh
**retMesh
624 HRESULT CreateTeapot
(
625 [in] Direct3DDevice8
*device
,
626 [in, out] D3DXBuffer
**retAdjacency
,
627 [out, retval] D3DXMesh
**retMesh
630 [in] Direct3DDevice8
*device
,
633 [in] float deviation
,
634 [in] float extrusion
,
635 [in, out] D3DXMesh
**retMesh
,
636 [in, out] D3DXBuffer
**adjacencyOut
,
637 [in, out] void *glyphMetrics
639 HRESULT BufferGetBoneName
(
640 [in] D3DXBuffer
*boneNameBuffer
,
642 [out, retval] BSTR *retName
644 HRESULT CreateSprite
(
645 [in] Direct3DDevice8
*device
,
646 [out, retval] D3DXSprite
**retSprite
648 HRESULT CreateRenderToSurface
(
649 [in] Direct3DDevice8
*device
,
652 [in] D3DFORMAT format
,
653 [in] LONG depthStencil
,
654 [in] D3DFORMAT depthStencilFormat
,
655 [out, retval] D3DXRenderToSurface
**retRenderToSurface
658 [in] D3DXMesh
*meshIn
,
659 [in] void *adjacency
,
661 [in, out] D3DXBuffer
*adjacencyOut
,
662 [out, retval] D3DXMesh
**meshOut
665 [in] D3DXMesh
*meshIn
,
666 [in] void *adjacency
,
667 [in, out, optional] BSTR *log
,
668 [out, retval] VARIANT_BOOL *ret
670 HRESULT BoxBoundProbe
(
671 [in] D3DVECTOR
*minVert
,
672 [in] D3DVECTOR
*maxVert
,
673 [in] D3DVECTOR
*rayPosition
,
674 [in] D3DVECTOR
*rayDirection
,
675 [out, retval] VARIANT_BOOL *ret
677 HRESULT SavePMeshToFile
(
679 [in] D3DXPMesh
*mesh
,
680 [in] D3DXMATERIAL
*materialArray
,
681 [in] LONG materialCount
683 HRESULT LoadPMeshFromFile
(
686 [in] Direct3DDevice8
*device
,
687 [out] D3DXBuffer
**retMaterials
,
688 [out] LONG *retNumMaterials
,
689 [out, retval] D3DXPMesh
**retPMesh
691 HRESULT BufferGetBoneCombo
(
692 [in] D3DXBuffer
*boneComboBuffer
,
694 [in, out] D3DXBONECOMBINATION
*boneCombo
696 HRESULT BufferGetBoneComboBoneIds
(
697 [in] D3DXBuffer
*boneComboBuffer
,
699 [in] LONG paletteSize
,
702 HRESULT SaveSurfaceToFile
(
704 [in] D3DXIMAGE_FILEFORMAT destFormat
,
705 [in] Direct3DSurface8
*srcSurface
,
706 [in] PALETTEENTRY
*srcPalette
,
709 HRESULT SaveVolumeToFile
(
711 [in] D3DXIMAGE_FILEFORMAT destFormat
,
712 [in] Direct3DVolume8
*srcVolume
,
713 [in] PALETTEENTRY
*srcPalette
,
716 HRESULT SaveTextureToFile
(
718 [in] D3DXIMAGE_FILEFORMAT destFormat
,
719 [in] Direct3DBaseTexture8
*srcTexture
,
720 [in] PALETTEENTRY
*srcPalette
726 uuid(e7ff1301
-96a5
-11d3
-ac85
-00c04fc2c602
),
727 helpstring("DirectX8 root object functions"),
730 interface IDirectX8
: IUnknown
{
731 HRESULT DirectSoundCreate
(
733 [out, retval] DirectSound8
**ret
735 HRESULT DirectSoundCaptureCreate
(
737 [out, retval] DirectSoundCapture8
**ret
740 [out, retval] DirectSoundEnum8
**ret
742 HRESULT GetDSCaptureEnum
(
743 [out, retval] DirectSoundEnum8
**ret
745 HRESULT DirectInputCreate
(
746 [out, retval] DirectInput8
**ret
748 HRESULT DirectMusicLoaderCreate
(
749 [out, retval] DirectMusicLoader8
**ret
751 HRESULT DirectMusicComposerCreate
(
752 [out, retval] DirectMusicComposer8
**ret
754 HRESULT DirectMusicPerformanceCreate
(
755 [out, retval] DirectMusicPerformance8
**ret
758 [in] DirectXEvent8
*event
,
759 [out, retval] LONG *h
764 HRESULT DestroyEvent
(
767 HRESULT CreateNewGuid
(
768 [out, retval] BSTR *retGuid
770 HRESULT DirectPlayVoiceClientCreate
(
771 [out, retval] DirectPlayVoiceClient8
**ret
773 HRESULT DirectPlayVoiceServerCreate
(
774 [out, retval] DirectPlayVoiceServer8
**ret
776 HRESULT DirectPlayVoiceTestCreate
(
777 [out, retval] DirectPlayVoiceTest8
**ret
779 HRESULT DirectXFileCreate
(
780 [out, retval] DirectXFile
**ret
782 HRESULT DirectPlayPeerCreate
(
783 [out, retval] DirectPlay8Peer
**ret
785 HRESULT DirectPlayServerCreate
(
786 [out, retval] DirectPlay8Server
**ret
788 HRESULT DirectPlayClientCreate
(
789 [out, retval] DirectPlay8Client
**ret
791 HRESULT DirectPlayAddressCreate
(
792 [out, retval] DirectPlay8Address
**ret
794 HRESULT Direct3DCreate
(
795 [out, retval] Direct3D8
**ret
797 HRESULT DirectPlayLobbyClientCreate
(
798 [out, retval] DirectPlay8LobbyClient
**ret
800 HRESULT DirectPlayLobbiedApplicationCreate
(
801 [out, retval] DirectPlay8LobbiedApplication
**ret
806 uuid(58356c5d
-0bfd
-48ed
-93c5
-f4520b6233de
),
809 progid
("DIRECT.D3DX8.0"),
810 vi_progid
("DIRECT.D3DX8.0")
812 coclass D3DX8
{ interface ID3DX8
; };
815 uuid(e7ff1300
-96a5
-11d3
-ac85
-00c04fc2c602
),
816 helpstring("DirectX8"),
818 progid
("DIRECT.DirectX8.0"),
819 vi_progid
("DIRECT.DirectX8.0")
821 coclass DirectX8
{ interface IDirectX8
; };