mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +00:00
Added stubs for Direct3D 7, 8 and 9 tests in dxdiag.
svn path=/trunk/; revision=39875
This commit is contained in:
parent
3804c261a6
commit
78cc4931af
12 changed files with 192 additions and 10 deletions
124
reactos/base/applications/dxdiag/d3dtest.c
Normal file
124
reactos/base/applications/dxdiag/d3dtest.c
Normal file
|
@ -0,0 +1,124 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactX Diagnosis Application
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: base/applications/dxdiag/d3dtest.c
|
||||||
|
* PURPOSE: ReactX Direct3D 7, 8 and 9 tests
|
||||||
|
* PROGRAMMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#define WIDTH 800
|
||||||
|
#define HEIGHT 600
|
||||||
|
|
||||||
|
BOOL D3D7Test(HWND hWnd);
|
||||||
|
BOOL D3D8Test(HWND hWnd);
|
||||||
|
BOOL D3D9Test(HWND hWnd);
|
||||||
|
|
||||||
|
BOOL StartD3DTest(HWND hWnd, HINSTANCE hInstance, WCHAR* pszCaption, INT TestNr)
|
||||||
|
{
|
||||||
|
WCHAR szTestDescriptionRaw[256];
|
||||||
|
WCHAR szTestDescription[256];
|
||||||
|
WCHAR szCaption[256];
|
||||||
|
WCHAR szResult[256];
|
||||||
|
WCHAR szError[256];
|
||||||
|
BOOL Result;
|
||||||
|
|
||||||
|
LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
|
||||||
|
LoadStringW(hInstance, IDS_DDTEST_ERROR, szError, sizeof(szError) / sizeof(WCHAR));
|
||||||
|
LoadStringW(hInstance, IDS_D3DTEST_D3Dx, szTestDescriptionRaw, sizeof(szTestDescriptionRaw) / sizeof(WCHAR));
|
||||||
|
//LoadStringW(hInstance, resResult, szResult, sizeof(szResult) / sizeof(WCHAR));
|
||||||
|
|
||||||
|
swprintf(szTestDescription, szTestDescriptionRaw, TestNr);
|
||||||
|
if (MessageBox(NULL, szTestDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
ShowWindow(hWnd, SW_SHOW);
|
||||||
|
|
||||||
|
switch(TestNr){
|
||||||
|
case 7:
|
||||||
|
Result = D3D7Test(hWnd);
|
||||||
|
break;
|
||||||
|
case 8:
|
||||||
|
Result = D3D8Test(hWnd);
|
||||||
|
break;
|
||||||
|
case 9:
|
||||||
|
Result = D3D9Test(hWnd);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Result = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowWindow(hWnd, SW_HIDE);
|
||||||
|
|
||||||
|
if(!Result)
|
||||||
|
{
|
||||||
|
MessageBox(NULL, szError, szCaption, MB_OK | MB_ICONERROR);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(MessageBox(NULL, szResult, szCaption, MB_YESNO | MB_ICONQUESTION) == IDYES)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
|
{
|
||||||
|
return DefWindowProc(hWnd, msg, wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID D3DTests()
|
||||||
|
{
|
||||||
|
WNDCLASSEX winClass;
|
||||||
|
HWND hWnd;
|
||||||
|
HINSTANCE hInstance = GetModuleHandle(NULL);
|
||||||
|
WCHAR szDescription[256];
|
||||||
|
WCHAR szCaption[256];
|
||||||
|
|
||||||
|
winClass.cbSize = sizeof(WNDCLASSEX);
|
||||||
|
winClass.style = CS_DBLCLKS | CS_OWNDC | CS_HREDRAW | CS_VREDRAW;
|
||||||
|
winClass.lpfnWndProc = WindowProc;
|
||||||
|
winClass.cbClsExtra = 0;
|
||||||
|
winClass.cbWndExtra = 0;
|
||||||
|
winClass.hInstance = hInstance;
|
||||||
|
winClass.hIcon = 0;
|
||||||
|
winClass.hCursor = 0;
|
||||||
|
winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
|
||||||
|
winClass.lpszMenuName = NULL;
|
||||||
|
winClass.lpszClassName = L"d3dtest";
|
||||||
|
winClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
|
||||||
|
|
||||||
|
if (!RegisterClassEx(&winClass))
|
||||||
|
return;
|
||||||
|
|
||||||
|
hWnd = CreateWindowEx(
|
||||||
|
0,
|
||||||
|
winClass.lpszClassName,
|
||||||
|
NULL,
|
||||||
|
WS_POPUP,
|
||||||
|
(GetSystemMetrics(SM_CXSCREEN) - WIDTH)/2,
|
||||||
|
(GetSystemMetrics(SM_CYSCREEN) - HEIGHT)/2,
|
||||||
|
WIDTH,
|
||||||
|
HEIGHT,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
hInstance,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
if (!hWnd)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
LoadStringW(hInstance, IDS_D3DTEST_DESCRIPTION, szDescription, sizeof(szDescription) / sizeof(WCHAR));
|
||||||
|
LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
|
||||||
|
if(MessageBox(NULL, szDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
StartD3DTest(hWnd, hInstance, szCaption, 7);
|
||||||
|
StartD3DTest(hWnd, hInstance, szCaption, 8);
|
||||||
|
StartD3DTest(hWnd, hInstance, szCaption, 9);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
DestroyWindow(hWnd);
|
||||||
|
UnregisterClass(winClass.lpszClassName, hInstance);
|
||||||
|
}
|
15
reactos/base/applications/dxdiag/d3dtest7.c
Normal file
15
reactos/base/applications/dxdiag/d3dtest7.c
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactX Diagnosis Application
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: base/applications/dxdiag/d3dtest7.c
|
||||||
|
* PURPOSE: ReactX Direct3D 7 tests
|
||||||
|
* PROGRAMMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
#include <d3d.h>
|
||||||
|
|
||||||
|
BOOL D3D7Test(HWND hWnd)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
15
reactos/base/applications/dxdiag/d3dtest8.c
Normal file
15
reactos/base/applications/dxdiag/d3dtest8.c
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactX Diagnosis Application
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: base/applications/dxdiag/d3dtest8.c
|
||||||
|
* PURPOSE: ReactX Direct3D 8 tests
|
||||||
|
* PROGRAMMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
#include <d3d8.h>
|
||||||
|
|
||||||
|
BOOL D3D8Test(HWND hWnd)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
15
reactos/base/applications/dxdiag/d3dtest9.c
Normal file
15
reactos/base/applications/dxdiag/d3dtest9.c
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
/*
|
||||||
|
* PROJECT: ReactX Diagnosis Application
|
||||||
|
* LICENSE: GPL - See COPYING in the top level directory
|
||||||
|
* FILE: base/applications/dxdiag/d3dtest9.c
|
||||||
|
* PURPOSE: ReactX Direct3D 9 tests
|
||||||
|
* PROGRAMMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "precomp.h"
|
||||||
|
#include <d3d9.h>
|
||||||
|
|
||||||
|
BOOL D3D9Test(HWND hWnd)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
|
@ -13,7 +13,7 @@ BOOL DDPrimarySurfaceTest(HWND hWnd);
|
||||||
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen);
|
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen);
|
||||||
VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface);
|
VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface);
|
||||||
VOID DDUpdateFrame(LPDIRECTDRAWSURFACE lpDDPrimarySurface ,LPDIRECTDRAWSURFACE lpDDBackBuffer, BOOL Fullscreen, INT *posX, INT *posY, INT *gainX, INT *gainY, RECT *rectDD);
|
VOID DDUpdateFrame(LPDIRECTDRAWSURFACE lpDDPrimarySurface ,LPDIRECTDRAWSURFACE lpDDBackBuffer, BOOL Fullscreen, INT *posX, INT *posY, INT *gainX, INT *gainY, RECT *rectDD);
|
||||||
LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||||
|
|
||||||
#define TEST_DURATION 10000
|
#define TEST_DURATION 10000
|
||||||
#define WIDTH 640
|
#define WIDTH 640
|
||||||
|
@ -365,7 +365,7 @@ VOID DDUpdateFrame(LPDIRECTDRAWSURFACE lpDDPrimarySurface ,LPDIRECTDRAWSURFACE l
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
return DefWindowProc(hWnd, msg, wParam, lParam);
|
return DefWindowProc(hWnd, msg, wParam, lParam);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
#include <d3d9.h>
|
||||||
#include <initguid.h>
|
#include <initguid.h>
|
||||||
#include <devguid.h>
|
#include <devguid.h>
|
||||||
|
|
||||||
|
@ -379,9 +380,13 @@ DisplayPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
switch(LOWORD(wParam))
|
switch(LOWORD(wParam))
|
||||||
{
|
{
|
||||||
case IDC_BUTTON_TESTDD:
|
case IDC_BUTTON_TESTDD:
|
||||||
|
case IDC_BUTTON_TEST3D:
|
||||||
GetWindowRect(pContext->hMainDialog, &rect);
|
GetWindowRect(pContext->hMainDialog, &rect);
|
||||||
/* FIXME log result errors */
|
/* FIXME log result errors */
|
||||||
DDTests();
|
if (IDC_BUTTON_TESTDD == LOWORD(wParam))
|
||||||
|
DDTests();
|
||||||
|
else if (IDC_BUTTON_TEST3D == LOWORD(wParam))
|
||||||
|
D3DTests();
|
||||||
SetWindowPos(pContext->hMainDialog, NULL, rect.left, rect.top, rect.right, rect.bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
|
SetWindowPos(pContext->hMainDialog, NULL, rect.left, rect.top, rect.right, rect.bottom, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOSIZE | SWP_NOZORDER);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,5 +28,9 @@
|
||||||
<file>dxdiag.c</file>
|
<file>dxdiag.c</file>
|
||||||
<file>dxdiag.rc</file>
|
<file>dxdiag.rc</file>
|
||||||
<file>ddtest.c</file>
|
<file>ddtest.c</file>
|
||||||
|
<file>d3dtest.c</file>
|
||||||
|
<file>d3dtest7.c</file>
|
||||||
|
<file>d3dtest8.c</file>
|
||||||
|
<file>d3dtest9.c</file>
|
||||||
<pch>precomp.h</pch>
|
<pch>precomp.h</pch>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
#include <dinput.h>
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,7 +92,7 @@ BEGIN
|
||||||
PUSHBUTTON "Enable", IDC_BUTTON_D3D, 170, 140, 60, 14, WS_DISABLED
|
PUSHBUTTON "Enable", IDC_BUTTON_D3D, 170, 140, 60, 14, WS_DISABLED
|
||||||
PUSHBUTTON "Enable", IDC_BUTTON_AGP, 170, 156, 60, 14, WS_DISABLED
|
PUSHBUTTON "Enable", IDC_BUTTON_AGP, 170, 156, 60, 14, WS_DISABLED
|
||||||
PUSHBUTTON "Test DirectDraw", IDC_BUTTON_TESTDD, 250, 124, 80, 14
|
PUSHBUTTON "Test DirectDraw", IDC_BUTTON_TESTDD, 250, 124, 80, 14
|
||||||
PUSHBUTTON "Test Direct3D", IDC_BUTTON_TEST3D, 250, 140, 80, 14, WS_DISABLED
|
PUSHBUTTON "Test Direct3D", IDC_BUTTON_TEST3D, 250, 140, 80, 14
|
||||||
|
|
||||||
GROUPBOX "Notes", -1, 10, 180, 450, 40
|
GROUPBOX "Notes", -1, 10, 180, 450, 40
|
||||||
EDITTEXT IDC_TEXT_INFO, 20, 192, 432, 20, WS_DISABLED | WS_TABSTOP
|
EDITTEXT IDC_TEXT_INFO, 20, 192, 432, 20, WS_DISABLED | WS_TABSTOP
|
||||||
|
@ -221,4 +221,6 @@ BEGIN
|
||||||
IDS_FORMAT_ADAPTER_MEM "%u MB"
|
IDS_FORMAT_ADAPTER_MEM "%u MB"
|
||||||
IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
|
IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
|
||||||
IDS_OPTION_NO "No"
|
IDS_OPTION_NO "No"
|
||||||
|
IDS_D3DTEST_DESCRIPTION "This will start Direct3D interface test. Continue?"
|
||||||
|
IDS_D3DTEST_D3Dx "This test will use hardware-accelerated Direct3D %u interface."
|
||||||
END
|
END
|
||||||
|
|
|
@ -11,12 +11,8 @@
|
||||||
#include <mmsystem.h>
|
#include <mmsystem.h>
|
||||||
#include <setupapi.h>
|
#include <setupapi.h>
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
#include <dinput.h>
|
|
||||||
#include <d3d9.h>
|
|
||||||
#include <ddraw.h>
|
#include <ddraw.h>
|
||||||
|
|
||||||
|
|
||||||
#include <dsound.h>
|
|
||||||
#include <mmreg.h>
|
#include <mmreg.h>
|
||||||
#include <wintrust.h>
|
#include <wintrust.h>
|
||||||
#include <softpub.h>
|
#include <softpub.h>
|
||||||
|
@ -49,6 +45,9 @@ INT_PTR CALLBACK HelpPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
|
||||||
/* DirectDraw tests */
|
/* DirectDraw tests */
|
||||||
VOID DDTests();
|
VOID DDTests();
|
||||||
|
|
||||||
|
/* Direct3D tests */
|
||||||
|
VOID D3DTests();
|
||||||
|
|
||||||
/* DirectSound initialization */
|
/* DirectSound initialization */
|
||||||
void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext);
|
void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext);
|
||||||
|
|
||||||
|
|
|
@ -130,13 +130,15 @@
|
||||||
#define IDS_DDPRIMARY_DESCRIPTION 10118
|
#define IDS_DDPRIMARY_DESCRIPTION 10118
|
||||||
#define IDS_DDPRIMARY_RESULT 10119
|
#define IDS_DDPRIMARY_RESULT 10119
|
||||||
#define IDS_DDOFFSCREEN_DESCRIPTION 10120
|
#define IDS_DDOFFSCREEN_DESCRIPTION 10120
|
||||||
#define IDS_DDOFFSCREEN_RESULT 10121
|
#define IDS_DDOFFSCREEN_RESULT 10121
|
||||||
#define IDS_DDFULLSCREEN_DESCRIPTION 10122
|
#define IDS_DDFULLSCREEN_DESCRIPTION 10122
|
||||||
#define IDS_DDFULLSCREEN_RESULT 10123
|
#define IDS_DDFULLSCREEN_RESULT 10123
|
||||||
#define IDS_DDTEST_TITLE 10124
|
#define IDS_DDTEST_TITLE 10124
|
||||||
#define IDS_FORMAT_ADAPTER_MEM 10125
|
#define IDS_FORMAT_ADAPTER_MEM 10125
|
||||||
#define IDS_FORMAT_ADAPTER_MODE 10126
|
#define IDS_FORMAT_ADAPTER_MODE 10126
|
||||||
#define IDS_OPTION_NO 10127
|
#define IDS_OPTION_NO 10127
|
||||||
|
#define IDS_D3DTEST_DESCRIPTION 10128
|
||||||
|
#define IDS_D3DTEST_D3Dx 10129
|
||||||
|
|
||||||
/* icon resource constants */
|
/* icon resource constants */
|
||||||
#define IDI_APPICON 20000
|
#define IDI_APPICON 20000
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
//#include <initguid.h>
|
|
||||||
#include <devguid.h>
|
#include <devguid.h>
|
||||||
|
#include <dsound.h>
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
BOOL
|
BOOL
|
||||||
|
|
Loading…
Reference in a new issue