3 * COPYRIGHT: See COPYING in the top level directory
5 * FILE: lib/ddraw/soft/ddraw.c
6 * PURPOSE: DirectDraw Software Implementation
7 * PROGRAMMER: Magnus Olsen, Maarten Bosma
14 HRESULT
Hel_DirectDraw_Initialize (LPDIRECTDRAW7 iface
)
19 HRESULT
Hel_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface
)
24 VOID
Hel_DirectDraw_Release (LPDIRECTDRAW7 iface
)
29 HRESULT
Hel_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface
, LPDDSCAPS2 ddscaps
,
30 LPDWORD total
, LPDWORD free
)
36 HRESULT
Hel_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface
, DWORD dwFlags
,HANDLE h
)
41 HRESULT
Hel_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface
, LPDWORD lpdwScanLine
)
46 HRESULT
Hel_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface
)
51 HRESULT
Hel_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface
, DWORD dwWidth
, DWORD dwHeight
,
52 DWORD dwBPP
, DWORD dwRefreshRate
, DWORD dwFlags
)
54 IDirectDrawImpl
* This
= (IDirectDrawImpl
*)iface
;
56 // this only for exclusive mode
57 if(!(This
->cooperative_level
& DDSCL_EXCLUSIVE
))
58 return DDERR_NOEXCLUSIVEMODE
;
60 // change the resolution using normal WinAPI function
62 mode
.dmSize
= sizeof(mode
);
63 mode
.dmPelsWidth
= dwWidth
;
64 mode
.dmPelsHeight
= dwHeight
;
65 mode
.dmBitsPerPel
= dwBPP
;
66 mode
.dmDisplayFrequency
= dwRefreshRate
;
70 mode
.dmFields
|= DM_PELSWIDTH
;
72 mode
.dmFields
|= DM_PELSHEIGHT
;
74 mode
.dmFields
|= DM_BITSPERPEL
;
76 mode
.dmFields
|= DM_DISPLAYFREQUENCY
;
78 if (ChangeDisplaySettings(&mode
, CDS_FULLSCREEN
) != DISP_CHANGE_SUCCESSFUL
)
79 return DDERR_UNSUPPORTEDMODE
;
81 // TODO: reactivate ddraw object, maximize window, set it in foreground
82 // and set excluive mode (if implemented by the driver)
84 /* FIXME fill the DirectDrawGlobal right the modeindex old and new */
87 This
->Height
= dwWidth
;
89 This
->Width
= dwHeight
;