www.pudn.com > Win32DirectX9.rar
To Read all the content
[file head]:
//-----------------------------------------------------------------------------
// File: D3DSaver.cpp
//
// Desc: Framework for screensavers that use Direct3D.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#include <Windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <stdio.h>
#include <tchar.h>
#include <regstr.h>
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
#include <mmsystem.h>
#include <D3DX9.h>
#include "D3DSaver.h"
#include "dxutil.h"
// Resource IDs. D3DSaver assumes that you will create resources with
// these IDs that it can use. The easiest way to do this is to copy
// the resources from the rc file of an existing D3DSaver-based program.
#define IDI_MAIN_ICON 101
#define IDD_SINGLEMONITORSETTINGS 200
#define IDD_MULTIMONITORSETTINGS 201
#define IDC_MONITORSTAB 2000
#define IDC_TABNA
... ...
[file tail]:
... ...
o->dwNumModes; iMode++ )
{
DWORD dwBitDepth;
TCHAR strMode[80];
DWORD dwItem;
pD3DModeInfo = &amt;pD3DDeviceInfo->modes[iMode];
dwBitDepth = 16;
if( pD3DModeInfo->Format == D3DFMT_X8R8G8B8 ||
pD3DModeInfo->Format == D3DFMT_A8R8G8B8 ||
pD3DModeInfo->Format == D3DFMT_R8G8B8 )
{
dwBitDepth = 32;
}
wsprintf( strMode, strModeFmt, pD3DModeInfo->Width,
pD3DModeInfo->Height, dwBitDepth );
dwItem = ComboBox_AddString( hwndModeList, strMode );
ComboBox_SetItemData( hwndModeList, dwItem, iMode );
if( pD3DModeInfo->Width == pD3DAdapterInfo->dwUserPrefWidth &amt;&amt;
pD3DModeInfo->Height == pD3DAdapterInfo->dwUserPrefHeight &amt;&amt;
pD3DModeInfo->Format == pD3DAdapterInfo->d3dfmtUserPrefFormat )
{
iSelInitial = dwItem;
}
}
ComboBox_SetCurSel( hwndModeList, iSelInitial );
}