ReactOS 0.4.15-dev-8096-ga0eec98
d3dtest.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactX Diagnosis Application
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: base/applications/dxdiag/d3dtest.c
5 * PURPOSE: ReactX Direct3D 7, 8 and 9 tests
6 * PROGRAMMERS: Gregor Gullwi <gbrunmar (dot) ros (at) gmail (dot) com>
7 */
8
9#include "precomp.h"
10
11#include <stdio.h>
12
13#define WIDTH 800
14#define HEIGHT 600
15
19
21{
22 WCHAR szTestDescriptionRaw[256];
23 WCHAR szTestDescription[256];
24 WCHAR szCaption[256];
25 WCHAR szResult[256];
26 WCHAR szError[256];
28
29 LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
30 LoadStringW(hInstance, IDS_DDTEST_ERROR, szError, sizeof(szError) / sizeof(WCHAR));
31 LoadStringW(hInstance, IDS_D3DTEST_D3Dx, szTestDescriptionRaw, sizeof(szTestDescriptionRaw) / sizeof(WCHAR));
32 //LoadStringW(hInstance, resResult, szResult, sizeof(szResult) / sizeof(WCHAR));
33
34 swprintf(szTestDescription, szTestDescriptionRaw, TestNr);
35 if (MessageBox(NULL, szTestDescription, szCaption, MB_YESNO | MB_ICONQUESTION) == IDNO)
36 return FALSE;
37
39
40 switch(TestNr){
41 case 7:
43 break;
44 case 8:
46 break;
47 case 9:
49 break;
50 default:
51 Result = FALSE;
52 }
53
55
56 if(!Result)
57 {
58 MessageBox(NULL, szError, szCaption, MB_OK | MB_ICONERROR);
59 return FALSE;
60 }
61
62 if(MessageBox(NULL, szResult, szCaption, MB_YESNO | MB_ICONQUESTION) == IDYES)
63 return TRUE;
64
65 return FALSE;
66}
67
69{
71}
72
74{
75 WNDCLASSEX winClass;
76 HWND hWnd;
79 WCHAR szCaption[256];
80
81 winClass.cbSize = sizeof(WNDCLASSEX);
83 winClass.lpfnWndProc = WindowProc;
84 winClass.cbClsExtra = 0;
85 winClass.cbWndExtra = 0;
86 winClass.hInstance = hInstance;
87 winClass.hIcon = 0;
88 winClass.hCursor = 0;
89 winClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
90 winClass.lpszMenuName = NULL;
91 winClass.lpszClassName = L"d3dtest";
93
94 if (!RegisterClassEx(&winClass))
95 return;
96
98 0,
99 winClass.lpszClassName,
100 NULL,
101 WS_POPUP,
104 WIDTH,
105 HEIGHT,
106 NULL,
107 NULL,
108 hInstance,
109 NULL);
110
111 if (!hWnd)
112 goto cleanup;
113
115 LoadStringW(hInstance, IDS_MAIN_DIALOG, szCaption, sizeof(szCaption) / sizeof(WCHAR));
117 goto cleanup;
118
119 StartD3DTest(hWnd, hInstance, szCaption, 7);
120 StartD3DTest(hWnd, hInstance, szCaption, 8);
121 StartD3DTest(hWnd, hInstance, szCaption, 9);
122
123cleanup:
126}
#define msg(x)
Definition: auth_time.c:54
HWND hWnd
Definition: settings.c:17
#define IDS_D3DTEST_DESCRIPTION
Definition: resource.h:153
#define IDS_DDTEST_ERROR
Definition: resource.h:141
#define IDS_D3DTEST_D3Dx
Definition: resource.h:154
#define IDS_MAIN_DIALOG
Definition: resource.h:103
HINSTANCE hInstance
Definition: charmap.c:19
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
VOID D3DTests()
Definition: d3dtest.c:73
#define WIDTH
Definition: d3dtest.c:13
BOOL StartD3DTest(HWND hWnd, HINSTANCE hInstance, WCHAR *pszCaption, INT TestNr)
Definition: d3dtest.c:20
BOOL D3D8Test(HWND hWnd)
Definition: d3dtest8.c:11
BOOL D3D9Test(HWND hWnd)
Definition: d3dtest9.c:11
static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: d3dtest.c:68
BOOL D3D7Test(HWND hWnd)
Definition: d3dtest7.c:11
#define HEIGHT
Definition: d3dtest.c:14
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static const WCHAR szDescription[]
Definition: provider.c:55
#define CALLBACK
Definition: compat.h:35
static void cleanup(void)
Definition: main.c:1335
#define swprintf
Definition: precomp.h:40
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned int UINT
Definition: ndis.h:50
#define L(x)
Definition: ntvdm.h:50
#define WS_POPUP
Definition: pedump.c:616
#define DefWindowProc
Definition: ros2win.h:31
int cbClsExtra
Definition: winuser.h:3204
HINSTANCE hInstance
Definition: winuser.h:3206
HCURSOR hCursor
Definition: winuser.h:3208
LPCSTR lpszMenuName
Definition: winuser.h:3210
HICON hIconSm
Definition: winuser.h:3212
UINT style
Definition: winuser.h:3202
int cbWndExtra
Definition: winuser.h:3205
UINT cbSize
Definition: winuser.h:3201
WNDPROC lpfnWndProc
Definition: winuser.h:3203
LPCSTR lpszClassName
Definition: winuser.h:3211
HICON hIcon
Definition: winuser.h:3207
HBRUSH hbrBackground
Definition: winuser.h:3209
int32_t INT
Definition: typedefs.h:58
#define GetModuleHandle
Definition: winbase.h:3827
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define BLACK_BRUSH
Definition: wingdi.h:896
#define CS_VREDRAW
Definition: winuser.h:658
#define CreateWindowEx
Definition: winuser.h:5755
#define SW_HIDE
Definition: winuser.h:768
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SM_CYSCREEN
Definition: winuser.h:960
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CS_HREDRAW
Definition: winuser.h:653
#define UnregisterClass
Definition: winuser.h:5861
#define CS_DBLCLKS
Definition: winuser.h:651
#define MB_YESNO
Definition: winuser.h:817
#define IDI_APPLICATION
Definition: winuser.h:704
#define MB_ICONERROR
Definition: winuser.h:787
#define RegisterClassEx
Definition: winuser.h:5837
#define IDNO
Definition: winuser.h:836
#define LoadIcon
Definition: winuser.h:5813
WNDCLASSEXA WNDCLASSEX
Definition: winuser.h:5719
#define MB_OK
Definition: winuser.h:790
#define MB_ICONQUESTION
Definition: winuser.h:789
#define MessageBox
Definition: winuser.h:5822
#define CS_OWNDC
Definition: winuser.h:655
#define SW_SHOW
Definition: winuser.h:775
#define SM_CXSCREEN
Definition: winuser.h:959
#define IDYES
Definition: winuser.h:835
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409
__wchar_t WCHAR
Definition: xmlstorage.h:180