DXVIEW.C
资源名称:MSDN_VC98.zip [点击查看]
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:135k
源码类别:
Windows编程
开发平台:
Visual C++
- /****************************************************************************
- Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
- PROGRAM: dxview.c
- PURPOSE: DirectX Device Viewer
- FUNCTIONS:
- COMMENTS:
- ****************************************************************************/
- #include "dxview.h"
- #pragma comment(lib, "dxguid")
- #pragma comment(lib, "ddraw")
- #pragma comment(lib, "dsound")
- #pragma comment(lib, "dplayx")
- #pragma comment(lib, "dinput")
- #pragma comment(lib, "comctl32")
- /****************************************************************************
- ***************************************************************************/
- HINSTANCE g_hInstance;
- char g_szAppName[] = "DXView";
- char g_szClassName[] = "DXView";
- char g_szTitle[] = "DirectX Device Viewer";
- HWND g_hwndMain;
- HWND g_hwndLV; // List view
- HWND g_hwndTV; // Tree view
- HIMAGELIST g_hImageList;
- HFONT g_hFont;
- int g_xPaneSplit;
- int g_xHalfSplitWidth;
- BOOL g_bSplitMove;
- DWORD g_dwViewState;
- DWORD g_tmAveCharWidth;
- extern BOOL g_PrintToFile;
- UINT g_idTimer;
- LPLOCALAPP g_lpLocalApp;
- HINSTANCE g_hDSoundLib = NULL;
- typedef HRESULT (WINAPI * PFN_DSCREATE)(LPGUID lpguid, LPDIRECTSOUND * ppDS, IUnknown FAR * pUnkOuter);
- typedef BOOL (WINAPI * PFN_DSENUMERATE)(LPDSENUMCALLBACK lpDSEnumCallback, LPVOID lpContext);
- typedef HRESULT (WINAPI * PFN_DSCCREATE)(LPGUID lpGUID, LPDIRECTSOUNDCAPTURE *lplpDSC,LPUNKNOWN pUnkOuter);
- typedef BOOL (WINAPI * PFN_DSCENUMERATE)(LPDSENUMCALLBACK lpDSEnumCallback,LPVOID lpContext);
- /****************************************************************************
- ***************************************************************************/
- IDirectDraw *lpDD; // DirectDraw object
- IDirectDraw2 *lpDD2; // DirectDraw object
- IDirect3D2 *lp3D; // Direct3D object
- GUID * ddid;
- IDirectSound *lpDS; // DirectSound object
- GUID * dsid;
- IDirectSoundCapture *lpDSC; // DirectSoundCapture object
- GUID * dscid;
- IDirectPlay3A *lpDP3A; // DirectPlay object
- GUID * dpid;
- /****************************************************************************
- ***************************************************************************/
- #define DDCAPDEF(name,val,flag) {name, FIELD_OFFSET(DDCAPS,val), flag}
- #define DDVALDEF(name,val) {name, FIELD_OFFSET(DDCAPS,val), 0}
- #define DDHEXDEF(name,val) {name, FIELD_OFFSET(DDCAPS,val), 0xFFFFFFFF}
- #define ROPDEF(name,dwRops,rop) DDCAPDEF(name,dwRops[((rop>>16)&0xFF)/32],(1<<((rop>>16)&0xFF)%32))
- #define DSCAPDEF(name,val,flag) {name, FIELD_OFFSET(DSCAPS,val), flag}
- #define DSVALDEF(name,val) {name, FIELD_OFFSET(DSCAPS,val), 0}
- #define DSCCAPDEF(name,val,flag) {name, FIELD_OFFSET(DSCCAPS,val), flag}
- #define DSCVALDEF(name,val) {name, FIELD_OFFSET(DSCCAPS,val), 0}
- #define DPCAPDEF(name,val,flag) {name, FIELD_OFFSET(DPCAPS,val), flag}
- #define DPHEXDEF(name,val) {name, FIELD_OFFSET(DPCAPS,val), 0xFFFFFFFF}
- #define DPVALDEF(name,val) {name, FIELD_OFFSET(DPCAPS,val), 0}
- #define D3CAPDEF(name,val,flag) {name, FIELD_OFFSET(D3DDEVICEDESC,val), flag}
- #define D3HEXDEF(name,val) {name, FIELD_OFFSET(D3DDEVICEDESC,val), 0xFFFFFFFF}
- #define D3VALDEF(name,val) {name, FIELD_OFFSET(D3DDEVICEDESC,val), 0}
- #define SURFCAPDEF(name,val,flag) {name, FIELD_OFFSET(DDSURFACEDESC,val), flag}
- #define SURFVALDEF(name,val) {name, FIELD_OFFSET(DDSURFACEDESC,val), 0}
- #define MAKEMODE(xres,yres,bpp) (((DWORD)xres << 20) | ((DWORD)yres << 8) | bpp)
- #define GETXRES(mode) (int)((mode >> 20) & 0x0FFF)
- #define GETYRES(mode) (int)((mode >> 8) & 0x0FFF)
- #define GETCRES(mode) (int)((mode >> 0) & 0x00FF)
- IDirectDraw * DDCreate(GUID *pid);
- BOOL PrintValueLine(char * szText, DWORD dwValue, PRINTCBINFO *lpInfo)
- {
- char szBuff[80];
- DWORD cchLen;
- int xName, xVal, yLine;
- // Calculate Name and Value column x offsets
- xName = (lpInfo->dwCurrIndent * DEF_TAB_SIZE * lpInfo->dwCharWidth);
- xVal = xName + (32 * lpInfo->dwCharWidth);
- yLine = (lpInfo->dwCurrLine * lpInfo->dwLineHeight);
- // Print name
- wsprintf (szBuff, szText);
- cchLen = _tcslen (szText);
- if (! PrintLine (xName, yLine, szBuff, cchLen, lpInfo))
- return FALSE;
- // Print value
- wsprintf (szBuff, "%d", dwValue);
- cchLen = _tcslen (szBuff);
- if (! PrintLine (xVal, yLine, szBuff, cchLen, lpInfo))
- return FALSE;
- // Advance to next line on page
- if (! PrintNextLine (lpInfo))
- return FALSE;
- return TRUE;
- }
- VOID VidMem(long lParam1, long foo2)
- {
- HRESULT ddrval;
- DWORD dwTotalMem;
- DWORD dwFreeMem;
- DDSCAPS DDSCaps;
- LVAddColumn(g_hwndLV, 0, "Type", 24);
- LVAddColumn(g_hwndLV, 1, "Total", 10);
- LVAddColumn(g_hwndLV, 2, "Free", 10);
- if (DDCreate((GUID*)lParam1))
- {
- IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw2,&lpDD2);
- DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- LVAddText(g_hwndLV, 0, "Video");
- LVAddText(g_hwndLV, 1, "%d", dwTotalMem);
- LVAddText(g_hwndLV, 2, "%d", dwFreeMem);
- DDSCaps.dwCaps = DDSCAPS_LOCALVIDMEM;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- LVAddText(g_hwndLV, 0, "Video (local)");
- LVAddText(g_hwndLV, 1, "%d", dwTotalMem);
- LVAddText(g_hwndLV, 2, "%d", dwFreeMem);
- DDSCaps.dwCaps = DDSCAPS_NONLOCALVIDMEM;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- LVAddText(g_hwndLV, 0, "Video (non-local)");
- LVAddText(g_hwndLV, 1, "%d", dwTotalMem);
- LVAddText(g_hwndLV, 2, "%d", dwFreeMem);
- DDSCaps.dwCaps = DDSCAPS_TEXTURE;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- LVAddText(g_hwndLV, 0, "Texture");
- LVAddText(g_hwndLV, 1, "%d", dwTotalMem);
- LVAddText(g_hwndLV, 2, "%d", dwFreeMem);
- }
- }
- BOOL VidMemPrint(long lParam1, long lParam2, PRINTCBINFO *lpInfo)
- {
- HRESULT ddrval;
- DWORD dwTotalMem;
- DWORD dwFreeMem;
- DDSCAPS DDSCaps;
- if (DDCreate((GUID*)lParam1))
- {
- IDirectDraw_QueryInterface(lpDD,&IID_IDirectDraw2,&lpDD2);
- DDSCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- PrintValueLine("TotalMem",dwTotalMem,lpInfo);
- PrintValueLine("FreeMem",dwFreeMem,lpInfo);
- DDSCaps.dwCaps = DDSCAPS_LOCALVIDMEM;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- PrintValueLine("TotalVideoMem",dwTotalMem,lpInfo);
- PrintValueLine("FreeVideoMem",dwFreeMem,lpInfo);
- DDSCaps.dwCaps = DDSCAPS_NONLOCALVIDMEM;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- PrintValueLine("TotalAGPMem",dwTotalMem,lpInfo);
- PrintValueLine("FreeAGPMem",dwFreeMem,lpInfo);
- DDSCaps.dwCaps = DDSCAPS_TEXTURE;
- ddrval = IDirectDraw2_GetAvailableVidMem(lpDD2, &DDSCaps, &dwTotalMem, &dwFreeMem );
- if(ddrval != DD_OK)
- {
- dwTotalMem = 0;
- dwFreeMem = 0;
- };
- PrintValueLine("TotalTextureMem",dwTotalMem,lpInfo);
- PrintValueLine("FreeTextureMem",dwFreeMem,lpInfo);
- }
- return TRUE;
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF OtherInfoDefs[] =
- {
- DDVALDEF("VidMemTotal", dwVidMemTotal),
- DDVALDEF("VidMemFree", dwVidMemFree),
- DDHEXDEF("AlphaBltConstBitDepths", dwAlphaBltConstBitDepths),
- DDCAPDEF(" 8", dwAlphaBltConstBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaBltConstBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaBltConstBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaBltConstBitDepths, DDBD_32),
- DDHEXDEF("AlphaBltPixelBitDepths", dwAlphaBltPixelBitDepths),
- DDCAPDEF(" 8", dwAlphaBltPixelBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaBltPixelBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaBltPixelBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaBltPixelBitDepths, DDBD_32),
- DDHEXDEF("AlphaBltSurfaceBitDepths", dwAlphaBltSurfaceBitDepths),
- DDCAPDEF(" 8", dwAlphaBltSurfaceBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaBltSurfaceBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaBltSurfaceBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaBltSurfaceBitDepths, DDBD_32),
- DDHEXDEF("AlphaOverlayConstBitDepths", dwAlphaOverlayConstBitDepths),
- DDCAPDEF(" 8", dwAlphaOverlayConstBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaOverlayConstBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaOverlayConstBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaOverlayConstBitDepths, DDBD_32),
- DDHEXDEF("AlphaOverlayPixelBitDepths", dwAlphaOverlayPixelBitDepths),
- DDCAPDEF(" 8", dwAlphaOverlayPixelBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaOverlayPixelBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaOverlayPixelBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaOverlayPixelBitDepths, DDBD_32),
- DDHEXDEF("AlphaOverlaySurfaceBitDepths", dwAlphaOverlaySurfaceBitDepths),
- DDCAPDEF(" 8", dwAlphaOverlaySurfaceBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwAlphaOverlaySurfaceBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwAlphaOverlaySurfaceBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwAlphaOverlaySurfaceBitDepths, DDBD_32),
- DDHEXDEF("ZBufferBitDepths", dwZBufferBitDepths),
- DDCAPDEF(" 8", dwZBufferBitDepths, DDBD_8),
- DDCAPDEF(" 16", dwZBufferBitDepths, DDBD_16),
- DDCAPDEF(" 24", dwZBufferBitDepths, DDBD_24),
- DDCAPDEF(" 32", dwZBufferBitDepths, DDBD_32),
- DDVALDEF("MaxVisibleOverlays", dwMaxVisibleOverlays),
- DDVALDEF("CurrVisibleOverlays", dwCurrVisibleOverlays),
- DDVALDEF("NumFourCCCodes", dwNumFourCCCodes),
- DDVALDEF("AlignBoundarySrc", dwAlignBoundarySrc),
- DDVALDEF("AlignSizeSrc", dwAlignSizeSrc),
- DDVALDEF("AlignBoundaryDest", dwAlignBoundaryDest),
- DDVALDEF("AlignSizeDest", dwAlignSizeDest),
- DDVALDEF("AlignStrideAlign", dwAlignStrideAlign),
- DDVALDEF("MinOverlayStretch", dwMinOverlayStretch),
- DDVALDEF("MaxOverlayStretch", dwMaxOverlayStretch),
- DDVALDEF("MinLiveVideoStretch", dwMinLiveVideoStretch),
- DDVALDEF("MaxLiveVideoStretch", dwMaxLiveVideoStretch),
- DDVALDEF("MinHwCodecStretch", dwMinHwCodecStretch),
- DDVALDEF("MaxHwCodecStretch", dwMaxHwCodecStretch),
- DDVALDEF("dwReserved1", dwReserved1),
- DDVALDEF("dwReserved2", dwReserved2),
- DDVALDEF("dwReserved3", dwReserved3),
- //DDHEXDEF("dwCaps", dwCaps),
- DDVALDEF("dwMaxVideoPorts", dwMaxVideoPorts),
- DDVALDEF("dwCurrVideoPorts", dwCurrVideoPorts),
- //DDVALDEF("dwSVBCaps2", dwSVBCaps2),
- { "", 0, 0 }
- };
- /****************************************************************************
- ***************************************************************************/
- #define GEN_CAPS(dwCaps)
- DDCAPDEF("3D", dwCaps, DDCAPS_3D),
- DDCAPDEF("ALIGNBOUNDARYDEST", dwCaps, DDCAPS_ALIGNBOUNDARYDEST),
- DDCAPDEF("ALIGNSIZEDEST", dwCaps, DDCAPS_ALIGNSIZEDEST),
- DDCAPDEF("ALIGNBOUNDARYSRC", dwCaps, DDCAPS_ALIGNBOUNDARYSRC),
- DDCAPDEF("ALIGNSIZESRC", dwCaps, DDCAPS_ALIGNSIZESRC),
- DDCAPDEF("ALIGNSTRIDE", dwCaps, DDCAPS_ALIGNSTRIDE),
- DDCAPDEF("GDI", dwCaps, DDCAPS_GDI),
- DDCAPDEF("OVERLAY", dwCaps, DDCAPS_OVERLAY),
- DDCAPDEF("OVERLAYCANTCLIP", dwCaps, DDCAPS_OVERLAYCANTCLIP),
- DDCAPDEF("OVERLAYFOURCC", dwCaps, DDCAPS_OVERLAYFOURCC),
- DDCAPDEF("OVERLAYSTRETCH", dwCaps, DDCAPS_OVERLAYSTRETCH),
- DDCAPDEF("PALETTE", dwCaps, DDCAPS_PALETTE),
- DDCAPDEF("PALETTEVSYNC", dwCaps, DDCAPS_PALETTEVSYNC),
- DDCAPDEF("READSCANLINE", dwCaps, DDCAPS_READSCANLINE),
- DDCAPDEF("STEREOVIEW", dwCaps, DDCAPS_STEREOVIEW),
- DDCAPDEF("VBI", dwCaps, DDCAPS_VBI),
- DDCAPDEF("ZOVERLAYS", dwCaps, DDCAPS_ZOVERLAYS),
- DDCAPDEF("NOHARDWARE", dwCaps, DDCAPS_NOHARDWARE),
- DDCAPDEF("BANKSWITCHED", dwCaps, DDCAPS_BANKSWITCHED),
- #define GEN_CAPS2(dwCaps2)
- DDCAPDEF("CERTIFIED", dwCaps2,DDCAPS2_CERTIFIED),
- DDCAPDEF("NO2DDURING3DSCENE", dwCaps2,DDCAPS2_NO2DDURING3DSCENE),
- DDCAPDEF("VIDEOPORT", dwCaps2,DDCAPS2_VIDEOPORT),
- DDCAPDEF("AUTOFLIPOVERLAY", dwCaps2,DDCAPS2_AUTOFLIPOVERLAY),
- DDCAPDEF("CANBOBINTERLEAVED", dwCaps2,DDCAPS2_CANBOBINTERLEAVED),
- DDCAPDEF("CANBOBNONINTERLEAVED", dwCaps2,DDCAPS2_CANBOBNONINTERLEAVED),
- DDCAPDEF("COLORCONTROLOVERLAY", dwCaps2,DDCAPS2_COLORCONTROLOVERLAY),
- DDCAPDEF("COLORCONTROLPRIMARY", dwCaps2,DDCAPS2_COLORCONTROLPRIMARY),
- DDCAPDEF("NONLOCALVIDMEM", dwCaps2,DDCAPS2_NONLOCALVIDMEM),
- DDCAPDEF("NONLOCALVIDMEMCAPS", dwCaps2,DDCAPS2_NONLOCALVIDMEMCAPS),
- DDCAPDEF("WIDESURFACES", dwCaps2,DDCAPS2_WIDESURFACES),
- DDCAPDEF("NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED),
- #define GEN_BLTCAPS(dwCaps)
- DDCAPDEF("BLT", dwCaps, DDCAPS_BLT),
- DDCAPDEF("BLTCOLORFILL", dwCaps, DDCAPS_BLTCOLORFILL),
- DDCAPDEF("BLTDEPTHFILL", dwCaps, DDCAPS_BLTDEPTHFILL),
- DDCAPDEF("BLTFOURCC", dwCaps, DDCAPS_BLTFOURCC),
- DDCAPDEF("BLTSTRETCH", dwCaps, DDCAPS_BLTSTRETCH),
- DDCAPDEF("BLTQUEUE", dwCaps, DDCAPS_BLTQUEUE),
- DDCAPDEF("COLORKEY", dwCaps, DDCAPS_COLORKEY),
- DDCAPDEF("ALPHA", dwCaps, DDCAPS_ALPHA),
- DDCAPDEF("CKEYHWASSIST", dwCaps, DDCAPS_COLORKEYHWASSIST),
- DDCAPDEF("CANCLIP", dwCaps, DDCAPS_CANCLIP),
- DDCAPDEF("CANCLIPSTRETCHED", dwCaps, DDCAPS_CANCLIPSTRETCHED),
- DDCAPDEF("CANBLTSYSMEM", dwCaps, DDCAPS_CANBLTSYSMEM),
- DDCAPDEF("ZBLTS", dwCaps, DDCAPS_ZBLTS),
- #define GEN_BLTCAPS2(dwCaps2)
- DDCAPDEF("CANDROPZ16BIT", dwCaps2,DDCAPS2_CANDROPZ16BIT),
- DDCAPDEF("NOPAGELOCKREQUIRED", dwCaps2,DDCAPS2_NOPAGELOCKREQUIRED),
- /****************************************************************************
- ***************************************************************************/
- CAPDEF GenCaps[] =
- {
- GEN_CAPS(dwCaps)
- GEN_CAPS2(dwCaps2)
- { "", 0, 0 }
- };
- //
- // NOTE GenCaps and CapsDefs are the same
- // because some are blt caps that apply to VRAM->VRAM blts and
- // some are "general" caps...
- //
- CAPDEF CapsDefs[] =
- {
- GEN_BLTCAPS(dwCaps)
- GEN_BLTCAPS2(dwCaps2)
- { "", 0, 0 }
- };
- CAPDEF SVBCapsDefs[] =
- {
- GEN_BLTCAPS(dwSVBCaps)
- GEN_BLTCAPS2(dwSVBCaps2)
- { "", 0, 0 }
- };
- CAPDEF VSBCapsDefs[] =
- {
- GEN_BLTCAPS(dwVSBCaps)
- // GEN_BLTCAPS2(dwVSBCaps2)
- { "", 0, 0 }
- };
- CAPDEF SSBCapsDefs[] =
- {
- GEN_BLTCAPS(dwSSBCaps)
- // GEN_BLTCAPS2(dwSSBCaps2)
- { "", 0, 0 }
- };
- CAPDEF NLVBCapsDefs[] =
- {
- GEN_BLTCAPS(dwNLVBCaps)
- GEN_BLTCAPS2(dwNLVBCaps2)
- { "", 0, 0 }
- };
- /****************************************************************************
- ***************************************************************************/
- #define GEN_CKCAPS(dwCKeyCaps)
- DDCAPDEF("DESTBLT", dwCKeyCaps, DDCKEYCAPS_DESTBLT),
- DDCAPDEF("DESTBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACE),
- DDCAPDEF("DESTBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTCLRSPACEYUV),
- DDCAPDEF("DESTBLTYUV", dwCKeyCaps, DDCKEYCAPS_DESTBLTYUV),
- DDCAPDEF("DESTOVERLAY", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAY),
- DDCAPDEF("DESTOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACE),
- DDCAPDEF("DESTOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV),
- DDCAPDEF("DESTOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYONEACTIVE),
- DDCAPDEF("DESTOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_DESTOVERLAYYUV),
- DDCAPDEF("SRCBLT", dwCKeyCaps, DDCKEYCAPS_SRCBLT),
- DDCAPDEF("SRCBLTCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACE),
- DDCAPDEF("SRCBLTCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTCLRSPACEYUV),
- DDCAPDEF("SRCBLTYUV", dwCKeyCaps, DDCKEYCAPS_SRCBLTYUV),
- DDCAPDEF("SRCOVERLAY", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAY),
- DDCAPDEF("SRCOVERLAYCLRSPACE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACE),
- DDCAPDEF("SRCOVERLAYCLRSPACEYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV),
- DDCAPDEF("SRCOVERLAYONEACTIVE", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYONEACTIVE),
- DDCAPDEF("SRCOVERLAYYUV", dwCKeyCaps, DDCKEYCAPS_SRCOVERLAYYUV),
- CAPDEF CKeyCapsDefs[] =
- {
- GEN_CKCAPS(dwCKeyCaps)
- { "", 0, 0}
- };
- CAPDEF VSBCKeyCapsDefs[] =
- {
- GEN_CKCAPS(dwVSBCKeyCaps)
- { "", 0, 0}
- };
- CAPDEF SVBCKeyCapsDefs[] =
- {
- GEN_CKCAPS(dwSVBCKeyCaps)
- { "", 0, 0}
- };
- CAPDEF SSBCKeyCapsDefs[] =
- {
- GEN_CKCAPS(dwSSBCKeyCaps)
- { "", 0, 0}
- };
- CAPDEF NLVBCKeyCapsDefs[] =
- {
- GEN_CKCAPS(dwNLVBCKeyCaps)
- { "", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- #define GEN_FXCAPS(dwFXCaps)
- DDCAPDEF("BLTARITHSTRETCHY", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHY),
- DDCAPDEF("BLTARITHSTRETCHYN", dwFXCaps, DDFXCAPS_BLTARITHSTRETCHYN),
- DDCAPDEF("BLTMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_BLTMIRRORLEFTRIGHT),
- DDCAPDEF("BLTMIRRORUPDOWN", dwFXCaps, DDFXCAPS_BLTMIRRORUPDOWN),
- DDCAPDEF("BLTROTATION", dwFXCaps, DDFXCAPS_BLTROTATION),
- DDCAPDEF("BLTROTATION90", dwFXCaps, DDFXCAPS_BLTROTATION90),
- DDCAPDEF("BLTSHRINKX", dwFXCaps, DDFXCAPS_BLTSHRINKX),
- DDCAPDEF("BLTSHRINKXN", dwFXCaps, DDFXCAPS_BLTSHRINKXN),
- DDCAPDEF("BLTSHRINKY", dwFXCaps, DDFXCAPS_BLTSHRINKY),
- DDCAPDEF("BLTSHRINKYN", dwFXCaps, DDFXCAPS_BLTSHRINKYN),
- DDCAPDEF("BLTSTRETCHX", dwFXCaps, DDFXCAPS_BLTSTRETCHX),
- DDCAPDEF("BLTSTRETCHXN", dwFXCaps, DDFXCAPS_BLTSTRETCHXN),
- DDCAPDEF("BLTSTRETCHY", dwFXCaps, DDFXCAPS_BLTSTRETCHY),
- DDCAPDEF("BLTSTRETCHYN", dwFXCaps, DDFXCAPS_BLTSTRETCHYN),
- DDCAPDEF("OVERLAYARITHSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHY),
- DDCAPDEF("OVERLAYARITHSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYARITHSTRETCHYN),
- DDCAPDEF("OVERLAYSHRINKX", dwFXCaps, DDFXCAPS_OVERLAYSHRINKX),
- DDCAPDEF("OVERLAYSHRINKXN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKXN),
- DDCAPDEF("OVERLAYSHRINKY", dwFXCaps, DDFXCAPS_OVERLAYSHRINKY),
- DDCAPDEF("OVERLAYSHRINKYN", dwFXCaps, DDFXCAPS_OVERLAYSHRINKYN),
- DDCAPDEF("OVERLAYSTRETCHX", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHX),
- DDCAPDEF("OVERLAYSTRETCHXN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHXN),
- DDCAPDEF("OVERLAYSTRETCHY", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHY),
- DDCAPDEF("OVERLAYSTRETCHYN", dwFXCaps, DDFXCAPS_OVERLAYSTRETCHYN),
- DDCAPDEF("OVERLAYMIRRORLEFTRIGHT", dwFXCaps, DDFXCAPS_OVERLAYMIRRORLEFTRIGHT),
- DDCAPDEF("OVERLAYMIRRORUPDOWN", dwFXCaps, DDFXCAPS_OVERLAYMIRRORUPDOWN),
- CAPDEF FXCapsDefs[] =
- {
- GEN_FXCAPS(dwFXCaps)
- { "", 0, 0}
- };
- CAPDEF VSBFXCapsDefs[] =
- {
- GEN_FXCAPS(dwVSBFXCaps)
- { "", 0, 0}
- };
- CAPDEF SVBFXCapsDefs[] =
- {
- GEN_FXCAPS(dwSVBFXCaps)
- { "", 0, 0}
- };
- CAPDEF SSBFXCapsDefs[] =
- {
- GEN_FXCAPS(dwSSBFXCaps)
- { "", 0, 0}
- };
- CAPDEF NLVBFXCapsDefs[] =
- {
- GEN_FXCAPS(dwNLVBFXCaps)
- { "", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF PalCapsDefs[] =
- {
- DDCAPDEF("4BIT", dwPalCaps, DDPCAPS_4BIT),
- DDCAPDEF("8BITENTRIES", dwPalCaps, DDPCAPS_8BITENTRIES),
- DDCAPDEF("8BIT", dwPalCaps, DDPCAPS_8BIT),
- DDCAPDEF("INITIALIZE", dwPalCaps, DDPCAPS_INITIALIZE),
- DDCAPDEF("PRIMARYSURFACE", dwPalCaps, DDPCAPS_PRIMARYSURFACE),
- DDCAPDEF("PRIMARYSURFACELEFT",dwPalCaps, DDPCAPS_PRIMARYSURFACELEFT),
- DDCAPDEF("VSYNC", dwPalCaps, DDPCAPS_VSYNC),
- { "", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF SurfCapsDefs[] =
- {
- DDCAPDEF( "3DDEVICE", ddsCaps.dwCaps, DDSCAPS_3DDEVICE),
- DDCAPDEF( "ALPHA", ddsCaps.dwCaps, DDSCAPS_ALPHA),
- DDCAPDEF( "BACKBUFFER", ddsCaps.dwCaps, DDSCAPS_BACKBUFFER),
- DDCAPDEF( "COMPLEX", ddsCaps.dwCaps, DDSCAPS_COMPLEX),
- DDCAPDEF( "FLIP", ddsCaps.dwCaps, DDSCAPS_FLIP),
- DDCAPDEF( "FRONTBUFFER", ddsCaps.dwCaps, DDSCAPS_FRONTBUFFER),
- DDCAPDEF( "MIPMAP", ddsCaps.dwCaps, DDSCAPS_MIPMAP),
- DDCAPDEF( "OFFSCREENPLAIN", ddsCaps.dwCaps, DDSCAPS_OFFSCREENPLAIN),
- DDCAPDEF( "OVERLAY", ddsCaps.dwCaps, DDSCAPS_OVERLAY),
- DDCAPDEF( "PALETTE", ddsCaps.dwCaps, DDSCAPS_PALETTE),
- DDCAPDEF( "PRIMARYSURFACE", ddsCaps.dwCaps, DDSCAPS_PRIMARYSURFACE),
- DDCAPDEF( "PRIMARYSURFACELEFT", ddsCaps.dwCaps, DDSCAPS_PRIMARYSURFACELEFT),
- DDCAPDEF( "SYSTEMMEMORY", ddsCaps.dwCaps, DDSCAPS_SYSTEMMEMORY),
- DDCAPDEF( "TEXTURE", ddsCaps.dwCaps, DDSCAPS_TEXTURE),
- DDCAPDEF( "VIDEOMEMORY", ddsCaps.dwCaps, DDSCAPS_VIDEOMEMORY),
- DDCAPDEF( "VISIBLE", ddsCaps.dwCaps, DDSCAPS_VISIBLE),
- DDCAPDEF( "WRITEONLY", ddsCaps.dwCaps, DDSCAPS_WRITEONLY),
- DDCAPDEF( "ZBUFFER", ddsCaps.dwCaps, DDSCAPS_ZBUFFER),
- DDCAPDEF( "OWNDC", ddsCaps.dwCaps, DDSCAPS_OWNDC),
- DDCAPDEF( "LIVEVIDEO", ddsCaps.dwCaps, DDSCAPS_LIVEVIDEO),
- DDCAPDEF( "HWCODEC", ddsCaps.dwCaps, DDSCAPS_HWCODEC),
- DDCAPDEF( "MODEX", ddsCaps.dwCaps, DDSCAPS_MODEX),
- { "", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF SVisionCapsDefs[] =
- {
- DDCAPDEF( "ENIGMA", dwSVCaps, DDSVCAPS_ENIGMA),
- DDCAPDEF( "FLICKER", dwSVCaps, DDSVCAPS_FLICKER),
- DDCAPDEF( "REDBLUE", dwSVCaps, DDSVCAPS_REDBLUE),
- DDCAPDEF( "SPLIT", dwSVCaps, DDSVCAPS_SPLIT),
- { "", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- #define GEN_ROPS(dwRops)
- ROPDEF("SRCCOPY", dwRops, SRCCOPY),
- ROPDEF("SRCPAINT", dwRops, SRCPAINT),
- ROPDEF("SRCAND", dwRops, SRCAND),
- ROPDEF("SRCINVERT", dwRops, SRCINVERT),
- ROPDEF("SRCERASE", dwRops, SRCERASE),
- ROPDEF("NOTSRCCOPY", dwRops, NOTSRCCOPY),
- ROPDEF("NOTSRCERASE",dwRops, NOTSRCERASE),
- ROPDEF("MERGECOPY", dwRops, MERGECOPY),
- ROPDEF("MERGEPAINT", dwRops, MERGEPAINT),
- ROPDEF("PATCOPY", dwRops, PATCOPY),
- ROPDEF("PATPAINT", dwRops, PATPAINT),
- ROPDEF("PATINVERT", dwRops, PATINVERT),
- ROPDEF("DSTINVERT", dwRops, DSTINVERT),
- ROPDEF("BLACKNESS", dwRops, BLACKNESS),
- ROPDEF("WHITENESS", dwRops, WHITENESS),
- CAPDEF ROPCapsDefs[] =
- {
- GEN_ROPS(dwRops)
- {"", 0, 0}
- };
- CAPDEF VSBROPCapsDefs[] =
- {
- GEN_ROPS(dwVSBRops)
- {"", 0, 0}
- };
- CAPDEF SVBROPCapsDefs[] =
- {
- GEN_ROPS(dwSVBRops)
- {"", 0, 0}
- };
- CAPDEF SSBROPCapsDefs[] =
- {
- GEN_ROPS(dwSSBRops)
- {"", 0, 0}
- };
- CAPDEF NLVBROPCapsDefs[] =
- {
- GEN_ROPS(dwNLVBRops)
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS DDCapDefs[] =
- {
- {"", NULL, (LPARAM)0, NULL},
- {"Memory", VidMem, (LPARAM)0, VidMemPrint},
- {"+Caps", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)GenCaps, DDPrintCaps},
- {"Palette Caps", DDAddCaps, (LPARAM)PalCapsDefs, DDPrintCaps},
- {"Surface Caps", DDAddCaps, (LPARAM)SurfCapsDefs, DDPrintCaps},
- {"Stereo Vision Caps", DDAddCaps, (LPARAM)SVisionCapsDefs, DDPrintCaps},
- {"+Video - Video", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)CapsDefs, DDPrintCaps},
- {"Color Key", DDAddCaps, (LPARAM)CKeyCapsDefs, DDPrintCaps},
- {"FX", DDAddCaps, (LPARAM)FXCapsDefs, DDPrintCaps},
- {"ROPS", DDAddCaps, (LPARAM)ROPCapsDefs, DDPrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"+System - Video", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)SVBCapsDefs, DDPrintCaps},
- {"Color Key", DDAddCaps, (LPARAM)SVBCKeyCapsDefs, DDPrintCaps},
- {"FX", DDAddCaps, (LPARAM)SVBFXCapsDefs, DDPrintCaps},
- {"ROPS", DDAddCaps, (LPARAM)SVBROPCapsDefs, DDPrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"+Video - System", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)VSBCapsDefs, DDPrintCaps},
- {"Color Key", DDAddCaps, (LPARAM)SSBCKeyCapsDefs, DDPrintCaps},
- {"FX", DDAddCaps, (LPARAM)SSBFXCapsDefs, DDPrintCaps},
- {"ROPS", DDAddCaps, (LPARAM)VSBROPCapsDefs, DDPrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"+System - System", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)SSBCapsDefs, DDPrintCaps},
- {"Color Key", DDAddCaps, (LPARAM)SSBCKeyCapsDefs, DDPrintCaps},
- {"FX", DDAddCaps, (LPARAM)SSBFXCapsDefs, DDPrintCaps},
- {"ROPS", DDAddCaps, (LPARAM)SSBROPCapsDefs, DDPrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"+NonLocal - Video", NULL, (LPARAM)0, NULL},
- {"General", DDAddCaps, (LPARAM)NLVBCapsDefs, DDPrintCaps},
- {"Color Key", DDAddCaps, (LPARAM)NLVBCKeyCapsDefs, DDPrintCaps},
- {"FX", DDAddCaps, (LPARAM)NLVBFXCapsDefs, DDPrintCaps},
- {"ROPS", DDAddCaps, (LPARAM)NLVBROPCapsDefs, DDPrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"-", NULL, (LPARAM)0, NULL},
- {"Video Modes", DDAddVideoModes, (LPARAM)0, DDPrintVideoModes},
- {"FourCC Formats", DDFourCCFormat, (LPARAM)0, DDPrintFourCCFormat},
- {"Other", DDAddCaps, (LPARAM)OtherInfoDefs, DDPrintCaps},
- { NULL, 0, 0, NULL}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF ValidFlags[] =
- {
- D3CAPDEF("COLORMODEL", dwFlags, D3DDD_COLORMODEL),
- D3CAPDEF("DEVCAPS", dwFlags, D3DDD_DEVCAPS),
- D3CAPDEF("TRANSFORMCAPS", dwFlags, D3DDD_TRANSFORMCAPS),
- D3CAPDEF("LIGHTINGCAPS", dwFlags, D3DDD_LIGHTINGCAPS),
- D3CAPDEF("BCLIPPING", dwFlags, D3DDD_BCLIPPING),
- D3CAPDEF("LINECAPS", dwFlags, D3DDD_LINECAPS),
- D3CAPDEF("TRICAPS", dwFlags, D3DDD_TRICAPS),
- D3CAPDEF("DEVICERENDERBITDEPTH", dwFlags, D3DDD_DEVICERENDERBITDEPTH),
- D3CAPDEF("DEVICEZBUFFERBITDEPTH", dwFlags, D3DDD_DEVICEZBUFFERBITDEPTH),
- D3CAPDEF("MAXBUFFERSIZE", dwFlags, D3DDD_MAXBUFFERSIZE),
- D3CAPDEF("MAXVERTEXCOUNT", dwFlags, D3DDD_MAXVERTEXCOUNT),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF ColorModel[] =
- {
- D3CAPDEF("D3DCOLOR_MONO", dcmColorModel, D3DCOLOR_MONO),
- D3CAPDEF("D3DCOLOR_RGB", dcmColorModel, D3DCOLOR_RGB),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DevCaps[] =
- {
- D3CAPDEF("SORTINCREASINGZ", dwDevCaps, D3DDEVCAPS_SORTINCREASINGZ),
- D3CAPDEF("SORTDECREASINGZ", dwDevCaps, D3DDEVCAPS_SORTDECREASINGZ),
- D3CAPDEF("SORTEXACT", dwDevCaps, D3DDEVCAPS_SORTEXACT),
- D3CAPDEF("EXECUTESYSTEMMEMORY", dwDevCaps, D3DDEVCAPS_EXECUTESYSTEMMEMORY),
- D3CAPDEF("EXECUTEVIDEOMEMORY", dwDevCaps, D3DDEVCAPS_EXECUTEVIDEOMEMORY),
- D3CAPDEF("TLVERTEXSYSTEMEMORY", dwDevCaps, D3DDEVCAPS_TLVERTEXSYSTEMMEMORY),
- D3CAPDEF("TLVERTEXVIDEOMEMORY", dwDevCaps, D3DDEVCAPS_TLVERTEXVIDEOMEMORY),
- D3CAPDEF("TEXTURESYSTEMMEMORY", dwDevCaps, D3DDEVCAPS_TEXTURESYSTEMMEMORY),
- D3CAPDEF("TEXTUREVIDEOMEMORY", dwDevCaps, D3DDEVCAPS_TEXTUREVIDEOMEMORY),
- D3CAPDEF("FLOATTLVERTEX" , dwDevCaps, D3DDEVCAPS_FLOATTLVERTEX),
- D3CAPDEF("DRAWPRIMTLVERTEX" , dwDevCaps, D3DDEVCAPS_DRAWPRIMTLVERTEX),
- D3CAPDEF("CANRENDERAFTERFLIP" , dwDevCaps, D3DDEVCAPS_CANRENDERAFTERFLIP),
- D3CAPDEF("TEXTURENONLOCALVIDMEM" , dwDevCaps, D3DDEVCAPS_TEXTURENONLOCALVIDMEM),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TransformCaps[] =
- {
- D3CAPDEF("CLIP", dtcTransformCaps.dwCaps, D3DTRANSFORMCAPS_CLIP),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF LightingCaps[] =
- {
- D3CAPDEF("D3DLIGHTINGMODEL_RGB", dlcLightingCaps.dwLightingModel, D3DLIGHTINGMODEL_RGB),
- D3CAPDEF("D3DLIGHTINGMODEL_MONO", dlcLightingCaps.dwLightingModel, D3DLIGHTINGMODEL_MONO),
- D3CAPDEF("D3DLIGHTCAPS_POINT", dlcLightingCaps.dwCaps, D3DLIGHTCAPS_POINT),
- D3CAPDEF("D3DLIGHTCAPS_SPOT", dlcLightingCaps.dwCaps, D3DLIGHTCAPS_SPOT),
- D3CAPDEF("D3DLIGHTCAPS_DIRECTIONAL", dlcLightingCaps.dwCaps, D3DLIGHTCAPS_DIRECTIONAL),
- D3CAPDEF("D3DLIGHTCAPS_PARALLELPOINT", dlcLightingCaps.dwCaps, D3DLIGHTCAPS_PARALLELPOINT),
- D3VALDEF("dwNumLights", dlcLightingCaps.dwNumLights),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF BClipping[] =
- {
- D3CAPDEF("bClipping", bClipping, TRUE),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriMisc[] =
- {
- D3CAPDEF("MASKPLANES", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_MASKPLANES),
- D3CAPDEF("MASKZ", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_MASKZ),
- D3CAPDEF("LINEPATTERNREP", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_LINEPATTERNREP),
- D3CAPDEF("CONFORMANT", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CONFORMANT),
- D3CAPDEF("CULLNONE", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLNONE),
- D3CAPDEF("CULLCW", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLCW),
- D3CAPDEF("CULLCCW", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLCCW),
- D3CAPDEF("DITHER", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_DITHER),
- D3CAPDEF("ROP2", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_ROP2),
- D3CAPDEF("XOR", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_XOR),
- D3CAPDEF("PAT", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_PAT),
- D3CAPDEF("ZTEST", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_ZTEST),
- D3CAPDEF("SUBPIXEL", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_SUBPIXEL),
- D3CAPDEF("SUBPIXELX", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_SUBPIXELX),
- D3CAPDEF("FOGVERTEX", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_FOGVERTEX),
- D3CAPDEF("FOGTABLE", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_FOGTABLE),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriFog[] =
- {
- D3CAPDEF("FOGVERTEX", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_FOGVERTEX),
- D3CAPDEF("FOGTABLE", dpcTriCaps.dwRasterCaps, D3DPRASTERCAPS_FOGTABLE),
- D3CAPDEF("FOG FLAT", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGFLAT ),
- D3CAPDEF("FOG GOURAUD", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGGOURAUD ),
- D3CAPDEF("FOG PHONG", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGPHONG ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriCull[] =
- {
- D3CAPDEF("CULL NONE", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLNONE),
- D3CAPDEF("CULL CW", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLCW),
- D3CAPDEF("CULL CCW", dpcTriCaps.dwMiscCaps, D3DPMISCCAPS_CULLCCW),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriTextureBlend[] =
- {
- D3CAPDEF("DECAL", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_DECAL ),
- D3CAPDEF("MODULATE", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_MODULATE ),
- D3CAPDEF("DECALALPHA", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_DECALALPHA ),
- D3CAPDEF("MODULATEALPHA", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_MODULATEALPHA ),
- D3CAPDEF("DECALMASK", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_DECALMASK ),
- D3CAPDEF("MODULATEMASK", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_MODULATEMASK ),
- D3CAPDEF("COPY", dpcTriCaps.dwTextureBlendCaps, D3DPTBLENDCAPS_COPY ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriTextureFilter[] =
- {
- D3CAPDEF("NEAREST", dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_NEAREST ),
- D3CAPDEF("LINEAR", dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_LINEAR ),
- D3CAPDEF("MIPNEAREST", dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_MIPNEAREST ),
- D3CAPDEF("MIPLINEAR", dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_MIPLINEAR ),
- D3CAPDEF("LINEARMIPNEAREST",dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_LINEARMIPNEAREST ),
- D3CAPDEF("LINEARMIPLINEAR", dpcTriCaps.dwTextureFilterCaps, D3DPTFILTERCAPS_LINEARMIPLINEAR ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriTextureCaps[] =
- {
- D3CAPDEF("PERSPECTIVE", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_PERSPECTIVE ),
- D3CAPDEF("POW2", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_POW2 ),
- D3CAPDEF("ALPHA", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_ALPHA ),
- D3CAPDEF("TRANSPARENCY", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_TRANSPARENCY ),
- D3CAPDEF("BORDER", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_BORDER ),
- D3CAPDEF("SQUAREONLY", dpcTriCaps.dwTextureCaps, D3DPTEXTURECAPS_SQUAREONLY ),
- D3CAPDEF("WRAP", dpcTriCaps.dwTextureAddressCaps, D3DPTADDRESSCAPS_WRAP ),
- D3CAPDEF("MIRROR", dpcTriCaps.dwTextureAddressCaps, D3DPTADDRESSCAPS_MIRROR ),
- D3CAPDEF("CLAMP", dpcTriCaps.dwTextureAddressCaps, D3DPTADDRESSCAPS_CLAMP ),
- D3CAPDEF("BORDER", dpcTriCaps.dwTextureAddressCaps, D3DPTADDRESSCAPS_BORDER ),
- D3CAPDEF("INDEPENDENTUV", dpcTriCaps.dwTextureAddressCaps, D3DPTADDRESSCAPS_INDEPENDENTUV ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriZCmpCaps[] =
- {
- D3CAPDEF("NEVER", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_NEVER ),
- D3CAPDEF("LESS", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_LESS ),
- D3CAPDEF("EQUAL", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_EQUAL ),
- D3CAPDEF("LESSEQUAL", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_LESSEQUAL ),
- D3CAPDEF("GREATER", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_GREATER ),
- D3CAPDEF("NOTEQUAL", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_NOTEQUAL ),
- D3CAPDEF("GREATEREQUAL", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_GREATEREQUAL ),
- D3CAPDEF("ALWAYS", dpcTriCaps.dwZCmpCaps, D3DPCMPCAPS_ALWAYS ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriACmpCaps[] =
- {
- D3CAPDEF("NEVER", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_NEVER ),
- D3CAPDEF("LESS", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_LESS ),
- D3CAPDEF("EQUAL", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_EQUAL ),
- D3CAPDEF("LESSEQUAL", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_LESSEQUAL ),
- D3CAPDEF("GREATER", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_GREATER ),
- D3CAPDEF("NOTEQUAL", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_NOTEQUAL ),
- D3CAPDEF("GREATEREQUAL", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_GREATEREQUAL ),
- D3CAPDEF("ALWAYS", dpcTriCaps.dwAlphaCmpCaps, D3DPCMPCAPS_ALWAYS ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriSrcBlendCaps[] =
- {
- D3CAPDEF("ZERO", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_ZERO ),
- D3CAPDEF("ONE", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_ONE ),
- D3CAPDEF("SRCCOLOR", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_SRCCOLOR ),
- D3CAPDEF("INVSRCCOLOR", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR ),
- D3CAPDEF("SRCALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_SRCALPHA ),
- D3CAPDEF("INVSRCALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_INVSRCALPHA ),
- D3CAPDEF("DESTALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_DESTALPHA ),
- D3CAPDEF("INVDESTALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_INVDESTALPHA ),
- D3CAPDEF("DESTCOLOR", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_DESTCOLOR ),
- D3CAPDEF("INVDESTCOLOR", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR ),
- D3CAPDEF("SRCALPHASAT", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_SRCALPHASAT ),
- D3CAPDEF("BOTHSRCALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA ),
- D3CAPDEF("BOTHINVSRCALPHA", dpcTriCaps.dwSrcBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriDestBlendCaps[] =
- {
- D3CAPDEF("ZERO", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_ZERO ),
- D3CAPDEF("ONE", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_ONE ),
- D3CAPDEF("SRCCOLOR", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_SRCCOLOR ),
- D3CAPDEF("INVSRCCOLOR", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_INVSRCCOLOR ),
- D3CAPDEF("SRCALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_SRCALPHA ),
- D3CAPDEF("INVSRCALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_INVSRCALPHA ),
- D3CAPDEF("DESTALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_DESTALPHA ),
- D3CAPDEF("INVDESTALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_INVDESTALPHA ),
- D3CAPDEF("DESTCOLOR", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_DESTCOLOR ),
- D3CAPDEF("INVDESTCOLOR", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_INVDESTCOLOR ),
- D3CAPDEF("SRCALPHASAT", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_SRCALPHASAT ),
- D3CAPDEF("BOTHSRCALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_BOTHSRCALPHA ),
- D3CAPDEF("BOTHINVSRCALPHA", dpcTriCaps.dwDestBlendCaps, D3DPBLENDCAPS_BOTHINVSRCALPHA ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF TriShadeCaps[] =
- {
- D3CAPDEF("COLOR FLAT MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORFLATMONO ),
- D3CAPDEF("COLOR FLAT RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORFLATRGB ),
- D3CAPDEF("COLOR GOURAUD MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORGOURAUDMONO ),
- D3CAPDEF("COLOR GOURAUD RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORGOURAUDRGB ),
- D3CAPDEF("COLOR PHONG MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORPHONGMONO ),
- D3CAPDEF("COLOR PHONG RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_COLORPHONGRGB ),
- D3CAPDEF("SPECULAR FLAT MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARFLATMONO ),
- D3CAPDEF("SPECULAR FLAT RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARFLATRGB ),
- D3CAPDEF("SPECULAR GOURAUD MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARGOURAUDMONO ),
- D3CAPDEF("SPECULAR GOURAUD RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARGOURAUDRGB ),
- D3CAPDEF("SPECULAR PHONG MONO", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARPHONGMONO ),
- D3CAPDEF("SPECULAR PHONG RGB", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_SPECULARPHONGRGB ),
- D3CAPDEF("ALPHA FLAT BLEND", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAFLATBLEND ),
- D3CAPDEF("ALPHA FLAT STIPPLED", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAFLATSTIPPLED ),
- D3CAPDEF("ALPHA GOURAUD BLEND", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAGOURAUDBLEND ),
- D3CAPDEF("ALPHA GOURAUD STIPPLED", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAGOURAUDSTIPPLED),
- D3CAPDEF("ALPHA PHONG BLEND", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAPHONGBLEND ),
- D3CAPDEF("ALPHA PHONG STIPPLED", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_ALPHAPHONGSTIPPLED ),
- D3CAPDEF("FOG FLAT", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGFLAT ),
- D3CAPDEF("FOG GOURAUD", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGGOURAUD ),
- D3CAPDEF("FOG PHONG", dpcTriCaps.dwShadeCaps, D3DPSHADECAPS_FOGPHONG ),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF D3dMisc[] =
- {
- D3CAPDEF("D3DCOLOR_MONO", dcmColorModel, D3DCOLOR_MONO),
- D3CAPDEF("D3DCOLOR_RGB", dcmColorModel, D3DCOLOR_RGB),
- D3CAPDEF("bClipping", bClipping, TRUE),
- D3CAPDEF("CLIP", dtcTransformCaps.dwCaps, D3DTRANSFORMCAPS_CLIP),
- D3VALDEF("MaxBufferSize", dwMaxBufferSize),
- D3VALDEF("MaxVertexCount", dwMaxVertexCount),
- D3HEXDEF("DeviceRenderBitDepth", dwDeviceRenderBitDepth),
- D3CAPDEF(" 8", dwDeviceRenderBitDepth, DDBD_8),
- D3CAPDEF(" 16", dwDeviceRenderBitDepth, DDBD_16),
- D3CAPDEF(" 24", dwDeviceRenderBitDepth, DDBD_24),
- D3CAPDEF(" 32", dwDeviceRenderBitDepth, DDBD_32),
- D3HEXDEF("DeviceZBufferBitDepth", dwDeviceZBufferBitDepth),
- D3CAPDEF(" 8", dwDeviceZBufferBitDepth, DDBD_8),
- D3CAPDEF(" 16", dwDeviceZBufferBitDepth, DDBD_16),
- D3CAPDEF(" 24", dwDeviceZBufferBitDepth, DDBD_24),
- D3CAPDEF(" 32", dwDeviceZBufferBitDepth, DDBD_32),
- D3VALDEF("MinTextureWidth", dwMinTextureWidth),
- D3VALDEF("MinTextureHeight", dwMinTextureHeight),
- D3VALDEF("MaxTextureWidth", dwMaxTextureWidth),
- D3VALDEF("MaxTextureHeight", dwMaxTextureHeight),
- D3VALDEF("MinStippleWidth", dwMinStippleWidth),
- D3VALDEF("MaxStippleWidth", dwMaxStippleWidth),
- D3VALDEF("MinStippleHeight", dwMinStippleHeight),
- D3VALDEF("MaxStippleHeight", dwMaxStippleHeight),
- {"",0,0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS D3CapDefs[] =
- {
- {"", D3AddCaps, (LPARAM)ValidFlags, D3PrintCaps},
- {"DevCaps", D3AddCaps, (LPARAM)DevCaps, D3PrintCaps},
- {"Misc", D3AddCaps, (LPARAM)D3dMisc, D3PrintCaps},
- // {"ColorModel", D3AddCaps, (LPARAM)ColorModel, D3PrintCaps},
- // {"TransformCaps", D3AddCaps, (LPARAM)TransformCaps, D3PrintCaps},
- // {"BClipping", D3AddCaps, (LPARAM)BClipping, D3PrintCaps},
- {"LightingCaps", D3AddCaps, (LPARAM)LightingCaps, D3PrintCaps},
- {"+Triangle Caps", NULL, (LPARAM)0, NULL},
- {"Z Compare", D3AddCaps, (LPARAM)TriZCmpCaps, D3PrintCaps},
- {"Alpha Compare", D3AddCaps, (LPARAM)TriACmpCaps, D3PrintCaps},
- {"Misc", D3AddCaps, (LPARAM)TriMisc, D3PrintCaps},
- {"Cull", D3AddCaps, (LPARAM)TriCull, D3PrintCaps},
- {"Fog", D3AddCaps, (LPARAM)TriFog, D3PrintCaps},
- {"Texture Caps", D3AddCaps, (LPARAM)TriTextureCaps, D3PrintCaps},
- {"Texture Filter", D3AddCaps, (LPARAM)TriTextureFilter, D3PrintCaps},
- {"Texture Blend", D3AddCaps, (LPARAM)TriTextureBlend, D3PrintCaps},
- {"Texture Source Blend",D3AddCaps, (LPARAM)TriSrcBlendCaps, D3PrintCaps},
- {"Texture Dest Blend", D3AddCaps, (LPARAM)TriDestBlendCaps, D3PrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"+Line Caps", NULL, (LPARAM)0, NULL},
- {"Z Compare", D3AddLineCaps, (LPARAM)TriZCmpCaps, D3PrintCaps},
- {"Alpha Compare", D3AddLineCaps, (LPARAM)TriACmpCaps, D3PrintCaps},
- {"Misc", D3AddLineCaps, (LPARAM)TriMisc, D3PrintCaps},
- {"Cull", D3AddLineCaps, (LPARAM)TriCull, D3PrintCaps},
- {"Fog", D3AddLineCaps, (LPARAM)TriFog, D3PrintCaps},
- {"Texture Caps", D3AddLineCaps, (LPARAM)TriTextureCaps, D3PrintCaps},
- {"Texture Filter", D3AddLineCaps, (LPARAM)TriTextureFilter, D3PrintCaps},
- {"Texture Blend", D3AddLineCaps, (LPARAM)TriTextureBlend, D3PrintCaps},
- {"Texture Source Blend",D3AddLineCaps, (LPARAM)TriSrcBlendCaps, D3PrintCaps},
- {"Texture Dest Blend", D3AddLineCaps, (LPARAM)TriDestBlendCaps, D3PrintCaps},
- {"-", NULL, (LPARAM)0, NULL},
- {"Texture Formats", D3AddTexF, (LPARAM)0, 0},
- {NULL, 0, 0, NULL}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DSInfo[] =
- {
- DSVALDEF("MinSecondarySampleRate", dwMinSecondarySampleRate),
- DSVALDEF("MaxSecondarySampleRate", dwMaxSecondarySampleRate),
- DSVALDEF("PrimaryBuffers", dwPrimaryBuffers),
- DSVALDEF("MaxHwMixingAllBuffers", dwMaxHwMixingAllBuffers),
- DSVALDEF("MaxHwMixingStaticBuffers", dwMaxHwMixingStaticBuffers),
- DSVALDEF("MaxHwMixingStreamingBuffers", dwMaxHwMixingStreamingBuffers),
- DSVALDEF("FreeHwMixingAllBuffers", dwFreeHwMixingAllBuffers),
- DSVALDEF("FreeHwMixingStaticBuffers", dwFreeHwMixingStaticBuffers),
- DSVALDEF("FreeHwMixingStreamingBuffers", dwFreeHwMixingStreamingBuffers),
- DSVALDEF("MaxHw3DAllBuffers", dwMaxHw3DAllBuffers),
- DSVALDEF("MaxHw3DStaticBuffers", dwMaxHw3DStaticBuffers),
- DSVALDEF("MaxHw3DStreamingBuffers", dwMaxHw3DStreamingBuffers),
- DSVALDEF("FreeHw3DAllBuffers", dwFreeHw3DAllBuffers),
- DSVALDEF("FreeHw3DStaticBuffers", dwFreeHw3DStaticBuffers),
- DSVALDEF("FreeHw3DStreamingBuffers", dwFreeHw3DStreamingBuffers),
- DSVALDEF("TotalHwMemBytes", dwTotalHwMemBytes),
- DSVALDEF("FreeHwMemBytes", dwFreeHwMemBytes),
- DSVALDEF("MaxContigFreeHwMemBytes", dwMaxContigFreeHwMemBytes),
- DSVALDEF("UnlockTransferRateHwBuffers", dwUnlockTransferRateHwBuffers),
- DSVALDEF("PlayCpuOverheadSwBuffers", dwPlayCpuOverheadSwBuffers),
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DSGeneralCaps[] =
- {
- DSCAPDEF("PRIMARYMONO", dwFlags, DSCAPS_PRIMARYMONO),
- DSCAPDEF("PRIMARYSTEREO", dwFlags, DSCAPS_PRIMARYSTEREO),
- DSCAPDEF("PRIMARY8BIT", dwFlags, DSCAPS_PRIMARY8BIT),
- DSCAPDEF("PRIMARY16BIT", dwFlags, DSCAPS_PRIMARY16BIT),
- DSCAPDEF("CONTINUOUSRATE", dwFlags, DSCAPS_CONTINUOUSRATE),
- DSCAPDEF("EMULDRIVER", dwFlags, DSCAPS_EMULDRIVER),
- DSCAPDEF("SECONDARYMONO", dwFlags, DSCAPS_SECONDARYMONO),
- DSCAPDEF("SECONDARYSTEREO", dwFlags, DSCAPS_SECONDARYSTEREO),
- DSCAPDEF("SECONDARY8BIT", dwFlags, DSCAPS_SECONDARY8BIT),
- DSCAPDEF("SECONDARY16BIT", dwFlags, DSCAPS_SECONDARY16BIT),
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS DSCapDefs[] =
- {
- {"", DSAddCaps, (LPARAM)DSInfo, DSPrintCaps},
- {"General", DSAddCaps, (LPARAM)DSInfo, DSPrintCaps},
- {"General Caps", DSAddCaps, (LPARAM)DSGeneralCaps, DSPrintCaps},
- {NULL, 0, 0, NULL}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DSCInfo[] =
- {
- DSCVALDEF("Channels", dwChannels),
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DSCGeneralCaps[] =
- {
- DSCCAPDEF("EMULDRIVER", dwFlags, DSCCAPS_EMULDRIVER),
- DSCCAPDEF("WAVE_FORMAT_1M08", dwFormats, WAVE_FORMAT_1M08),
- DSCCAPDEF("WAVE_FORMAT_1S08", dwFormats, WAVE_FORMAT_1S08),
- DSCCAPDEF("WAVE_FORMAT_1M16", dwFormats, WAVE_FORMAT_1M16),
- DSCCAPDEF("WAVE_FORMAT_1S16", dwFormats, WAVE_FORMAT_1S16),
- DSCCAPDEF("WAVE_FORMAT_2M08", dwFormats, WAVE_FORMAT_2M08),
- DSCCAPDEF("WAVE_FORMAT_2S08", dwFormats, WAVE_FORMAT_2S08),
- DSCCAPDEF("WAVE_FORMAT_2M16", dwFormats, WAVE_FORMAT_2M16),
- DSCCAPDEF("WAVE_FORMAT_2S16", dwFormats, WAVE_FORMAT_2S16),
- DSCCAPDEF("WAVE_FORMAT_4M08", dwFormats, WAVE_FORMAT_4M08),
- DSCCAPDEF("WAVE_FORMAT_4S08", dwFormats, WAVE_FORMAT_4S08),
- DSCCAPDEF("WAVE_FORMAT_4M16", dwFormats, WAVE_FORMAT_4M16),
- DSCCAPDEF("WAVE_FORMAT_4S16", dwFormats, WAVE_FORMAT_4S16),
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS DSCCapDefs[] =
- {
- {"", DSCAddCaps, (LPARAM)DSCInfo, DSCPrintCaps},
- {"General", DSCAddCaps, (LPARAM)DSCInfo, DSCPrintCaps},
- {"General Caps", DSCAddCaps, (LPARAM)DSCGeneralCaps, DSCPrintCaps},
- {NULL, 0, 0, NULL}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEF DPInfo[] =
- {
- DPVALDEF("Size", dwSize),
- DPHEXDEF("Flags", dwFlags),
- DPVALDEF("MaxBufferSize", dwMaxBufferSize),
- DPVALDEF("MaxQueueSize", dwMaxQueueSize),
- DPVALDEF("MaxPlayers", dwMaxPlayers),
- DPVALDEF("HundredBaud", dwHundredBaud),
- DPVALDEF("Latency", dwLatency),
- DPVALDEF("MaxLocalPlayers", dwMaxLocalPlayers),
- DPVALDEF("HeaderLength", dwHeaderLength),
- DPVALDEF("Timeout", dwTimeout),
- {"", 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS DPCapDefs[] =
- {
- {"", DPAddCaps, (LPARAM)DPInfo, DPPrintCaps},
- {"Sessions", DPAddSessions, (LPARAM)0, DPPrintSessions},
- {NULL, 0, 0}
- };
- /****************************************************************************
- ***************************************************************************/
- CAPDEFS DPLocalAppsDef[] =
- {
- {"LocalApplications", DPAddLocalApps, (LPARAM)0, DPPrintLocalApps},
- {NULL, 0, 0}
- };
- //================================================================
- // WinMain - entry point
- //================================================================
- int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
- {
- MSG msg;
- CoInitialize( NULL );
- g_hInstance = hInstance; // Store instance handle in our global variable
- g_idTimer = 0; //Used by DPlay
- g_lpLocalApp = NULL; //Used by DPLay
- // Try to load the dsound.dll
- g_hDSoundLib = LoadLibrary("DSOUND.DLL");
- if (g_hDSoundLib == NULL)
- { // couldn't load the library so put up a message and quit.
- MessageBox(g_hwndMain, "Could not load DSOUND.DLL", g_szAppName, MB_OK);
- CoUninitialize();
- return 0; // terminate after showing the message.
- }
- //Create the initial local app list.
- DPAddLocalApps(0L, 0);
- if (InitInstance(hInstance, lpCmdLine, nCmdShow, DXView_WIDTH, DXView_HEIGHT))
- {
- while(GetMessage(&msg, NULL, 0, 0))
- {
- TranslateMessage(&msg);
- DispatchMessage(&msg);
- }
- }
- if (g_lpLocalApp)
- FreeLocalAppList();
- // Unload dsound.dll
- FreeLibrary(g_hDSoundLib);
- CoUninitialize();
- return(msg.wParam);
- }
- //================================================================
- // InitInstance - create main window
- //================================================================
- BOOL InitInstance(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow, int iWidth, int iHeight)
- {
- WNDCLASS wc;
- wc.style = CS_HREDRAW | CS_VREDRAW; // Class style(s).
- wc.lpfnWndProc = (WNDPROC)WndProc; // Window Procedure
- wc.cbClsExtra = 0; // No per-class extra data.
- wc.cbWndExtra = 0; // No per-window extra data.
- wc.hInstance = hInstance; // Owner of this class
- wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DIRECTX)); // Icon name from .RC
- wc.hCursor = LoadCursor(hInstance, MAKEINTRESOURCE(IDC_SPLIT));// Cursor
- wc.hbrBackground = (HBRUSH)(COLOR_3DFACE+1); // Default color
- wc.lpszMenuName = "Menu"; // Menu name from .RC
- wc.lpszClassName = g_szClassName; // Name to register as
- if(!RegisterClass(&wc))
- {
- return FALSE;
- }
- // Create a main window for this application instance.
- g_hwndMain = CreateWindowEx(
- 0,
- g_szClassName, // See RegisterClass() call.
- g_szTitle, // Text for window title bar.
- WS_OVERLAPPEDWINDOW,// Window style.
- CW_USEDEFAULT, CW_USEDEFAULT, iWidth, iHeight, // Use default positioning
- NULL, // Overlapped windows have no parent.
- NULL, // Use the window class menu.
- hInstance, // This instance owns this window.
- NULL);
- // If window could not be created, return "failure"
- if (! g_hwndMain)
- {
- return(FALSE);
- }
- // Make the window visible; update its client area; and return "success"
- ShowWindow (g_hwndMain, nCmdShow); // Show the window
- return(TRUE); // We succeeded...
- }
- //================================================================
- // WndProc - main window proc
- //================================================================
- LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
- {
- switch(message)
- {
- case WM_CREATE:
- return DXView_OnCreate(hwnd);
- case WM_SIZE:
- DXView_OnSize(hwnd);
- break;
- case WM_LBUTTONDOWN:
- g_bSplitMove = TRUE;
- SetCapture(hwnd);
- break;
- case WM_LBUTTONUP:
- g_bSplitMove = FALSE;
- ReleaseCapture();
- break;
- case WM_MOUSEMOVE:
- if(g_bSplitMove)
- {
- RECT rect;
- // change the value from unsigned to signed
- int x = (int)(short)LOWORD(lParam);
- GetClientRect(hwnd, &rect);
- if (rect.left > x)
- {
- x = rect.left;
- }
- else if (rect.right < x)
- {
- x = rect.right;
- }
- g_xPaneSplit = (x - g_xHalfSplitWidth);
- DXView_OnSize(hwnd);
- }
- break;
- case WM_NOTIFY:
- if (((NMHDR*)lParam)->hwndFrom == g_hwndTV)
- {
- if (((NMHDR*)lParam)->code == TVN_SELCHANGED)
- DXView_OnTreeSelect(g_hwndTV, (NM_TREEVIEW*)lParam);
- }
- if (((NMHDR*)lParam)->hwndFrom == g_hwndLV)
- {
- if (((NMHDR*)lParam)->code == NM_RDBLCLK)
- DXView_OnListViewDblClick(g_hwndLV, (NM_LISTVIEW*)lParam);
- }
- break;
- case WM_TIMER:
- // refresh the session list
- EnumSessions( lpDP3A );
- break;
- case WM_COMMAND: // message: command from application menu
- DXView_OnCommand(hwnd, wParam);
- break;
- case WM_CLOSE:
- DestroyWindow(hwnd);
- return 0;
- case WM_DESTROY: // message: window being destroyed
- DXView_Cleanup(); // Free per item struct for all items
- PostQuitMessage(0);
- break;
- }
- return(DefWindowProc(hwnd, message, wParam, lParam));
- }
- //================================================================
- //================================================================
- BOOL DXView_OnCreate(HWND hwnd)
- {
- HDC hDC;
- int PixelsPerInch;
- TEXTMETRIC tm;
- static TCHAR szBuf[MAX_PATH];
- hDC = GetDC(hwnd);
- PixelsPerInch = GetDeviceCaps(hDC, LOGPIXELSX);
- g_hFont = GetStockObject(ANSI_FIXED_FONT);
- SelectObject(hDC, g_hFont);
- GetTextMetrics(hDC, &tm);
- g_tmAveCharWidth = tm.tmAveCharWidth;
- ReleaseDC(hwnd, hDC);
- // Initialize global data
- g_dwViewState = IDM_VIEWAVAIL;
- g_xPaneSplit = PixelsPerInch * 12 / 4;
- g_xHalfSplitWidth = GetSystemMetrics(SM_CXSIZEFRAME) / 2;
- // Make sure that the common control library read to rock
- InitCommonControls();
- CheckMenuItem(GetMenu(hwnd), g_dwViewState, MF_BYCOMMAND | MF_CHECKED);
- // Create the list view window.
- g_hwndLV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_LISTVIEW, "",
- WS_VISIBLE | WS_CHILD | WS_BORDER | LVS_REPORT,
- 0, 0, 0, 0, hwnd, (HMENU)IDC_LV, g_hInstance, NULL);
- // create the tree view window.
- g_hwndTV = CreateWindowEx(WS_EX_CLIENTEDGE, WC_TREEVIEW, "",
- WS_VISIBLE | WS_CHILD | WS_BORDER | TVS_HASLINES |
- TVS_HASBUTTONS | TVS_LINESATROOT,
- 0, 0, 0, 0, hwnd, (HMENU)IDC_TV, g_hInstance, NULL);
- // create our image list.
- DXView_InitImageList();
- // Initialize the tree view
- DXView_FillTree(g_hwndTV);
- return(TRUE);
- }
- //================================================================
- //================================================================
- IDirectDraw * DDCreate(GUID *pid)
- {
- if (lpDD && pid == ddid)
- return lpDD;
- if (lp3D)
- {
- IDirect3D2_Release(lp3D);
- lp3D = NULL;
- }
- if (lpDD)
- {
- IDirectDraw_Release(lpDD);
- lpDD = NULL;
- }
- // There is no need to create DirectDraw emulation-only just to get
- // the HEL caps. In fact, this will fail if there is another DirectDraw
- // app running and using the hardware.
- if( pid == (GUID *)DDCREATE_EMULATIONONLY )
- {
- pid = NULL;
- }
- if (DirectDrawCreate(pid, &lpDD, NULL) == DD_OK)
- {
- IDirectDraw_QueryInterface(lpDD,&IID_IDirect3D2,&lp3D);
- ddid = pid;
- return lpDD;
- }
- if(!g_PrintToFile)
- MessageBox(g_hwndMain, "DirectDrawCreate failed.", g_szAppName, MB_OK);
- return NULL;
- }
- //================================================================
- //================================================================
- IDirectSound * DSCreate(GUID *pid)
- {
- PFN_DSCREATE pfn_DSCreate;
- if (lpDS && pid == dsid)
- return lpDS;
- if (lpDS)
- {
- IDirectSound_Release(lpDS);
- lpDS = NULL;
- }
- // Call DirectSoundCreate.
- pfn_DSCreate = (PFN_DSCREATE)GetProcAddress(g_hDSoundLib, "DirectSoundCreate");
- if (pfn_DSCreate == NULL)
- {
- MessageBox(g_hwndMain, "DSOUND.DLL does not implement DirectSoundCreate()", g_szAppName, MB_OK);
- return NULL;
- }
- if ((*pfn_DSCreate)(pid, &lpDS, NULL) == DD_OK)
- {
- dsid = pid;
- return lpDS;
- }
- if(!g_PrintToFile)
- MessageBox(g_hwndMain, "DirectSoundCreate failed.", g_szAppName, MB_OK);
- return NULL;
- }
- //================================================================
- //================================================================
- IDirectSoundCapture * DSCCreate(GUID *pid)
- {
- PFN_DSCCREATE pfn_DSCCreate;
- if (lpDSC && pid == dsid)
- return lpDSC;
- if (lpDSC)
- {
- IDirectSoundCapture_Release(lpDSC);
- lpDSC = NULL;
- }
- pfn_DSCCreate = (PFN_DSCCREATE)GetProcAddress(g_hDSoundLib, "DirectSoundCaptureCreate");
- if (pfn_DSCCreate == NULL)
- {
- MessageBox(g_hwndMain, "DSOUND.DLL does not implement DirectSoundCaptureCreate()", g_szAppName, MB_OK);
- return NULL;
- }
- if ((*pfn_DSCCreate)(pid, &lpDSC, NULL) == DD_OK)
- {
- dscid = pid;
- return lpDSC;
- }
- if(!g_PrintToFile)
- MessageBox(g_hwndMain, "DirectSoundCaptureCreate failed.", g_szAppName, MB_OK);
- return NULL;
- }
- //================================================================
- //================================================================
- IDirectPlay3 * DPCreate(GUID *pid)
- {
- LPDIRECTPLAY lpDP = NULL;
- HRESULT hr;
- if (lpDP3A && pid == dpid)
- return lpDP3A;
- if (lpDP3A)
- {
- lpDP3A->lpVtbl->Release(lpDP3A);
- lpDP3A = NULL;
- }
- if (DirectPlayCreate(pid, &lpDP, NULL) == DD_OK)
- {
- hr = lpDP->lpVtbl->QueryInterface( lpDP, &IID_IDirectPlay3A, (LPVOID *) &lpDP3A );
- lpDP->lpVtbl->Release(lpDP);
- dpid = pid;
- return lpDP3A;
- }
- if(!g_PrintToFile)
- MessageBox(g_hwndMain, "DirectPlayCreate failed.", g_szAppName, MB_OK);
- return NULL;
- }
- //================================================================
- //================================================================
- void AddCapsToTV(HTREEITEM hRoot, CAPDEFS *pcds, LPARAM lParam1)
- {
- HTREEITEM hTree;
- HTREEITEM hParent[20];
- char *name;
- int level=0;
- BOOL fRoot = TRUE; // the first one is always a root
- hParent[0] = hRoot;
- while (name = pcds->szName)
- {
- if (*name == '-')
- {
- level--;
- name++;
- }
- if (*name == '+')
- {
- fRoot = TRUE;
- name++;
- }
- if (*name)
- {
- hTree = TVAddNode(hParent[level], name, fRoot, IDI_CAPS,
- pcds->Callback, lParam1,
- pcds->lParam2, pcds->printCallback);
- if (fRoot)
- {
- level++;
- hParent[level] = hTree;
- fRoot = FALSE;
- }
- }
- pcds++; // Get next Cap bit definition
- }
- }
- //================================================================
- //================================================================
- char c_szYes[] = "Yes";
- char c_szNo[] = "No";
- char c_szCurrentMode[] = "Current Mode";
- //================================================================
- // AddMoreCapsToLV is like AddCapsToLV, except it doesn't add the
- // column headers like AddCapsToLV does.
- //================================================================
- void AddMoreCapsToLV(CAPDEF *pcd, LPVOID pv)
- {
- DWORD dwValue;
- while(pcd->szName && *pcd->szName)
- {
- dwValue = *(DWORD *)(((BYTE *)pv) + pcd->dwOffset);
- if (pcd->dwFlag == 0)
- {
- LVAddText(g_hwndLV, 0, "%s", pcd->szName);
- LVAddText(g_hwndLV, 1, "%d", dwValue);
- }
- else if (pcd->dwFlag == 0xFFFFFFFF) // hex
- {
- LVAddText(g_hwndLV, 0, "%s", pcd->szName);
- LVAddText(g_hwndLV, 1, "0x%08X", dwValue);
- }
- else
- {
- if (pcd->dwFlag & dwValue)
- {
- LVAddText(g_hwndLV, 0, pcd->szName);
- LVAddText(g_hwndLV, 1, c_szYes);
- }
- else if (g_dwViewState == IDM_VIEWALL)
- {
- LVAddText(g_hwndLV, 0, pcd->szName);
- LVAddText(g_hwndLV, 1, c_szNo);
- }
- }
- pcd++; // Get next Cap bit definition
- }
- }
- //================================================================
- // AddColsToLV adds the column headers but no data.
- //================================================================
- void AddColsToLV(void)
- {
- LVAddColumn(g_hwndLV, 0, "Name", 24);
- LVAddColumn(g_hwndLV, 1, "Value", 10);
- }
- //================================================================
- //================================================================
- void AddCapsToLV(CAPDEF *pcd, LPVOID pv)
- {
- AddColsToLV();
- AddMoreCapsToLV(pcd, pv);
- }
- //================================================================
- //================================================================
- BOOL PrintCapsToDC(CAPDEF *pcd, LPVOID pv, PRINTCBINFO * lpInfo)
- {
- DWORD dwValue;
- DWORD cchLen;
- int xName, xVal, yLine;
- // Check Parameters
- if ((! pcd) || (!lpInfo))
- return FALSE;
- // Calculate Name and Value column x offsets
- xName = (lpInfo->dwCurrIndent * DEF_TAB_SIZE * lpInfo->dwCharWidth);
- xVal = xName + (32 * lpInfo->dwCharWidth);
- while (pcd->szName && *pcd->szName)
- {
- dwValue = *(DWORD *)(((BYTE *)pv) + pcd->dwOffset);
- yLine = lpInfo->dwCurrLine * lpInfo->dwLineHeight;
- if (pcd->dwFlag)
- {
- if (pcd->dwFlag & dwValue)
- {
- // Print Name
- cchLen = _tcslen (pcd->szName);
- if (! PrintLine (xName, yLine, pcd->szName, cchLen, lpInfo))
- return FALSE;
- // Print Yes in value column
- cchLen = _tcslen (c_szYes);
- if (! PrintLine (xVal, yLine, c_szYes, cchLen, lpInfo))
- return FALSE;
- // Advance to next line on page
- if (! PrintNextLine (lpInfo))
- return FALSE;
- }
- else if (g_dwViewState == IDM_VIEWALL)
- {
- // Print name
- cchLen = _tcslen (pcd->szName);
- if (! PrintLine (xName, yLine, pcd->szName, cchLen, lpInfo))
- return FALSE;
- // Print No in value column
- cchLen = _tcslen (c_szNo);
- if (! PrintLine (xVal, yLine, c_szNo, cchLen, lpInfo))
- return FALSE;
- // Advance to next line on page
- if (! PrintNextLine (lpInfo))
- return FALSE;
- }
- }
- else
- {
- char szBuff[80];
- // Print name
- wsprintf (szBuff, pcd->szName, "test");
- cchLen = _tcslen (pcd->szName);
- if (! PrintLine (xName, yLine, szBuff, cchLen, lpInfo))
- return FALSE;
- // Print value
- wsprintf (szBuff, "%d", dwValue);
- cchLen = _tcslen (szBuff);
- if (! PrintLine (xVal, yLine, szBuff, cchLen, lpInfo))
- return FALSE;
- // Advance to next line on page
- if (! PrintNextLine (lpInfo))
- return FALSE;
- }
- pcd++; // Get next Cap bit definition
- }
- // Success
- return TRUE;
- } // End PrintCapsToDC
- //================================================================
- //================================================================
- void DDAddCaps(LPARAM lParam1, LPARAM lParam2)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DDCreate((GUID*)lParam1))
- {
- DDCAPS ddcaps;
- ddcaps.dwSize = sizeof(ddcaps);
- if (lParam1 == DDCREATE_EMULATIONONLY)
- IDirectDraw_GetCaps(lpDD, NULL, &ddcaps);
- else
- IDirectDraw_GetCaps(lpDD, &ddcaps, NULL);
- AddCapsToLV((CAPDEF *)lParam2, (LPVOID)&ddcaps);
- }
- }
- //================================================================
- //================================================================
- BOOL DDPrintCaps(LPARAM lParam1, LPARAM lParam2, PRINTCBINFO * lpInfo)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DDCreate((GUID*)lParam1))
- {
- DDCAPS ddcaps;
- ddcaps.dwSize = sizeof(ddcaps);
- if (lParam1 == DDCREATE_EMULATIONONLY)
- IDirectDraw_GetCaps(lpDD, NULL, &ddcaps);
- else
- IDirectDraw_GetCaps(lpDD, &ddcaps, NULL);
- // Print DirectDraw caps
- return PrintCapsToDC((CAPDEF *)lParam2, (LPVOID)&ddcaps, lpInfo);
- }
- // DDCreate failed but keep printing
- return TRUE;
- }
- //================================================================
- //================================================================
- void DSAddCaps(LPARAM lParam1, LPARAM lParam2)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DSCreate((GUID*)lParam1))
- {
- DSCAPS dscaps;
- dscaps.dwSize = sizeof(dscaps);
- IDirectSound_GetCaps(lpDS, &dscaps);
- AddCapsToLV((CAPDEF *)lParam2, (LPVOID)&dscaps);
- }
- }
- //================================================================
- //================================================================
- BOOL DSPrintCaps(LPARAM lParam1, LPARAM lParam2, PRINTCBINFO * lpInfo)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DSCreate((GUID*)lParam1))
- {
- DSCAPS dscaps;
- dscaps.dwSize = sizeof(dscaps);
- IDirectSound_GetCaps(lpDS, &dscaps);
- // Print DirectSound Caps
- return PrintCapsToDC((CAPDEF *)lParam2, (LPVOID)&dscaps, lpInfo);
- }
- // DSCreate failed but keep printing
- return TRUE;
- }
- //================================================================
- //================================================================
- void DSCAddCaps(LPARAM lParam1, LPARAM lParam2)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DSCCreate((GUID*)lParam1))
- {
- DSCCAPS dsccaps;
- dsccaps.dwSize = sizeof(dsccaps);
- IDirectSoundCapture_GetCaps(lpDSC, &dsccaps);
- AddCapsToLV((CAPDEF *)lParam2, (LPVOID)&dsccaps);
- }
- }
- //================================================================
- //================================================================
- BOOL DSCPrintCaps(LPARAM lParam1, LPARAM lParam2, PRINTCBINFO * lpInfo)
- {
- // lParam1 is the GUID for the driver we should open
- // lParam2 is the CAPDEF table we should use
- if (DSCCreate((GUID*)lParam1))
- {
- DSCCAPS dsccaps;
- dsccaps.dwSize = sizeof(dsccaps);
- IDirectSoundCapture_GetCaps(lpDSC, &dsccaps);
- // Print DirectSound Caps
- return PrintCapsToDC((CAPDEF *)lParam2, (LPVOID)&dsccaps, lpInfo);
- }
- // DSCCreate failed but keep printing
- return TRUE;
- }