1 /* FIXME: Need to add C++ code for certain structs for headers - this is going to be a problem
2 if WINE continues to only use C code - I suppose that we could always inline in
3 the header file to get around that little problem... */
4 /* FIXME: We need to implement versioning on everything directx 5 and up if these headers
5 are going to be generically useful for directx stuff */
7 #ifndef __WINE_D3DTYPES_H
8 #define __WINE_D3DTYPES_H
10 /* #include <windows.h> FIXME: Need to include for compatibility. Inclusion caused compile fail */
15 #define D3DVALP(val, prec) ((float)(val))
16 #define D3DVAL(val) ((float)(val))
17 typedef float D3DVALUE
,*LPD3DVALUE
;
18 #define D3DDivide(a, b) (float)((double) (a) / (double) (b))
19 #define D3DMultiply(a, b) ((a) * (b))
21 typedef LONG D3DFIXED
;
25 #define CI_GETALPHA(ci) ((ci) >> 24)
26 #define CI_GETINDEX(ci) (((ci) >> 8) & 0xffff)
27 #define CI_GETFRACTION(ci) ((ci) & 0xff)
28 #define CI_ROUNDINDEX(ci) CI_GETINDEX((ci) + 0x80)
29 #define CI_MASKALPHA(ci) ((ci) & 0xffffff)
30 #define CI_MAKE(a, i, f) (((a) << 24) | ((i) << 8) | (f))
32 #define RGBA_GETALPHA(rgb) ((rgb) >> 24)
33 #define RGBA_GETRED(rgb) (((rgb) >> 16) & 0xff)
34 #define RGBA_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
35 #define RGBA_GETBLUE(rgb) ((rgb) & 0xff)
36 #define RGBA_MAKE(r, g, b, a) ((D3DCOLOR) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)))
38 #define D3DRGB(r, g, b) \
39 (0xff000000L | ( ((long)((r) * 255)) << 16) | (((long)((g) * 255)) << 8) | (long)((b) * 255))
40 #define D3DRGBA(r, g, b, a) \
41 ( (((long)((a) * 255)) << 24) | (((long)((r) * 255)) << 16) \
42 | (((long)((g) * 255)) << 8) | (long)((b) * 255) \
45 #define RGB_GETRED(rgb) (((rgb) >> 16) & 0xff)
46 #define RGB_GETGREEN(rgb) (((rgb) >> 8) & 0xff)
47 #define RGB_GETBLUE(rgb) ((rgb) & 0xff)
48 #define RGBA_SETALPHA(rgba, x) (((x) << 24) | ((rgba) & 0x00ffffff))
49 #define RGB_MAKE(r, g, b) ((D3DCOLOR) (((r) << 16) | ((g) << 8) | (b)))
50 #define RGBA_TORGB(rgba) ((D3DCOLOR) ((rgba) & 0xffffff))
51 #define RGB_TORGBA(rgb) ((D3DCOLOR) ((rgb) | 0xff000000))
55 #define D3DENUMRET_CANCEL DDENUMRET_CANCEL
56 #define D3DENUMRET_OK DDENUMRET_OK
58 typedef HRESULT (CALLBACK
* LPD3DVALIDATECALLBACK
)(LPVOID lpUserArg
, DWORD dwOffset
);
59 typedef HRESULT (CALLBACK
* LPD3DENUMTEXTUREFORMATSCALLBACK
)(LPDDSURFACEDESC lpDdsd
, LPVOID lpContext
);
60 typedef HRESULT (CALLBACK
* LPD3DENUMPIXELFORMATSCALLBACK
)(LPDDPIXELFORMAT lpDDPixFmt
, LPVOID lpContext
);
62 typedef DWORD D3DCOLOR
, *LPD3DCOLOR
;
64 typedef DWORD D3DMATERIALHANDLE
, *LPD3DMATERIALHANDLE
;
65 typedef DWORD D3DTEXTUREHANDLE
, *LPD3DTEXTUREHANDLE
;
66 typedef DWORD D3DMATRIXHANDLE
, *LPD3DMATRIXHANDLE
;
68 typedef struct _D3DCOLORVALUE
{
85 } D3DCOLORVALUE
,*LPD3DCOLORVALUE
;
87 typedef struct _D3DRECT
{
104 } D3DRECT
, *LPD3DRECT
;
106 typedef struct _D3DVECTOR
{
119 /* the C++ variant has operator overloads etc. too */
120 } D3DVECTOR
,*LPD3DVECTOR
;
122 typedef struct _D3DHVERTEX
{
136 } D3DHVERTEX
, *LPD3DHVERTEX
;
139 * Transformed/lit vertices
174 /* There are C++ members associated with this class */
175 } D3DTLVERTEX
, *LPD3DTLVERTEX
;
177 typedef struct _D3DLVERTEX
{
207 } D3DLVERTEX
, *LPD3DLVERTEX
;
209 typedef struct _D3DVERTEX
{
242 /* FIXME: Some C++ stuff to go here */
243 } D3DVERTEX
, *LPD3DVERTEX
;
246 D3DVALUE _11
, _12
, _13
, _14
;
247 D3DVALUE _21
, _22
, _23
, _24
;
248 D3DVALUE _31
, _32
, _33
, _34
;
249 D3DVALUE _41
, _42
, _43
, _44
;
250 /* FIXME: Some C++ stuff here */
251 } D3DMATRIX
, *LPD3DMATRIX
;
253 typedef struct _D3DVIEWPORT
{
265 } D3DVIEWPORT
, *LPD3DVIEWPORT
;
267 typedef struct _D3DVIEWPORT2
{
275 D3DVALUE dvClipWidth
;
276 D3DVALUE dvClipHeight
;
279 } D3DVIEWPORT2
, *LPD3DVIEWPORT2
;
281 typedef struct _D3DVIEWPORT7
{
288 } D3DVIEWPORT7
, *LPD3DVIEWPORT7
;
290 #define D3DMAXUSERCLIPPLANES 32
292 #define D3DCLIPPLANE0 (1 << 0)
293 #define D3DCLIPPLANE1 (1 << 1)
294 #define D3DCLIPPLANE2 (1 << 2)
295 #define D3DCLIPPLANE3 (1 << 3)
296 #define D3DCLIPPLANE4 (1 << 4)
297 #define D3DCLIPPLANE5 (1 << 5)
299 #define D3DCLIP_LEFT 0x00000001
300 #define D3DCLIP_RIGHT 0x00000002
301 #define D3DCLIP_TOP 0x00000004
302 #define D3DCLIP_BOTTOM 0x00000008
303 #define D3DCLIP_FRONT 0x00000010
304 #define D3DCLIP_BACK 0x00000020
305 #define D3DCLIP_GEN0 0x00000040
306 #define D3DCLIP_GEN1 0x00000080
307 #define D3DCLIP_GEN2 0x00000100
308 #define D3DCLIP_GEN3 0x00000200
309 #define D3DCLIP_GEN4 0x00000400
310 #define D3DCLIP_GEN5 0x00000800
312 #define D3DSTATUS_CLIPUNIONLEFT D3DCLIP_LEFT
313 #define D3DSTATUS_CLIPUNIONRIGHT D3DCLIP_RIGHT
314 #define D3DSTATUS_CLIPUNIONTOP D3DCLIP_TOP
315 #define D3DSTATUS_CLIPUNIONBOTTOM D3DCLIP_BOTTOM
316 #define D3DSTATUS_CLIPUNIONFRONT D3DCLIP_FRONT
317 #define D3DSTATUS_CLIPUNIONBACK D3DCLIP_BACK
318 #define D3DSTATUS_CLIPUNIONGEN0 D3DCLIP_GEN0
319 #define D3DSTATUS_CLIPUNIONGEN1 D3DCLIP_GEN1
320 #define D3DSTATUS_CLIPUNIONGEN2 D3DCLIP_GEN2
321 #define D3DSTATUS_CLIPUNIONGEN3 D3DCLIP_GEN3
322 #define D3DSTATUS_CLIPUNIONGEN4 D3DCLIP_GEN4
323 #define D3DSTATUS_CLIPUNIONGEN5 D3DCLIP_GEN5
325 #define D3DSTATUS_CLIPINTERSECTIONLEFT 0x00001000
326 #define D3DSTATUS_CLIPINTERSECTIONRIGHT 0x00002000
327 #define D3DSTATUS_CLIPINTERSECTIONTOP 0x00004000
328 #define D3DSTATUS_CLIPINTERSECTIONBOTTOM 0x00008000
329 #define D3DSTATUS_CLIPINTERSECTIONFRONT 0x00010000
330 #define D3DSTATUS_CLIPINTERSECTIONBACK 0x00020000
331 #define D3DSTATUS_CLIPINTERSECTIONGEN0 0x00040000
332 #define D3DSTATUS_CLIPINTERSECTIONGEN1 0x00080000
333 #define D3DSTATUS_CLIPINTERSECTIONGEN2 0x00100000
334 #define D3DSTATUS_CLIPINTERSECTIONGEN3 0x00200000
335 #define D3DSTATUS_CLIPINTERSECTIONGEN4 0x00400000
336 #define D3DSTATUS_CLIPINTERSECTIONGEN5 0x00800000
337 #define D3DSTATUS_ZNOTVISIBLE 0x01000000
339 #define D3DSTATUS_CLIPUNIONALL ( \
340 D3DSTATUS_CLIPUNIONLEFT | \
341 D3DSTATUS_CLIPUNIONRIGHT | \
342 D3DSTATUS_CLIPUNIONTOP | \
343 D3DSTATUS_CLIPUNIONBOTTOM | \
344 D3DSTATUS_CLIPUNIONFRONT | \
345 D3DSTATUS_CLIPUNIONBACK | \
346 D3DSTATUS_CLIPUNIONGEN0 | \
347 D3DSTATUS_CLIPUNIONGEN1 | \
348 D3DSTATUS_CLIPUNIONGEN2 | \
349 D3DSTATUS_CLIPUNIONGEN3 | \
350 D3DSTATUS_CLIPUNIONGEN4 | \
351 D3DSTATUS_CLIPUNIONGEN5 \
354 #define D3DSTATUS_CLIPINTERSECTIONALL ( \
355 D3DSTATUS_CLIPINTERSECTIONLEFT | \
356 D3DSTATUS_CLIPINTERSECTIONRIGHT | \
357 D3DSTATUS_CLIPINTERSECTIONTOP | \
358 D3DSTATUS_CLIPINTERSECTIONBOTTOM | \
359 D3DSTATUS_CLIPINTERSECTIONFRONT | \
360 D3DSTATUS_CLIPINTERSECTIONBACK | \
361 D3DSTATUS_CLIPINTERSECTIONGEN0 | \
362 D3DSTATUS_CLIPINTERSECTIONGEN1 | \
363 D3DSTATUS_CLIPINTERSECTIONGEN2 | \
364 D3DSTATUS_CLIPINTERSECTIONGEN3 | \
365 D3DSTATUS_CLIPINTERSECTIONGEN4 | \
366 D3DSTATUS_CLIPINTERSECTIONGEN5 \
369 #define D3DSTATUS_DEFAULT ( \
370 D3DSTATUS_CLIPINTERSECTIONALL | \
371 D3DSTATUS_ZNOTVISIBLE)
373 #define D3DTRANSFORM_CLIPPED 0x00000001
374 #define D3DTRANSFORM_UNCLIPPED 0x00000002
376 typedef struct _D3DTRANSFORMDATA
{
384 DWORD dwClipIntersection
;
387 } D3DTRANSFORMDATA
, *LPD3DTRANSFORMDATA
;
389 typedef struct _D3DLIGHTINGELEMENT
{
390 D3DVECTOR dvPosition
;
392 } D3DLIGHTINGELEMENT
, *LPD3DLIGHTINGELEMENT
;
394 typedef struct _D3DMATERIAL
{
397 D3DCOLORVALUE diffuse
;
398 D3DCOLORVALUE dcvDiffuse
;
401 D3DCOLORVALUE ambient
;
402 D3DCOLORVALUE dcvAmbient
;
405 D3DCOLORVALUE specular
;
406 D3DCOLORVALUE dcvSpecular
;
409 D3DCOLORVALUE emissive
;
410 D3DCOLORVALUE dcvEmissive
;
416 D3DTEXTUREHANDLE hTexture
;
418 } D3DMATERIAL
, *LPD3DMATERIAL
;
420 typedef struct _D3DMATERIAL7
{
422 D3DCOLORVALUE diffuse
;
423 D3DCOLORVALUE dcvDiffuse
;
426 D3DCOLORVALUE ambient
;
427 D3DCOLORVALUE dcvAmbient
;
430 D3DCOLORVALUE specular
;
431 D3DCOLORVALUE dcvSpecular
;
434 D3DCOLORVALUE emissive
;
435 D3DCOLORVALUE dcvEmissive
;
441 } D3DMATERIAL7
, *LPD3DMATERIAL7
;
446 D3DLIGHT_DIRECTIONAL
= 3,
447 D3DLIGHT_PARALLELPOINT
= 4,
449 D3DLIGHT_FORCE_DWORD
= 0x7fffffff
452 typedef struct _D3DLIGHT
{
454 D3DLIGHTTYPE dltType
;
455 D3DCOLORVALUE dcvColor
;
456 D3DVECTOR dvPosition
;
457 D3DVECTOR dvDirection
;
460 D3DVALUE dvAttenuation0
;
461 D3DVALUE dvAttenuation1
;
462 D3DVALUE dvAttenuation2
;
465 } D3DLIGHT
,*LPD3DLIGHT
;
467 typedef struct _D3DLIGHT7
{
468 D3DLIGHTTYPE dltType
;
469 D3DCOLORVALUE dcvDiffuse
;
470 D3DCOLORVALUE dcvSpecular
;
471 D3DCOLORVALUE dcvAmbient
;
472 D3DVECTOR dvPosition
;
473 D3DVECTOR dvDirection
;
476 D3DVALUE dvAttenuation0
;
477 D3DVALUE dvAttenuation1
;
478 D3DVALUE dvAttenuation2
;
481 } D3DLIGHT7
, *LPD3DLIGHT7
;
483 #define D3DLIGHT_ACTIVE 0x00000001
484 #define D3DLIGHT_NO_SPECULAR 0x00000002
485 #define D3DLIGHT_ALL (D3DLIGHT_ACTIVE | D3DLIGHT_NO_SPECULAR) /* 0x3 */
487 #define D3DLIGHT_RANGE_MAX ((float)sqrt(FLT_MAX))
489 typedef struct _D3DLIGHT2
{
491 D3DLIGHTTYPE dltType
;
492 D3DCOLORVALUE dcvColor
;
493 D3DVECTOR dvPosition
;
494 D3DVECTOR dvDirection
;
497 D3DVALUE dvAttenuation0
;
498 D3DVALUE dvAttenuation1
;
499 D3DVALUE dvAttenuation2
;
503 } D3DLIGHT2
, *LPD3DLIGHT2
;
505 typedef struct _D3DLIGHTDATA
{
507 LPD3DLIGHTINGELEMENT lpIn
;
511 } D3DLIGHTDATA
, *LPD3DLIGHTDATA
;
513 #define D3DCOLOR_MONO 1
514 #define D3DCOLOR_RGB 2
516 typedef DWORD D3DCOLORMODEL
;
519 #define D3DCLEAR_TARGET 0x00000001
520 #define D3DCLEAR_ZBUFFER 0x00000002
521 #define D3DCLEAR_STENCIL 0x00000004
523 typedef enum _D3DOPCODE
{
527 D3DOP_MATRIXLOAD
= 4,
528 D3DOP_MATRIXMULTIPLY
= 5,
529 D3DOP_STATETRANSFORM
= 6,
530 D3DOP_STATELIGHT
= 7,
531 D3DOP_STATERENDER
= 8,
532 D3DOP_PROCESSVERTICES
= 9,
533 D3DOP_TEXTURELOAD
= 10,
535 D3DOP_BRANCHFORWARD
= 12,
537 D3DOP_SETSTATUS
= 14,
539 D3DOP_FORCE_DWORD
= 0x7fffffff
542 typedef struct _D3DINSTRUCTION
{
546 } D3DINSTRUCTION
, *LPD3DINSTRUCTION
;
548 typedef struct _D3DTEXTURELOAD
{
549 D3DTEXTUREHANDLE hDestTexture
;
550 D3DTEXTUREHANDLE hSrcTexture
;
551 } D3DTEXTURELOAD
, *LPD3DTEXTURELOAD
;
553 typedef struct _D3DPICKRECORD
{
558 } D3DPICKRECORD
, *LPD3DPICKRECORD
;
562 D3DSHADE_GOURAUD
= 2,
564 D3DSHADE_FORCE_DWORD
= 0x7fffffff
569 D3DFILL_WIREFRAME
= 2,
571 D3DFILL_FORCE_DWORD
= 0x7fffffff
574 typedef struct _D3DLINEPATTERN
{
580 D3DFILTER_NEAREST
= 1,
581 D3DFILTER_LINEAR
= 2,
582 D3DFILTER_MIPNEAREST
= 3,
583 D3DFILTER_MIPLINEAR
= 4,
584 D3DFILTER_LINEARMIPNEAREST
= 5,
585 D3DFILTER_LINEARMIPLINEAR
= 6,
586 D3DFILTER_FORCE_DWORD
= 0x7fffffff
592 D3DBLEND_SRCCOLOR
= 3,
593 D3DBLEND_INVSRCCOLOR
= 4,
594 D3DBLEND_SRCALPHA
= 5,
595 D3DBLEND_INVSRCALPHA
= 6,
596 D3DBLEND_DESTALPHA
= 7,
597 D3DBLEND_INVDESTALPHA
= 8,
598 D3DBLEND_DESTCOLOR
= 9,
599 D3DBLEND_INVDESTCOLOR
= 10,
600 D3DBLEND_SRCALPHASAT
= 11,
601 D3DBLEND_BOTHSRCALPHA
= 12,
602 D3DBLEND_BOTHINVSRCALPHA
= 13,
603 D3DBLEND_FORCE_DWORD
= 0x7fffffff
608 D3DTBLEND_MODULATE
= 2,
609 D3DTBLEND_DECALALPHA
= 3,
610 D3DTBLEND_MODULATEALPHA
= 4,
611 D3DTBLEND_DECALMASK
= 5,
612 D3DTBLEND_MODULATEMASK
= 6,
615 D3DTBLEND_FORCE_DWORD
= 0x7fffffff
618 typedef enum _D3DTEXTUREADDRESS
{
619 D3DTADDRESS_WRAP
= 1,
620 D3DTADDRESS_MIRROR
= 2,
621 D3DTADDRESS_CLAMP
= 3,
622 D3DTADDRESS_BORDER
= 4,
623 D3DTADDRESS_FORCE_DWORD
= 0x7fffffff
630 D3DCULL_FORCE_DWORD
= 0x7fffffff
637 D3DCMP_LESSEQUAL
= 4,
640 D3DCMP_GREATEREQUAL
= 7,
642 D3DCMP_FORCE_DWORD
= 0x7fffffff
645 typedef enum _D3DSTENCILOP
{
646 D3DSTENCILOP_KEEP
= 1,
647 D3DSTENCILOP_ZERO
= 2,
648 D3DSTENCILOP_REPLACE
= 3,
649 D3DSTENCILOP_INCRSAT
= 4,
650 D3DSTENCILOP_DECRSAT
= 5,
651 D3DSTENCILOP_INVERT
= 6,
652 D3DSTENCILOP_INCR
= 7,
653 D3DSTENCILOP_DECR
= 8,
654 D3DSTENCILOP_FORCE_DWORD
= 0x7fffffff
657 typedef enum _D3DFOGMODE
{
662 D3DFOG_FORCE_DWORD
= 0x7fffffff
665 typedef enum _D3DZBUFFERTYPE
{
669 D3DZB_FORCE_DWORD
= 0x7fffffff
672 typedef enum _D3DANTIALIASMODE
{
673 D3DANTIALIAS_NONE
= 0,
674 D3DANTIALIAS_SORTDEPENDENT
= 1,
675 D3DANTIALIAS_SORTINDEPENDENT
= 2,
676 D3DANTIALIAS_FORCE_DWORD
= 0x7fffffff
683 D3DVT_FORCE_DWORD
= 0x7fffffff
690 D3DPT_TRIANGLELIST
= 4,
691 D3DPT_TRIANGLESTRIP
= 5,
692 D3DPT_TRIANGLEFAN
= 6,
693 D3DPT_FORCE_DWORD
= 0x7fffffff
696 #define D3DSTATE_OVERRIDE_BIAS 256
698 #define D3DSTATE_OVERRIDE(type) (D3DRENDERSTATETYPE)(((DWORD) (type) + D3DSTATE_OVERRIDE_BIAS))
700 typedef enum _D3DTRANSFORMSTATETYPE
{
701 D3DTRANSFORMSTATE_WORLD
= 1,
702 D3DTRANSFORMSTATE_VIEW
= 2,
703 D3DTRANSFORMSTATE_PROJECTION
= 3,
704 D3DTRANSFORMSTATE_WORLD1
= 4,
705 D3DTRANSFORMSTATE_WORLD2
= 5,
706 D3DTRANSFORMSTATE_WORLD3
= 6,
707 D3DTRANSFORMSTATE_TEXTURE0
= 16,
708 D3DTRANSFORMSTATE_TEXTURE1
= 17,
709 D3DTRANSFORMSTATE_TEXTURE2
= 18,
710 D3DTRANSFORMSTATE_TEXTURE3
= 19,
711 D3DTRANSFORMSTATE_TEXTURE4
= 20,
712 D3DTRANSFORMSTATE_TEXTURE5
= 21,
713 D3DTRANSFORMSTATE_TEXTURE6
= 22,
714 D3DTRANSFORMSTATE_TEXTURE7
= 23,
715 D3DTRANSFORMSTATE_FORCE_DWORD
= 0x7fffffff
716 } D3DTRANSFORMSTATETYPE
;
719 D3DLIGHTSTATE_MATERIAL
= 1,
720 D3DLIGHTSTATE_AMBIENT
= 2,
721 D3DLIGHTSTATE_COLORMODEL
= 3,
722 D3DLIGHTSTATE_FOGMODE
= 4,
723 D3DLIGHTSTATE_FOGSTART
= 5,
724 D3DLIGHTSTATE_FOGEND
= 6,
725 D3DLIGHTSTATE_FOGDENSITY
= 7,
726 D3DLIGHTSTATE_COLORVERTEX
= 8,
727 D3DLIGHTSTATE_FORCE_DWORD
= 0x7fffffff
731 D3DRENDERSTATE_TEXTUREHANDLE
= 1,
732 D3DRENDERSTATE_ANTIALIAS
= 2,
733 D3DRENDERSTATE_TEXTUREADDRESS
= 3,
734 D3DRENDERSTATE_TEXTUREPERSPECTIVE
= 4,
735 D3DRENDERSTATE_WRAPU
= 5,
736 D3DRENDERSTATE_WRAPV
= 6,
737 D3DRENDERSTATE_ZENABLE
= 7,
738 D3DRENDERSTATE_FILLMODE
= 8,
739 D3DRENDERSTATE_SHADEMODE
= 9,
740 D3DRENDERSTATE_LINEPATTERN
= 10,
741 D3DRENDERSTATE_MONOENABLE
= 11,
742 D3DRENDERSTATE_ROP2
= 12,
743 D3DRENDERSTATE_PLANEMASK
= 13,
744 D3DRENDERSTATE_ZWRITEENABLE
= 14,
745 D3DRENDERSTATE_ALPHATESTENABLE
= 15,
746 D3DRENDERSTATE_LASTPIXEL
= 16,
747 D3DRENDERSTATE_TEXTUREMAG
= 17,
748 D3DRENDERSTATE_TEXTUREMIN
= 18,
749 D3DRENDERSTATE_SRCBLEND
= 19,
750 D3DRENDERSTATE_DESTBLEND
= 20,
751 D3DRENDERSTATE_TEXTUREMAPBLEND
= 21,
752 D3DRENDERSTATE_CULLMODE
= 22,
753 D3DRENDERSTATE_ZFUNC
= 23,
754 D3DRENDERSTATE_ALPHAREF
= 24,
755 D3DRENDERSTATE_ALPHAFUNC
= 25,
756 D3DRENDERSTATE_DITHERENABLE
= 26,
757 D3DRENDERSTATE_ALPHABLENDENABLE
= 27,
758 D3DRENDERSTATE_FOGENABLE
= 28,
759 D3DRENDERSTATE_SPECULARENABLE
= 29,
760 D3DRENDERSTATE_ZVISIBLE
= 30,
761 D3DRENDERSTATE_SUBPIXEL
= 31,
762 D3DRENDERSTATE_SUBPIXELX
= 32,
763 D3DRENDERSTATE_STIPPLEDALPHA
= 33,
764 D3DRENDERSTATE_FOGCOLOR
= 34,
765 D3DRENDERSTATE_FOGTABLEMODE
= 35,
766 D3DRENDERSTATE_FOGTABLESTART
= 36,
767 D3DRENDERSTATE_FOGTABLEEND
= 37,
768 D3DRENDERSTATE_FOGTABLEDENSITY
= 38,
769 D3DRENDERSTATE_STIPPLEENABLE
= 39,
770 D3DRENDERSTATE_EDGEANTIALIAS
= 40,
771 D3DRENDERSTATE_COLORKEYENABLE
= 41,
772 D3DRENDERSTATE_BORDERCOLOR
= 43,
773 D3DRENDERSTATE_TEXTUREADDRESSU
= 44,
774 D3DRENDERSTATE_TEXTUREADDRESSV
= 45,
775 D3DRENDERSTATE_MIPMAPLODBIAS
= 46,
776 D3DRENDERSTATE_ZBIAS
= 47,
777 D3DRENDERSTATE_RANGEFOGENABLE
= 48,
778 D3DRENDERSTATE_ANISOTROPY
= 49,
779 D3DRENDERSTATE_FLUSHBATCH
= 50,
781 D3DRENDERSTATE_STENCILENABLE
= 52,
782 D3DRENDERSTATE_STENCILFAIL
= 53,
783 D3DRENDERSTATE_STENCILZFAIL
= 54,
784 D3DRENDERSTATE_STENCILPASS
= 55,
785 D3DRENDERSTATE_STENCILFUNC
= 56,
786 D3DRENDERSTATE_STENCILREF
= 57,
787 D3DRENDERSTATE_STENCILMASK
= 58,
788 D3DRENDERSTATE_STENCILWRITEMASK
= 59,
789 D3DRENDERSTATE_TEXTUREFACTOR
= 60,
791 D3DRENDERSTATE_STIPPLEPATTERN00
= 64,
792 D3DRENDERSTATE_STIPPLEPATTERN01
= 65,
793 D3DRENDERSTATE_STIPPLEPATTERN02
= 66,
794 D3DRENDERSTATE_STIPPLEPATTERN03
= 67,
795 D3DRENDERSTATE_STIPPLEPATTERN04
= 68,
796 D3DRENDERSTATE_STIPPLEPATTERN05
= 69,
797 D3DRENDERSTATE_STIPPLEPATTERN06
= 70,
798 D3DRENDERSTATE_STIPPLEPATTERN07
= 71,
799 D3DRENDERSTATE_STIPPLEPATTERN08
= 72,
800 D3DRENDERSTATE_STIPPLEPATTERN09
= 73,
801 D3DRENDERSTATE_STIPPLEPATTERN10
= 74,
802 D3DRENDERSTATE_STIPPLEPATTERN11
= 75,
803 D3DRENDERSTATE_STIPPLEPATTERN12
= 76,
804 D3DRENDERSTATE_STIPPLEPATTERN13
= 77,
805 D3DRENDERSTATE_STIPPLEPATTERN14
= 78,
806 D3DRENDERSTATE_STIPPLEPATTERN15
= 79,
807 D3DRENDERSTATE_STIPPLEPATTERN16
= 80,
808 D3DRENDERSTATE_STIPPLEPATTERN17
= 81,
809 D3DRENDERSTATE_STIPPLEPATTERN18
= 82,
810 D3DRENDERSTATE_STIPPLEPATTERN19
= 83,
811 D3DRENDERSTATE_STIPPLEPATTERN20
= 84,
812 D3DRENDERSTATE_STIPPLEPATTERN21
= 85,
813 D3DRENDERSTATE_STIPPLEPATTERN22
= 86,
814 D3DRENDERSTATE_STIPPLEPATTERN23
= 87,
815 D3DRENDERSTATE_STIPPLEPATTERN24
= 88,
816 D3DRENDERSTATE_STIPPLEPATTERN25
= 89,
817 D3DRENDERSTATE_STIPPLEPATTERN26
= 90,
818 D3DRENDERSTATE_STIPPLEPATTERN27
= 91,
819 D3DRENDERSTATE_STIPPLEPATTERN28
= 92,
820 D3DRENDERSTATE_STIPPLEPATTERN29
= 93,
821 D3DRENDERSTATE_STIPPLEPATTERN30
= 94,
822 D3DRENDERSTATE_STIPPLEPATTERN31
= 95,
824 D3DRENDERSTATE_WRAP0
= 128,
825 D3DRENDERSTATE_WRAP1
= 129,
826 D3DRENDERSTATE_WRAP2
= 130,
827 D3DRENDERSTATE_WRAP3
= 131,
828 D3DRENDERSTATE_WRAP4
= 132,
829 D3DRENDERSTATE_WRAP5
= 133,
830 D3DRENDERSTATE_WRAP6
= 134,
831 D3DRENDERSTATE_WRAP7
= 135,
832 D3DRENDERSTATE_CLIPPING
= 136,
833 D3DRENDERSTATE_LIGHTING
= 137,
834 D3DRENDERSTATE_EXTENTS
= 138,
835 D3DRENDERSTATE_AMBIENT
= 139,
836 D3DRENDERSTATE_FOGVERTEXMODE
= 140,
837 D3DRENDERSTATE_COLORVERTEX
= 141,
838 D3DRENDERSTATE_LOCALVIEWER
= 142,
839 D3DRENDERSTATE_NORMALIZENORMALS
= 143,
840 D3DRENDERSTATE_COLORKEYBLENDENABLE
= 144,
841 D3DRENDERSTATE_DIFFUSEMATERIALSOURCE
= 145,
842 D3DRENDERSTATE_SPECULARMATERIALSOURCE
= 146,
843 D3DRENDERSTATE_AMBIENTMATERIALSOURCE
= 147,
844 D3DRENDERSTATE_EMISSIVEMATERIALSOURCE
= 148,
845 D3DRENDERSTATE_VERTEXBLEND
= 151,
846 D3DRENDERSTATE_CLIPPLANEENABLE
= 152,
848 D3DRENDERSTATE_FORCE_DWORD
= 0x7fffffff
850 /* FIXME: We have some retired values that are being reused for DirectX 7 */
851 } D3DRENDERSTATETYPE
;
853 typedef enum _D3DMATERIALCOLORSOURCE
858 D3DMCS_FORCE_DWORD
= 0x7fffffff
859 } D3DMATERIALCOLORSOURCE
;
861 #define D3DRENDERSTATE_BLENDENABLE D3DRENDERSTATE_ALPHABLENDENABLE
862 #define D3DRENDERSTATE_WRAPBIAS 128UL
863 #define D3DWRAP_U 0x00000001L
864 #define D3DWRAP_V 0x00000002L
866 #define D3DWRAPCOORD_0 0x00000001L
867 #define D3DWRAPCOORD_1 0x00000002L
868 #define D3DWRAPCOORD_2 0x00000004L
869 #define D3DWRAPCOORD_3 0x00000008L
871 #define D3DRENDERSTATE_STIPPLEPATTERN(y) (D3DRENDERSTATE_STIPPLEPATTERN00 + (y))
873 typedef struct _D3DSTATE
{
875 D3DTRANSFORMSTATETYPE dtstTransformStateType
;
876 D3DLIGHTSTATETYPE dlstLightStateType
;
877 D3DRENDERSTATETYPE drstRenderStateType
;
883 } D3DSTATE
, *LPD3DSTATE
;
885 typedef struct _D3DMATRIXLOAD
{
886 D3DMATRIXHANDLE hDestMatrix
;
887 D3DMATRIXHANDLE hSrcMatrix
;
888 } D3DMATRIXLOAD
, *LPD3DMATRIXLOAD
;
890 typedef struct _D3DMATRIXMULTIPLY
{
891 D3DMATRIXHANDLE hDestMatrix
;
892 D3DMATRIXHANDLE hSrcMatrix1
;
893 D3DMATRIXHANDLE hSrcMatrix2
;
894 } D3DMATRIXMULTIPLY
, *LPD3DMATRIXMULTIPLY
;
896 typedef struct _D3DPROCESSVERTICES
{
902 } D3DPROCESSVERTICES
, *LPD3DPROCESSVERTICES
;
904 #define D3DPROCESSVERTICES_TRANSFORMLIGHT 0x00000000L
905 #define D3DPROCESSVERTICES_TRANSFORM 0x00000001L
906 #define D3DPROCESSVERTICES_COPY 0x00000002L
907 #define D3DPROCESSVERTICES_OPMASK 0x00000007L
909 #define D3DPROCESSVERTICES_UPDATEEXTENTS 0x00000008L
910 #define D3DPROCESSVERTICES_NOCOLOR 0x00000010L
912 typedef enum _D3DTEXTURESTAGESTATETYPE
915 D3DTSS_COLORARG1
= 2,
916 D3DTSS_COLORARG2
= 3,
918 D3DTSS_ALPHAARG1
= 5,
919 D3DTSS_ALPHAARG2
= 6,
920 D3DTSS_BUMPENVMAT00
= 7,
921 D3DTSS_BUMPENVMAT01
= 8,
922 D3DTSS_BUMPENVMAT10
= 9,
923 D3DTSS_BUMPENVMAT11
= 10,
924 D3DTSS_TEXCOORDINDEX
= 11,
926 D3DTSS_ADDRESSU
= 13,
927 D3DTSS_ADDRESSV
= 14,
928 D3DTSS_BORDERCOLOR
= 15,
929 D3DTSS_MAGFILTER
= 16,
930 D3DTSS_MINFILTER
= 17,
931 D3DTSS_MIPFILTER
= 18,
932 D3DTSS_MIPMAPLODBIAS
= 19,
933 D3DTSS_MAXMIPLEVEL
= 20,
934 D3DTSS_MAXANISOTROPY
= 21,
935 D3DTSS_BUMPENVLSCALE
= 22,
936 D3DTSS_BUMPENVLOFFSET
= 23,
937 D3DTSS_TEXTURETRANSFORMFLAGS
= 24,
938 D3DTSS_FORCE_DWORD
= 0x7fffffff
939 } D3DTEXTURESTAGESTATETYPE
;
941 #define D3DTSS_TCI_PASSTHRU 0x00000000
942 #define D3DTSS_TCI_CAMERASPACENORMAL 0x00010000
943 #define D3DTSS_TCI_CAMERASPACEPOSITION 0x00020000
944 #define D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR 0x00030000
946 typedef enum _D3DTEXTUREOP
949 D3DTOP_SELECTARG1
= 2,
950 D3DTOP_SELECTARG2
= 3,
953 D3DTOP_MODULATE2X
= 5,
954 D3DTOP_MODULATE4X
= 6,
957 D3DTOP_ADDSIGNED
= 8,
958 D3DTOP_ADDSIGNED2X
= 9,
959 D3DTOP_SUBTRACT
= 10,
960 D3DTOP_ADDSMOOTH
= 11,
962 D3DTOP_BLENDDIFFUSEALPHA
= 12,
963 D3DTOP_BLENDTEXTUREALPHA
= 13,
964 D3DTOP_BLENDFACTORALPHA
= 14,
965 D3DTOP_BLENDTEXTUREALPHAPM
= 15,
966 D3DTOP_BLENDCURRENTALPHA
= 16,
968 D3DTOP_PREMODULATE
= 17,
969 D3DTOP_MODULATEALPHA_ADDCOLOR
= 18,
970 D3DTOP_MODULATECOLOR_ADDALPHA
= 19,
971 D3DTOP_MODULATEINVALPHA_ADDCOLOR
= 20,
972 D3DTOP_MODULATEINVCOLOR_ADDALPHA
= 21,
974 D3DTOP_BUMPENVMAP
= 22,
975 D3DTOP_BUMPENVMAPLUMINANCE
= 23,
976 D3DTOP_DOTPRODUCT3
= 24,
978 D3DTOP_FORCE_DWORD
= 0x7fffffff
981 #define D3DTA_SELECTMASK 0x0000000f
982 #define D3DTA_DIFFUSE 0x00000000
983 #define D3DTA_CURRENT 0x00000001
984 #define D3DTA_TEXTURE 0x00000002
985 #define D3DTA_TFACTOR 0x00000003
986 #define D3DTA_SPECULAR 0x00000004
987 #define D3DTA_COMPLEMENT 0x00000010
988 #define D3DTA_ALPHAREPLICATE 0x00000020
990 typedef enum _D3DTEXTUREMAGFILTER
994 D3DTFG_FLATCUBIC
= 3,
995 D3DTFG_GAUSSIANCUBIC
= 4,
996 D3DTFG_ANISOTROPIC
= 5,
997 D3DTFG_FORCE_DWORD
= 0x7fffffff
998 } D3DTEXTUREMAGFILTER
;
1000 typedef enum _D3DTEXTUREMINFILTER
1004 D3DTFN_ANISOTROPIC
= 3,
1005 D3DTFN_FORCE_DWORD
= 0x7fffffff
1006 } D3DTEXTUREMINFILTER
;
1008 typedef enum _D3DTEXTUREMIPFILTER
1013 D3DTFP_FORCE_DWORD
= 0x7fffffff
1014 } D3DTEXTUREMIPFILTER
;
1016 #define D3DTRIFLAG_START 0x00000000L
1017 #define D3DTRIFLAG_STARTFLAT(len) (len)
1018 #define D3DTRIFLAG_ODD 0x0000001eL
1019 #define D3DTRIFLAG_EVEN 0x0000001fL
1021 #define D3DTRIFLAG_EDGEENABLE1 0x00000100L
1022 #define D3DTRIFLAG_EDGEENABLE2 0x00000200L
1023 #define D3DTRIFLAG_EDGEENABLE3 0x00000400L
1024 #define D3DTRIFLAG_EDGEENABLETRIANGLE \
1025 (D3DTRIFLAG_EDGEENABLE1 | D3DTRIFLAG_EDGEENABLE2 | D3DTRIFLAG_EDGEENABLE3)
1027 typedef struct _D3DTRIANGLE
{
1041 } D3DTRIANGLE
, *LPD3DTRIANGLE
;
1043 typedef struct _D3DLINE
{
1052 } D3DLINE
, *LPD3DLINE
;
1054 typedef struct _D3DSPAN
{
1057 } D3DSPAN
, *LPD3DSPAN
;
1059 typedef struct _D3DPOINT
{
1062 } D3DPOINT
, *LPD3DPOINT
;
1064 typedef struct _D3DBRANCH
{
1069 } D3DBRANCH
, *LPD3DBRANCH
;
1071 typedef struct _D3DSTATUS
{
1075 } D3DSTATUS
, *LPD3DSTATUS
;
1077 #define D3DSETSTATUS_STATUS 0x00000001L
1078 #define D3DSETSTATUS_EXTENTS 0x00000002L
1079 #define D3DSETSTATUS_ALL (D3DSETSTATUS_STATUS | D3DSETSTATUS_EXTENTS)
1081 typedef struct _D3DCLIPSTATUS
{
1087 } D3DCLIPSTATUS
, *LPD3DCLIPSTATUS
;
1089 #define D3DCLIPSTATUS_STATUS 0x00000001L
1090 #define D3DCLIPSTATUS_EXTENTS2 0x00000002L
1091 #define D3DCLIPSTATUS_EXTENTS3 0x00000004L
1095 DWORD dwTrianglesDrawn
;
1097 DWORD dwPointsDrawn
;
1099 DWORD dwVerticesProcessed
;
1100 } D3DSTATS
, *LPD3DSTATS
;
1102 #define D3DEXECUTE_CLIPPED 0x00000001l
1103 #define D3DEXECUTE_UNCLIPPED 0x00000002l
1105 typedef struct _D3DEXECUTEDATA
{
1107 DWORD dwVertexOffset
;
1108 DWORD dwVertexCount
;
1109 DWORD dwInstructionOffset
;
1110 DWORD dwInstructionLength
;
1111 DWORD dwHVertexOffset
;
1113 } D3DEXECUTEDATA
, *LPD3DEXECUTEDATA
;
1115 #define D3DPAL_FREE 0x00
1116 #define D3DPAL_READONLY 0x40
1117 #define D3DPAL_RESERVED 0x80
1119 typedef struct _D3DVERTEXBUFFERDESC
{
1123 DWORD dwNumVertices
;
1124 } D3DVERTEXBUFFERDESC
, *LPD3DVERTEXBUFFERDESC
;
1126 #define D3DVBCAPS_SYSTEMMEMORY 0x00000800l
1127 #define D3DVBCAPS_WRITEONLY 0x00010000l
1128 #define D3DVBCAPS_OPTIMIZED 0x80000000l
1129 #define D3DVBCAPS_DONOTCLIP 0x00000001l
1131 #define D3DVOP_LIGHT (1 << 10)
1132 #define D3DVOP_TRANSFORM (1 << 0)
1133 #define D3DVOP_CLIP (1 << 2)
1134 #define D3DVOP_EXTENTS (1 << 3)
1136 #define D3DMAXNUMVERTICES ((1<<16) - 1)
1138 #define D3DMAXNUMPRIMITIVES ((1<<16) - 1)
1140 #define D3DPV_DONOTCOPYDATA (1 << 0)
1142 #define D3DFVF_RESERVED0 0x001
1143 #define D3DFVF_POSITION_MASK 0x00E
1144 #define D3DFVF_XYZ 0x002
1145 #define D3DFVF_XYZRHW 0x004
1146 #define D3DFVF_XYZB1 0x006
1147 #define D3DFVF_XYZB2 0x008
1148 #define D3DFVF_XYZB3 0x00a
1149 #define D3DFVF_XYZB4 0x00c
1150 #define D3DFVF_XYZB5 0x00e
1152 #define D3DFVF_NORMAL 0x010
1153 #define D3DFVF_RESERVED1 0x020
1154 #define D3DFVF_DIFFUSE 0x040
1155 #define D3DFVF_SPECULAR 0x080
1156 #define D3DFVF_TEXCOUNT_MASK 0xf00
1157 #define D3DFVF_TEXCOUNT_SHIFT 8
1158 #define D3DFVF_TEX0 0x000
1159 #define D3DFVF_TEX1 0x100
1160 #define D3DFVF_TEX2 0x200
1161 #define D3DFVF_TEX3 0x300
1162 #define D3DFVF_TEX4 0x400
1163 #define D3DFVF_TEX5 0x500
1164 #define D3DFVF_TEX6 0x600
1165 #define D3DFVF_TEX7 0x700
1166 #define D3DFVF_TEX8 0x800
1168 #define D3DFVF_RESERVED2 0xf000
1170 #define D3DFVF_VERTEX ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 )
1171 #define D3DFVF_LVERTEX ( D3DFVF_XYZ | D3DFVF_RESERVED1 | D3DFVF_DIFFUSE | \
1172 D3DFVF_SPECULAR | D3DFVF_TEX1 )
1173 #define D3DFVF_TLVERTEX ( D3DFVF_XYZRHW | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | \
1176 typedef struct _D3DDP_PTRSTRIDE
{
1181 #define D3DDP_MAXTEXCOORD 8
1183 typedef struct _D3DDRAWPRIMITIVESTRIDEDDATA
{
1184 D3DDP_PTRSTRIDE position
;
1185 D3DDP_PTRSTRIDE normal
;
1186 D3DDP_PTRSTRIDE diffuse
;
1187 D3DDP_PTRSTRIDE specular
;
1188 D3DDP_PTRSTRIDE textureCoords
[D3DDP_MAXTEXCOORD
];
1189 } D3DDRAWPRIMITIVESTRIDEDDATA
,*LPD3DDRAWPRIMITIVESTRIDEDDATA
;
1191 #define D3DVIS_INSIDE_FRUSTUM 0
1192 #define D3DVIS_INTERSECT_FRUSTUM 1
1193 #define D3DVIS_OUTSIDE_FRUSTUM 2
1194 #define D3DVIS_INSIDE_LEFT 0
1195 #define D3DVIS_INTERSECT_LEFT (1 << 2)
1196 #define D3DVIS_OUTSIDE_LEFT (2 << 2)
1197 #define D3DVIS_INSIDE_RIGHT 0
1198 #define D3DVIS_INTERSECT_RIGHT (1 << 4)
1199 #define D3DVIS_OUTSIDE_RIGHT (2 << 4)
1200 #define D3DVIS_INSIDE_TOP 0
1201 #define D3DVIS_INTERSECT_TOP (1 << 6)
1202 #define D3DVIS_OUTSIDE_TOP (2 << 6)
1203 #define D3DVIS_INSIDE_BOTTOM 0
1204 #define D3DVIS_INTERSECT_BOTTOM (1 << 8)
1205 #define D3DVIS_OUTSIDE_BOTTOM (2 << 8)
1206 #define D3DVIS_INSIDE_NEAR 0
1207 #define D3DVIS_INTERSECT_NEAR (1 << 10)
1208 #define D3DVIS_OUTSIDE_NEAR (2 << 10)
1209 #define D3DVIS_INSIDE_FAR 0
1210 #define D3DVIS_INTERSECT_FAR (1 << 12)
1211 #define D3DVIS_OUTSIDE_FAR (2 << 12)
1213 #define D3DVIS_MASK_FRUSTUM (3 << 0)
1214 #define D3DVIS_MASK_LEFT (3 << 2)
1215 #define D3DVIS_MASK_RIGHT (3 << 4)
1216 #define D3DVIS_MASK_TOP (3 << 6)
1217 #define D3DVIS_MASK_BOTTOM (3 << 8)
1218 #define D3DVIS_MASK_NEAR (3 << 10)
1219 #define D3DVIS_MASK_FAR (3 << 12)
1221 #define D3DDEVINFOID_TEXTUREMANAGER 1
1222 #define D3DDEVINFOID_D3DTEXTUREMANAGER 2
1223 #define D3DDEVINFOID_TEXTURING 3
1225 typedef enum _D3DSTATEBLOCKTYPE
1228 D3DSBT_PIXELSTATE
= 2,
1229 D3DSBT_VERTEXSTATE
= 3,
1230 D3DSBT_FORCE_DWORD
= 0xffffffff
1231 } D3DSTATEBLOCKTYPE
;
1233 typedef enum _D3DVERTEXBLENDFLAGS
1235 D3DVBLEND_DISABLE
= 0,
1236 D3DVBLEND_1WEIGHT
= 1,
1237 D3DVBLEND_2WEIGHTS
= 2,
1238 D3DVBLEND_3WEIGHTS
= 3,
1239 } D3DVERTEXBLENDFLAGS
;
1241 typedef enum _D3DTEXTURETRANSFORMFLAGS
{
1242 D3DTTFF_DISABLE
= 0,
1247 D3DTTFF_PROJECTED
= 256,
1248 D3DTTFF_FORCE_DWORD
= 0x7fffffff
1249 } D3DTEXTURETRANSFORMFLAGS
;
1251 #define D3DFVF_TEXTUREFORMAT2 0
1252 #define D3DFVF_TEXTUREFORMAT1 3
1253 #define D3DFVF_TEXTUREFORMAT3 1
1254 #define D3DFVF_TEXTUREFORMAT4 2
1256 #define D3DFVF_TEXCOORDSIZE3(CoordIndex) (D3DFVF_TEXTUREFORMAT3 << (CoordIndex*2 + 16))
1257 #define D3DFVF_TEXCOORDSIZE2(CoordIndex) (D3DFVF_TEXTUREFORMAT2)
1258 #define D3DFVF_TEXCOORDSIZE4(CoordIndex) (D3DFVF_TEXTUREFORMAT4 << (CoordIndex*2 + 16))
1259 #define D3DFVF_TEXCOORDSIZE1(CoordIndex) (D3DFVF_TEXTUREFORMAT1 << (CoordIndex*2 + 16))