Author: gbrunmar
Date: Wed Mar 4 23:34:17 2009
New Revision: 39875
URL:
http://svn.reactos.org/svn/reactos?rev=39875&view=rev
Log:
Added stubs for Direct3D 7, 8 and 9 tests in dxdiag.
Added:
trunk/reactos/base/applications/dxdiag/d3dtest.c (with props)
trunk/reactos/base/applications/dxdiag/d3dtest7.c (with props)
trunk/reactos/base/applications/dxdiag/d3dtest8.c (with props)
trunk/reactos/base/applications/dxdiag/d3dtest9.c (with props)
Modified:
trunk/reactos/base/applications/dxdiag/ddtest.c
trunk/reactos/base/applications/dxdiag/display.c
trunk/reactos/base/applications/dxdiag/dxdiag.rbuild
trunk/reactos/base/applications/dxdiag/input.c
trunk/reactos/base/applications/dxdiag/lang/en-US.rc
trunk/reactos/base/applications/dxdiag/precomp.h
trunk/reactos/base/applications/dxdiag/resource.h
trunk/reactos/base/applications/dxdiag/sound.c
Added: trunk/reactos/base/applications/dxdiag/d3dtest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/d3dtest.c (added)
+++ trunk/reactos/base/applications/dxdiag/d3dtest.c [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -1,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);
+}
Propchange: trunk/reactos/base/applications/dxdiag/d3dtest.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/applications/dxdiag/d3dtest7.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/d3dtest7.c (added)
+++ trunk/reactos/base/applications/dxdiag/d3dtest7.c [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -1,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;
+}
Propchange: trunk/reactos/base/applications/dxdiag/d3dtest7.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/applications/dxdiag/d3dtest8.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/d3dtest8.c (added)
+++ trunk/reactos/base/applications/dxdiag/d3dtest8.c [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -1,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;
+}
Propchange: trunk/reactos/base/applications/dxdiag/d3dtest8.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/base/applications/dxdiag/d3dtest9.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/d3dtest9.c (added)
+++ trunk/reactos/base/applications/dxdiag/d3dtest9.c [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -1,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;
+}
Propchange: trunk/reactos/base/applications/dxdiag/d3dtest9.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/base/applications/dxdiag/ddtest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/ddtest.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/ddtest.c [iso-8859-1] Wed Mar 4 23:34:17 2009
@@ -13,7 +13,7 @@
BOOL DDOffscreenBufferTest(HWND hWnd, BOOL Fullscreen);
VOID DDRedrawFrame(LPDIRECTDRAWSURFACE lpDDSurface);
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 WIDTH 640
@@ -365,7 +365,7 @@
}
}
-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);
}
Modified: trunk/reactos/base/applications/dxdiag/display.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/display.c [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -8,6 +8,7 @@
*/
#include "precomp.h"
+#include <d3d9.h>
#include <initguid.h>
#include <devguid.h>
@@ -379,9 +380,13 @@
switch(LOWORD(wParam))
{
case IDC_BUTTON_TESTDD:
+ case IDC_BUTTON_TEST3D:
GetWindowRect(pContext->hMainDialog, &rect);
/* 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);
break;
}
Modified: trunk/reactos/base/applications/dxdiag/dxdiag.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/d…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/dxdiag.rbuild [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/dxdiag.rbuild [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -28,5 +28,9 @@
<file>dxdiag.c</file>
<file>dxdiag.rc</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>
</module>
Modified: trunk/reactos/base/applications/dxdiag/input.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/i…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/input.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/input.c [iso-8859-1] Wed Mar 4 23:34:17 2009
@@ -8,6 +8,7 @@
*/
#include "precomp.h"
+#include <dinput.h>
typedef struct
{
Modified: trunk/reactos/base/applications/dxdiag/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/l…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/lang/en-US.rc [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/lang/en-US.rc [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -92,7 +92,7 @@
PUSHBUTTON "Enable", IDC_BUTTON_D3D, 170, 140, 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 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
EDITTEXT IDC_TEXT_INFO, 20, 192, 432, 20, WS_DISABLED | WS_TABSTOP
@@ -221,4 +221,6 @@
IDS_FORMAT_ADAPTER_MEM "%u MB"
IDS_FORMAT_ADAPTER_MODE "%04u x %04u (%u bit)(%uHz)"
IDS_OPTION_NO "No"
-END
+ IDS_D3DTEST_DESCRIPTION "This will start Direct3D interface test. Continue?"
+ IDS_D3DTEST_D3Dx "This test will use hardware-accelerated Direct3D %u
interface."
+END
Modified: trunk/reactos/base/applications/dxdiag/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/p…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/precomp.h [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -11,12 +11,8 @@
#include <mmsystem.h>
#include <setupapi.h>
#include <commctrl.h>
-#include <dinput.h>
-#include <d3d9.h>
#include <ddraw.h>
-
-#include <dsound.h>
#include <mmreg.h>
#include <wintrust.h>
#include <softpub.h>
@@ -49,6 +45,9 @@
/* DirectDraw tests */
VOID DDTests();
+/* Direct3D tests */
+VOID D3DTests();
+
/* DirectSound initialization */
void InitializeDirectSoundPage(PDXDIAG_CONTEXT pContext);
Modified: trunk/reactos/base/applications/dxdiag/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/r…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/resource.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/resource.h [iso-8859-1] Wed Mar 4 23:34:17
2009
@@ -130,13 +130,15 @@
#define IDS_DDPRIMARY_DESCRIPTION 10118
#define IDS_DDPRIMARY_RESULT 10119
#define IDS_DDOFFSCREEN_DESCRIPTION 10120
-#define IDS_DDOFFSCREEN_RESULT 10121
+#define IDS_DDOFFSCREEN_RESULT 10121
#define IDS_DDFULLSCREEN_DESCRIPTION 10122
#define IDS_DDFULLSCREEN_RESULT 10123
#define IDS_DDTEST_TITLE 10124
#define IDS_FORMAT_ADAPTER_MEM 10125
#define IDS_FORMAT_ADAPTER_MODE 10126
#define IDS_OPTION_NO 10127
+#define IDS_D3DTEST_DESCRIPTION 10128
+#define IDS_D3DTEST_D3Dx 10129
/* icon resource constants */
#define IDI_APPICON 20000
Modified: trunk/reactos/base/applications/dxdiag/sound.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/dxdiag/s…
==============================================================================
--- trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/dxdiag/sound.c [iso-8859-1] Wed Mar 4 23:34:17 2009
@@ -8,8 +8,8 @@
*/
#include "precomp.h"
-//#include <initguid.h>
#include <devguid.h>
+#include <dsound.h>
#if 0
BOOL