1 // ----------------------------------------------------------------------------
3 // ----------------------------------------------------------------------------
5 #include "DirectDrawGlobals.h"
7 // static char *VB_Name = "DirectDrawGlobals";
12 DirectDraw7 DirectDraw;
13 DirectDrawSurface7 PrimarySurface;
15 void InitDirectDraw(long hWndClip)
19 // DirectX = New DirectX7; // (handle this later, if needed)
20 DirectDraw = DirectX.DirectDrawCreate("");
21 DirectDraw.SetCooperativeLevel(0, DDSCL_NORMAL);
22 // Create PrimarySurface:
24 SD.lFlags = DDSD_CAPS;
25 SD.ddsCaps.lCaps = DDSCAPS_PRIMARYSURFACE;
27 PrimarySurface = DirectDraw.CreateSurface(SD);
29 ClipToWindow(hWndClip);
32 void ReleaseDirectDraw()
34 SET_TO_NOTHING(&PrimarySurface, sizeof(PrimarySurface));
35 SET_TO_NOTHING(&DirectDraw, sizeof(DirectDraw));
36 SET_TO_NOTHING(&DirectX, sizeof(DirectX));
39 void ClipToWindow(long hWnd)
41 DirectDrawClipper Clipper;
44 Clipper = DirectDraw.CreateClipper(0);
45 Clipper.SetHWnd(hWnd);
46 PrimarySurface.SetClipper(Clipper);
47 SET_TO_NOTHING(&Clipper, sizeof(Clipper));