ReactOS
0.4.16-dev-306-g647d351
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
helper.cpp
Go to the documentation of this file.
1
#include "
ddrawtest.h
"
2
3
LRESULT
WINAPI
BasicWindowProc
(
HWND
hwnd
,
UINT
message
,
WPARAM
wParam
,
LPARAM
lParam
)
4
{
5
switch
(
message
)
6
{
7
case
WM_DESTROY
:
8
{
9
PostQuitMessage
(0);
10
return
0;
11
}
break
;
12
}
13
14
return
DefWindowProc
(
hwnd
,
message
,
wParam
,
lParam
);
15
}
16
17
HWND
CreateBasicWindow
(
VOID
)
18
{
19
WNDCLASS
wndclass = {0};
20
wndclass.
lpfnWndProc
=
BasicWindowProc
;
21
wndclass.
hInstance
=
GetModuleHandle
(
NULL
);
22
wndclass.
lpszClassName
=
"DDrawTest"
;
23
RegisterClass
(&wndclass);
24
25
return
CreateWindow
(
"DDrawTest"
,
"ReactOS DirectDraw Test"
,
WS_POPUP
, 0, 0, 10, 10,
NULL
,
NULL
,
GetModuleHandle
(
NULL
),
NULL
);
26
}
27
28
BOOL
CreateSurface
(
LPDIRECTDRAWSURFACE7
*
pSurface
)
29
{
30
LPDIRECTDRAW7
DirectDraw
;
31
LPDIRECTDRAWSURFACE7
Surface;
32
HWND
hwnd
;
33
34
// Create DDraw Object
35
if
(
DirectDrawCreateEx
(
NULL
, (
VOID
**)&
DirectDraw
, IID_IDirectDraw7,
NULL
) !=
DD_OK
)
36
{
37
printf
(
"ERROR: Failed to set up ddraw\n"
);
38
return
FALSE
;
39
}
40
41
if
(!(
hwnd
=
CreateBasicWindow
() ))
42
{
43
printf
(
"ERROR: Failed to create window\n"
);
44
DirectDraw
->Release();
45
return
FALSE
;
46
}
47
48
if
(
DirectDraw
->SetCooperativeLevel (
hwnd
,
DDSCL_NORMAL
) !=
DD_OK
)
49
{
50
printf
(
"ERROR: Could not set cooperative level\n"
);
51
DirectDraw
->Release();
52
return
0;
53
}
54
55
// Creat Surface
56
DDSURFACEDESC2
Desc = { 0 };
57
Desc.
dwHeight
= 200;
58
Desc.
dwWidth
= 200;
59
Desc.
dwSize
=
sizeof
(
DDSURFACEDESC2
);
60
Desc.
ddsCaps
.
dwCaps
=
DDSCAPS_OFFSCREENPLAIN
;
61
Desc.
dwFlags
=
DDSD_CAPS
|
DDSD_HEIGHT
|
DDSD_WIDTH
;
62
63
if
(
DirectDraw
->CreateSurface(&Desc, &Surface,
NULL
) !=
DD_OK
)
64
{
65
printf
(
"ERROR: Faild to create Surface\n"
);
66
return
FALSE
;
67
}
68
69
DirectDraw
->Release();
70
71
*
pSurface
= Surface;
72
return
TRUE
;
73
}
DirectDraw
Definition:
ddraw_classes.idl:28
wParam
WPARAM wParam
Definition:
combotst.c:138
lParam
LPARAM lParam
Definition:
combotst.c:139
ddrawtest.h
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
DirectDrawCreateEx
HRESULT WINAPI DirectDrawCreateEx(LPGUID lpGUID, LPVOID *lplpDD, REFIID id, LPUNKNOWN pUnkOuter)
Definition:
main.c:139
LPDIRECTDRAW7
DWORD * LPDIRECTDRAW7
Definition:
vmrender.idl:6
LPDIRECTDRAWSURFACE7
DWORD * LPDIRECTDRAWSURFACE7
Definition:
vmrender.idl:7
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
printf
#define printf
Definition:
freeldr.h:97
CreateSurface
BOOL CreateSurface(LPDIRECTDRAWSURFACE7 *pSurface)
Definition:
helper.cpp:28
CreateBasicWindow
HWND CreateBasicWindow(VOID)
Definition:
helper.cpp:17
BasicWindowProc
LRESULT WINAPI BasicWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition:
helper.cpp:3
void
Definition:
nsiface.idl:2307
UINT
unsigned int UINT
Definition:
ndis.h:50
WS_POPUP
#define WS_POPUP
Definition:
pedump.c:616
DefWindowProc
#define DefWindowProc
Definition:
ros2win.h:31
DDSD_WIDTH
#define DDSD_WIDTH
Definition:
ddraw.h:210
DDSCL_NORMAL
#define DDSCL_NORMAL
Definition:
ddraw.h:535
DDSURFACEDESC2
struct _DDSURFACEDESC2 DDSURFACEDESC2
DDSD_HEIGHT
#define DDSD_HEIGHT
Definition:
ddraw.h:209
DDSCAPS_OFFSCREENPLAIN
#define DDSCAPS_OFFSCREENPLAIN
Definition:
ddraw.h:255
DD_OK
#define DD_OK
Definition:
ddraw.h:186
DDSD_CAPS
#define DDSD_CAPS
Definition:
ddraw.h:208
_DDSCAPS2::dwCaps
DWORD dwCaps
Definition:
ddraw.h:732
_DDSURFACEDESC2
Definition:
ddraw.h:1151
_DDSURFACEDESC2::dwWidth
DWORD dwWidth
Definition:
ddraw.h:1155
_DDSURFACEDESC2::dwHeight
DWORD dwHeight
Definition:
ddraw.h:1154
_DDSURFACEDESC2::ddsCaps
DDSCAPS2 ddsCaps
Definition:
ddraw.h:1188
_DDSURFACEDESC2::dwFlags
DWORD dwFlags
Definition:
ddraw.h:1153
_DDSURFACEDESC2::dwSize
DWORD dwSize
Definition:
ddraw.h:1152
_WNDCLASSA
Definition:
winuser.h:3165
_WNDCLASSA::hInstance
HINSTANCE hInstance
Definition:
winuser.h:3170
_WNDCLASSA::lpszClassName
LPCSTR lpszClassName
Definition:
winuser.h:3175
_WNDCLASSA::lpfnWndProc
WNDPROC lpfnWndProc
Definition:
winuser.h:3167
message
Definition:
tftpd.h:60
GetModuleHandle
#define GetModuleHandle
Definition:
winbase.h:3852
pSurface
_In_ DD_SURFACE_LOCAL * pSurface
Definition:
winddi.h:3481
hwnd
_In_ LONG _In_ HWND hwnd
Definition:
winddi.h:4023
LPARAM
LONG_PTR LPARAM
Definition:
windef.h:208
LRESULT
LONG_PTR LRESULT
Definition:
windef.h:209
WPARAM
UINT_PTR WPARAM
Definition:
windef.h:207
WINAPI
#define WINAPI
Definition:
msvc.h:6
PostQuitMessage
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
CreateWindow
#define CreateWindow
Definition:
winuser.h:5766
RegisterClass
#define RegisterClass
Definition:
winuser.h:5848
WM_DESTROY
#define WM_DESTROY
Definition:
winuser.h:1612
modules
rostests
dxtest
ddraw
helper.cpp
Generated on Mon Dec 2 2024 06:10:34 for ReactOS by
1.9.6