3d11f0b559c6422c6b9ea463e04980254aeaed29
[reactos.git] / reactos / include / ddk / dmemmgr.h
1
2 /* $Id: $
3 *
4 * COPYRIGHT: This file is in the public domain.
5 * PROJECT: ReactOS kernel
6 * FILE:
7 * PURPOSE: Directx headers
8 * PROGRAMMER: Magnus Olsen (greatlrd)
9 *
10 */
11
12 #ifndef __DMEMMGR_INCLUDED__
13 #define __DMEMMGR_INCLUDED__
14
15 /* Helper macro to enable gcc's extension. */
16 #ifndef __GNU_EXTENSION
17 #ifdef __GNUC__
18 #define __GNU_EXTENSION __extension__
19 #else
20 #define __GNU_EXTENSION
21 #endif
22 #endif
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #ifndef __NTDDKCOMP__
29
30 #ifndef FLATPTR_DEFINED
31 typedef ULONG_PTR FLATPTR;
32 #define FLATPTR_DEFINED
33 #endif
34
35 typedef struct _VIDMEM *LPVIDMEM;
36
37 #else
38
39 #ifndef FLATPTR_DEFINED
40 typedef ULONG_PTR FLATPTR;
41 #define FLATPTR_DEFINED
42 #endif
43
44 typedef struct _VIDEOMEMORY *LPVIDMEM;
45 #endif
46
47 #define SURFACEALIGN_DISCARDABLE 0x00000001
48 #define VMEMHEAP_LINEAR 0x00000001
49 #define VMEMHEAP_RECTANGULAR 0x00000002
50 #define VMEMHEAP_ALIGNMENT 0x00000004
51
52 typedef struct _VMEML
53 {
54 struct _VMEML *next;
55 FLATPTR ptr;
56 DWORD size;
57 BOOL bDiscardable;
58 } VMEML, *LPVMEML, *LPLPVMEML;
59
60 typedef struct _VMEMR
61 {
62 struct _VMEMR *next;
63 struct _VMEMR *prev;
64
65 struct _VMEMR *pUp;
66 struct _VMEMR *pDown;
67 struct _VMEMR *pLeft;
68 struct _VMEMR *pRight;
69 FLATPTR ptr;
70 DWORD size;
71 DWORD x;
72 DWORD y;
73 DWORD cx;
74 DWORD cy;
75 DWORD flags;
76 FLATPTR pBits;
77 BOOL bDiscardable;
78 } VMEMR, *LPVMEMR, *LPLPVMEMR;
79
80 typedef struct _SURFACEALIGNMENT
81 {
82 __GNU_EXTENSION union
83 {
84 struct
85 {
86 DWORD dwStartAlignment;
87 DWORD dwPitchAlignment;
88 DWORD dwFlags;
89 DWORD dwReserved2;
90 } Linear;
91 struct
92 {
93 DWORD dwXAlignment;
94 DWORD dwYAlignment;
95 DWORD dwFlags;
96 DWORD dwReserved2;
97 } Rectangular;
98 };
99 } SURFACEALIGNMENT, *LPSURFACEALIGNMENT;
100
101 typedef struct _HEAPALIGNMENT
102 {
103 DWORD dwSize;
104 DDSCAPS ddsCaps;
105 DWORD dwReserved;
106 SURFACEALIGNMENT ExecuteBuffer;
107 SURFACEALIGNMENT Overlay;
108 SURFACEALIGNMENT Texture;
109 SURFACEALIGNMENT ZBuffer;
110 SURFACEALIGNMENT AlphaBuffer;
111 SURFACEALIGNMENT Offscreen;
112 SURFACEALIGNMENT FlipTarget;
113 } HEAPALIGNMENT, *LPHEAPALIGNMENT;
114
115 typedef struct _VMEMHEAP
116 {
117 DWORD dwFlags;
118 DWORD stride;
119 LPVOID freeList;
120 LPVOID allocList;
121 DWORD dwTotalSize;
122 FLATPTR fpGARTLin;
123 FLATPTR fpGARTDev;
124 DWORD dwCommitedSize;
125 DWORD dwCoalesceCount;
126 HEAPALIGNMENT Alignment;
127 DDSCAPSEX ddsCapsEx;
128 DDSCAPSEX ddsCapsExAlt;
129 #ifndef IS_16
130 LARGE_INTEGER liPhysAGPBase;
131 #endif
132 HANDLE hdevAGP;
133 LPVOID pvPhysRsrv;
134 BYTE* pAgpCommitMask;
135 DWORD dwAgpCommitMaskSize;
136 } VMEMHEAP, *LPVMEMHEAP;
137
138 typedef struct _DD_GETHEAPALIGNMENTDATA
139 {
140 ULONG_PTR dwInstance;
141 DWORD dwHeap;
142 HRESULT ddRVal;
143 VOID* GetHeapAlignment;
144 HEAPALIGNMENT Alignment;
145 } DD_GETHEAPALIGNMENTDATA;
146
147 #ifndef DD_GETHEAPALIGNMENTDATA_DECLARED
148 typedef DD_GETHEAPALIGNMENTDATA *PDD_GETHEAPALIGNMENTDATA;
149 #define DD_GETHEAPALIGNMENTDATA_DECLARED
150 #endif
151
152 extern void WINAPI VidMemFree( LPVMEMHEAP pvmh, FLATPTR ptr);
153 extern FLATPTR WINAPI VidMemAlloc( LPVMEMHEAP pvmh, DWORD width, DWORD height);
154
155 extern FLATPTR WINAPI
156 HeapVidMemAllocAligned(
157 LPVIDMEM lpVidMem,
158 DWORD dwWidth,
159 DWORD dwHeight,
160 LPSURFACEALIGNMENT lpAlignment ,
161 LPLONG lpNewPitch );
162
163
164
165
166
167
168 #ifdef __cplusplus
169 };
170 #endif
171
172 #endif