Rename files so it be more easy to wrok with them in VS
[reactos.git] / reactos / lib / ddraw / soft / ddraw_hel.c
1 /* $Id$
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS
5 * FILE: lib/ddraw/soft/ddraw.c
6 * PURPOSE: DirectDraw Software Implementation
7 * PROGRAMMER: Magnus Olsen, Maarten Bosma
8 *
9 */
10
11 #include "rosdraw.h"
12
13
14 HRESULT Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface)
15 {
16 return DD_OK;
17 }
18
19 HRESULT Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface)
20 {
21 return DD_OK;
22 }
23
24 VOID Hel_DirectDraw_Release (LPDIRECTDRAW7 iface)
25 {
26 }
27
28
29 HRESULT Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
30 LPDWORD total, LPDWORD free)
31 {
32 DX_STUB;
33 }
34
35
36 HRESULT Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,HANDLE h)
37 {
38 DX_STUB;
39 }
40
41 HRESULT Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
42 {
43 DX_STUB;
44 }
45
46 HRESULT Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
47 {
48 DX_STUB;
49 }
50
51 HRESULT Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
52 DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
53 {
54 IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
55
56 // this only for exclusive mode
57 if(!(This->cooperative_level & DDSCL_EXCLUSIVE))
58 return DDERR_NOEXCLUSIVEMODE;
59
60 // change the resolution using normal WinAPI function
61 DEVMODE mode;
62 mode.dmSize = sizeof(mode);
63 mode.dmPelsWidth = dwWidth;
64 mode.dmPelsHeight = dwHeight;
65 mode.dmBitsPerPel = dwBPP;
66 mode.dmDisplayFrequency = dwRefreshRate;
67 mode.dmFields = 0;
68
69 if(dwWidth)
70 mode.dmFields |= DM_PELSWIDTH;
71 if(dwHeight)
72 mode.dmFields |= DM_PELSHEIGHT;
73 if(dwBPP)
74 mode.dmFields |= DM_BITSPERPEL;
75 if(dwRefreshRate)
76 mode.dmFields |= DM_DISPLAYFREQUENCY;
77
78 if (ChangeDisplaySettings(&mode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
79 return DDERR_UNSUPPORTEDMODE;
80
81 // TODO: reactivate ddraw object, maximize window, set it in foreground
82 // and set excluive mode (if implemented by the driver)
83
84 /* FIXME fill the DirectDrawGlobal right the modeindex old and new */
85
86 if(dwWidth)
87 This->Height = dwWidth;
88 if(dwHeight)
89 This->Width = dwHeight;
90 if(dwBPP)
91 This->Bpp = dwBPP;
92
93 return DD_OK;
94 }
95
96