-
Notifications
You must be signed in to change notification settings - Fork 0
/
DDManager.h
43 lines (31 loc) · 885 Bytes
/
DDManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "Engine.h"
#include <ddraw.h>
#ifndef DIRECTDRAWMANAGER_H
#define DIRECTDRAWMANAGER_H
#define MAX_SURFACES 15
class DirectDrawManager
{
private:
LPDIRECTDRAW7 lpDD7;
LPDIRECTDRAWSURFACE7 lpDDSPrimary;
LPDIRECTDRAWSURFACE7 lpDDSBackBuffer;
LPDIRECTDRAWSURFACE7 SurfacesToRelease[MAX_SURFACES];
DDBLTFX BlitFX;
public:
~DirectDrawManager();
BOOL Init(HWND hWnd);
void ClearScreen(int Color)
{
BlitFX.dwFillColor = Color;
lpDDSBackBuffer->Blt(
nullptr, nullptr, nullptr, DDBLT_COLORFILL | DDBLT_WAIT, &BlitFX);
}
void Flip() { lpDDSPrimary->Flip(nullptr, DDFLIP_WAIT); }
void CopyPrimaryToBackBuffer()
{
lpDDSBackBuffer->BltFast(0, 0, lpDDSPrimary, nullptr, DDBLTFAST_WAIT);
}
LPDIRECTDRAWSURFACE7 GetBuffer() { return lpDDSBackBuffer; }
LPDIRECTDRAWSURFACE7 CreateSurfaceFromBitmap(LPCTSTR, int, int);
};
#endif