aboutsummaryrefslogtreecommitdiffstats
path: root/ddk/dmemmgr.h
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2023-05-26 00:11:19 +0200
committerJaroslav Hensl <jara@hensl.cz>2023-05-26 00:11:19 +0200
commit14395d1ce8759ce490beb87c80ddb1f7ed35904f (patch)
tree0d3e72e924dcb248b1eb88cfb8782d34b551d6a9 /ddk/dmemmgr.h
parentf94e063607454180284f32d88e01e0bc998e460b (diff)
downloadvmdisp9x-14395d1ce8759ce490beb87c80ddb1f7ed35904f.tar.gz
directdraw support (skeleton)
Diffstat (limited to 'ddk/dmemmgr.h')
-rw-r--r--ddk/dmemmgr.h124
1 files changed, 124 insertions, 0 deletions
diff --git a/ddk/dmemmgr.h b/ddk/dmemmgr.h
new file mode 100644
index 0000000..38e0d94
--- /dev/null
+++ b/ddk/dmemmgr.h
@@ -0,0 +1,124 @@
+#ifndef __DMEMMGR_INCLUDED__
+#define __DMEMMGR_INCLUDED__
+
+/*
+ * pointer to video meory
+ */
+typedef unsigned long FLATPTR;
+
+/*
+ * Structure for querying extended heap alignment requirements
+ */
+
+typedef struct SURFACEALIGNMENT
+{
+ union
+ {
+ struct
+ {
+ DWORD dwStartAlignment;
+ DWORD dwPitchAlignment;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ } Linear;
+ struct
+ {
+ DWORD dwXAlignment;
+ DWORD dwYAlignment;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ } Rectangular;
+ };
+} SURFACEALIGNMENT_t;
+typedef struct SURFACEALIGNMENT __far *LPSURFACEALIGNMENT;
+
+typedef struct HEAPALIGNMENT
+{
+ DWORD dwSize;
+ DDSCAPS_t ddsCaps; /* Indicates which alignment fields are valid.*/
+ DWORD dwReserved;
+ SURFACEALIGNMENT_t ExecuteBuffer; /* Surfaces tagged with DDSCAPS_EXECUTEBUFFER */
+ SURFACEALIGNMENT_t Overlay; /* Surfaces tagged with DDSCAPS_OVERLAY */
+ SURFACEALIGNMENT_t Texture; /* Surfaces tagged with DDSCAPS_TEXTURE */
+ SURFACEALIGNMENT_t ZBuffer; /* Surfaces tagged with DDSCAPS_ZBUFFER */
+ SURFACEALIGNMENT_t AlphaBuffer; /* Surfaces tagged with DDSCAPS_ALPHA */
+ SURFACEALIGNMENT_t Offscreen; /* Surfaces tagged with DDSCAPS_OFFSCREENPLAIN*/
+ SURFACEALIGNMENT_t FlipTarget; /* Surfaces whose bits are potential primaries i.e. back buffers*/
+} HEAPALIGNMENT_t;
+typedef struct HEAPALIGNMENT __far *LPHEAPALIGNMENT;
+
+/*
+ * video memory manager structures
+ */
+typedef struct VMEML
+{
+ struct VMEML __far *next;
+ FLATPTR ptr;
+ DWORD size;
+} VMEML_t;
+
+typedef struct VMEML __far* LPVMEML;
+typedef struct VMEML __far *__far *LPLPVMEML;
+
+typedef struct VMEMR
+{
+ struct VMEMR __far *next;
+ struct VMEMR __far *prev;
+ /*
+ * The pUp, pDown, pLeft and pRight members were removed in DX5
+ */
+ struct VMEMR __far *pUp;
+ struct VMEMR __far *pDown;
+ struct VMEMR __far *pLeft;
+ struct VMEMR __far *pRight;
+ FLATPTR ptr;
+ DWORD size;
+ DWORD x;
+ DWORD y;
+ DWORD cx;
+ DWORD cy;
+ DWORD flags;
+ FLATPTR pBits;
+} VMEMR_t;
+
+typedef struct VMEMR __far *LPVMEMR;
+typedef struct VMEMR __far *__far *LPLPVMEMR;
+
+typedef struct VMEMHEAP
+{
+ DWORD dwFlags;
+ DWORD stride;
+ LPVOID freeList;
+ LPVOID allocList;
+ DWORD dwTotalSize;
+ FLATPTR fpGARTLin; /* AGP: GART linear base of heap (app. visible) */
+ FLATPTR fpGARTDev; /* AGP: GART device base of heap (driver visible) */
+ DWORD dwCommitedSize; /* AGP: Number of bytes commited to heap */
+ /*
+ * Extended alignment data:
+ * Filled in by DirectDraw in response to a GetHeapAlignment HAL call.
+ */
+ DWORD dwCoalesceCount;
+ HEAPALIGNMENT_t Alignment;
+} VMEMHEAP_t;
+
+typedef VMEMHEAP_t __far *LPVMEMHEAP;
+
+#define VMEMHEAP_LINEAR 0x00000001l /* Heap is linear */
+#define VMEMHEAP_RECTANGULAR 0x00000002l /* Heap is rectangular */
+#define VMEMHEAP_ALIGNMENT 0x00000004l /* Heap has extended alignment info */
+
+/*
+ * These legacy DLL exports don't handle nonlocal heaps
+ */
+extern FLATPTR WINAPI VidMemAlloc(LPVMEMHEAP pvmh, DWORD width, DWORD height);
+extern void WINAPI VidMemFree(LPVMEMHEAP pvmh, FLATPTR ptr);
+
+/*
+ * This DLL export can be used by drivers to allocate aligned surfaces from heaps which
+ * they have previously exposed to DDRAW.DLL. This function can allocate from nonlocal heaps.
+ */
+extern FLATPTR WINAPI HeapVidMemAllocAligned(struct VIDMEM* lpVidMem, DWORD dwWidth, DWORD dwHeight, LPSURFACEALIGNMENT lpAlignment , LPLONG lpNewPitch);
+
+
+#endif