1 #include <windows.h>
2 #include <stdio.h>
3 #include <ddraw.h>
4 #include <ddrawi.h>
5 #include <d3dhal.h>
6 #include <ddrawgdi.h>
7 
8 #if defined(_WIN32) && !defined(_NO_COM )
9 #define COM_NO_WINDOWS_H
10 #include <objbase.h>
11 #else
12 #define IUnknown void
13 #if !defined(NT_BUILD_ENVIRONMENT) && !defined(WINNT)
14         #define CO_E_NOTINITIALIZED 0x800401F0
15 #endif
16 #endif
17 
18 HRESULT WINAPI
19 Main_DirectDraw_QueryInterface (
20                                 LPDIRECTDRAW2 iface,
21                                 REFIID id,
22                                 LPVOID *obj);
23 
24 ULONG WINAPI
25 Main_DirectDraw_AddRef (LPDIRECTDRAW2 iface);
26 
27 ULONG WINAPI
28 Main_DirectDraw_Release (LPDIRECTDRAW2 iface);
29 
30 HRESULT WINAPI
31 Main_DirectDraw_Compact(LPDIRECTDRAW2 iface);
32 
33 HRESULT WINAPI
34 Main_DirectDraw_CreateClipper(
35                               LPDIRECTDRAW2 iface,
36                               DWORD dwFlags,
37                               LPDIRECTDRAWCLIPPER *ppClipper,
38                               IUnknown *pUnkOuter);
39 
40 HRESULT WINAPI
41 Main_DirectDraw_CreatePalette(
42                               LPDIRECTDRAW2 iface,
43                               DWORD dwFlags,
44                               LPPALETTEENTRY palent,
45                               LPDIRECTDRAWPALETTE* ppPalette,
46                               LPUNKNOWN pUnkOuter);
47 
48 HRESULT WINAPI
49 Main_DirectDraw_CreateSurface(
50                                LPDIRECTDRAW2 iface,
51                                LPDDSURFACEDESC pDDSD,
52                                LPDIRECTDRAWSURFACE *ppSurf,
53                                IUnknown *pUnkOuter);
54 
55 HRESULT WINAPI
56 Main_DirectDraw_DuplicateSurface(
57                                  LPDIRECTDRAW2 iface,
58                                  LPDIRECTDRAWSURFACE src,
59                                  LPDIRECTDRAWSURFACE* dst);
60 
61 HRESULT WINAPI
62 Main_DirectDraw_EnumDisplayModes(
63                                  LPDIRECTDRAW2 iface,
64                                  DWORD dwFlags,
65                                  LPDDSURFACEDESC pDDSD,
66                                  LPVOID pContext,
67                                  LPDDENUMMODESCALLBACK pCallback);
68 
69 HRESULT WINAPI
70 Main_DirectDraw_EnumSurfaces(
71                              LPDIRECTDRAW2 iface,
72                              DWORD dwFlags,
73                              LPDDSURFACEDESC lpDDSD,
74                              LPVOID context,
75                              LPDDENUMSURFACESCALLBACK callback);
76 
77 HRESULT WINAPI
78 Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW2 iface);
79 
80 HRESULT WINAPI
81 Main_DirectDraw_GetCaps(
82                         LPDIRECTDRAW2 iface,
83                         LPDDCAPS pDriverCaps,
84                         LPDDCAPS pHELCaps);
85 
86 HRESULT WINAPI
87 Main_DirectDraw_GetDisplayMode (
88                                 LPDIRECTDRAW2 iface,
89                                 LPDDSURFACEDESC pDDSD);
90 
91 HRESULT WINAPI
92 Main_DirectDraw_GetFourCCCodes(
93                                LPDIRECTDRAW2 iface,
94                                LPDWORD lpNumCodes,
95                                LPDWORD lpCodes);
96 
97 HRESULT WINAPI
98 Main_DirectDraw_GetGDISurface(
99                               LPDIRECTDRAW2 iface,
100                               LPDIRECTDRAWSURFACE *lplpGDIDDSSurface);
101 
102 HRESULT WINAPI
103 Main_DirectDraw_GetMonitorFrequency (
104                                      LPDIRECTDRAW2 iface,
105                                      LPDWORD lpFreq);
106 
107 
108 HRESULT WINAPI
109 Main_DirectDraw_GetScanLine(LPDIRECTDRAW2 iface,
110                             LPDWORD lpdwScanLine);
111 
112 HRESULT WINAPI
113 Main_DirectDraw_GetVerticalBlankStatus(
114                                        LPDIRECTDRAW2 iface,
115                                        LPBOOL lpbIsInVB);
116 
117 HRESULT WINAPI
118 Main_DirectDraw_Initialize (
119                             LPDIRECTDRAW2 iface,
120                             LPGUID lpGUID);
121 
122 
123 HRESULT WINAPI
124 Main_DirectDraw_RestoreDisplayMode (LPDIRECTDRAW2 iface);
125 
126 HRESULT WINAPI
127 Main_DirectDraw_SetCooperativeLevel (
128                                      LPDIRECTDRAW2 iface,
129                                      HWND hwnd,
130                                      DWORD cooplevel);
131 
132 HRESULT WINAPI
133 Main_DirectDraw_SetDisplayMode2(
134                                LPDIRECTDRAW2 iface,
135                                DWORD dwWidth,
136                                DWORD dwHeight,
137                                DWORD dwBPP,
138                                DWORD dwRefreshRate,
139                                DWORD dwFlags);
140 
141 HRESULT WINAPI
142 Main_DirectDraw_WaitForVerticalBlank(
143                                      LPDIRECTDRAW2 iface,
144                                      DWORD dwFlags,
145                                      HANDLE h);
146 
147 
148 HRESULT WINAPI
149 Main_DirectDraw_GetAvailableVidMem(
150                                     LPDIRECTDRAW2 iface,
151                                     LPDDSCAPS ddscaps,
152                                     LPDWORD dwTotal,
153                                     LPDWORD dwFree);
154 
155 
156 IDirectDraw2Vtbl DirectDraw2_Vtable =
157 {
158     Main_DirectDraw_QueryInterface,
159     Main_DirectDraw_AddRef,
160     Main_DirectDraw_Release,
161     Main_DirectDraw_Compact,
162     Main_DirectDraw_CreateClipper,
163     Main_DirectDraw_CreatePalette,
164     Main_DirectDraw_CreateSurface,
165     Main_DirectDraw_DuplicateSurface,
166     Main_DirectDraw_EnumDisplayModes,
167     Main_DirectDraw_EnumSurfaces,
168     Main_DirectDraw_FlipToGDISurface,
169     Main_DirectDraw_GetCaps,
170     Main_DirectDraw_GetDisplayMode,
171     Main_DirectDraw_GetFourCCCodes,
172     Main_DirectDraw_GetGDISurface,
173     Main_DirectDraw_GetMonitorFrequency,
174     Main_DirectDraw_GetScanLine,
175     Main_DirectDraw_GetVerticalBlankStatus,
176     Main_DirectDraw_Initialize,
177     Main_DirectDraw_RestoreDisplayMode,
178     Main_DirectDraw_SetCooperativeLevel,
179     Main_DirectDraw_SetDisplayMode2,
180     Main_DirectDraw_WaitForVerticalBlank,
181     Main_DirectDraw_GetAvailableVidMem
182 };
183 
184 
185 
186