1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
5 #include "DirectDrawGlobals.h"
7 // static char *VB_Name = "DirectDrawGlobals";
14 DirectDraw7 DirectDraw;
15 DirectDrawSurface7 PrimarySurface;
17 void InitDirectDraw(long hWndClip)
21 // DirectX = New DirectX7; // (handle this later, if needed)
22 DirectDraw = DirectX.DirectDrawCreate("");
23 DirectDraw.SetCooperativeLevel(0, DDSCL_NORMAL);
24 // Create PrimarySurface:
26 SD.lFlags = DDSD_CAPS;
27 SD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE;
29 PrimarySurface = DirectDraw.CreateSurface(SD);
31 ClipToWindow(hWndClip);
34 void ReleaseDirectDraw()
36 SET_TO_NOTHING(&PrimarySurface, sizeof(PrimarySurface));
37 SET_TO_NOTHING(&DirectDraw, sizeof(DirectDraw));
38 SET_TO_NOTHING(&DirectX, sizeof(DirectX));
41 void ClipToWindow(long hWnd)
43 DirectDrawClipper Clipper;
46 Clipper = DirectDraw.CreateClipper(0);
47 Clipper.SetHWnd(hWnd);
48 PrimarySurface.SetClipper(Clipper);
49 SET_TO_NOTHING(&Clipper, sizeof(Clipper));