Changeset 4027 in vbox for trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
- Timestamp:
- Aug 3, 2007 7:53:12 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Display/dd.c
r3397 r4027 16 16 17 17 #ifdef DEBUG 18 #define LOG_ENABLED 18 #define LOG_ENABLED 1 19 19 #endif 20 20 … … 65 65 { 66 66 PPDEV pDev = (PPDEV)dhpdev; 67 BOOL bDefineDDrawHeap = FALSE; 68 DWORD cHeaps = 0; 69 VIDEOMEMORY *pVm = NULL; 67 70 68 71 DISPDBG((0, "%s: %p, %p, %p, %p, %p. %p\n", __FUNCTION__, dhpdev, pHalInfo, pdwNumHeaps, pvmList, pdwNumFourCCCodes, pdwFourCC)); … … 77 80 if (!(pvmList && pdwFourCC)) 78 81 { 82 memset(&pHalInfo->ddCaps, 0, sizeof(DDNTCORECAPS)); 83 pHalInfo->ddCaps.dwSize = sizeof(DDNTCORECAPS); 84 pHalInfo->ddCaps.dwVidMemTotal = pDev->cScreenSize - pDev->cFrameBufferSize; 85 pHalInfo->ddCaps.dwVidMemFree = pHalInfo->ddCaps.dwVidMemTotal; 86 87 pHalInfo->ddCaps.dwCaps = 0; 88 pHalInfo->ddCaps.dwCaps2 = 0; 89 90 /* Declare we can handle textures wider than the primary */ 91 pHalInfo->ddCaps.dwCaps2 |= DDCAPS2_WIDESURFACES; 92 93 pHalInfo->ddCaps.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; 94 79 95 /* Create primary surface attributes */ 80 96 pHalInfo->vmiData.pvPrimary = pDev->pjScreen; … … 108 124 pHalInfo->vmiData.dwTextureAlign = 4; 109 125 } 110 memset(&pHalInfo->ddCaps, 0, sizeof(DDNTCORECAPS)); 111 pHalInfo->ddCaps.dwSize = sizeof(DDNTCORECAPS); 112 pHalInfo->ddCaps.dwVidMemTotal = pDev->cScreenSize; 113 pHalInfo->ddCaps.dwVidMemFree = pDev->cScreenSize; 114 115 pHalInfo->ddCaps.dwCaps = 0; 116 pHalInfo->ddCaps.dwCaps2 = 0; 117 118 /* Declare we can handle textures wider than the primary */ 119 pHalInfo->ddCaps.dwCaps2 |= DDCAPS2_WIDESURFACES; 120 121 pHalInfo->ddCaps.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; 126 127 cHeaps = 0; 128 129 /* Do we have sufficient videomemory to create an off-screen heap for DDraw? */ 130 if (pDev->cScreenSize > pDev->cFrameBufferSize) 131 { 132 bDefineDDrawHeap = TRUE; 133 cHeaps++; 134 } 135 136 pDev->cHeaps = cHeaps; 137 *pdwNumHeaps = cHeaps; 138 139 // If pvmList is not NULL then we can go ahead and fill out the VIDEOMEMORY 140 // structures which define our requested heaps. 141 142 if(pvmList) { 143 144 pVm=pvmList; 145 146 // 147 // Snag a pointer to the video-memory list so that we can use it to 148 // call back to DirectDraw to allocate video memory: 149 // 150 pDev->pvmList = pVm; 151 152 // 153 // Define the heap for DirectDraw 154 // 155 if ( bDefineDDrawHeap ) 156 { 157 pVm->dwFlags = VIDMEM_ISLINEAR ; 158 pVm->fpStart = pDev->cFrameBufferSize; 159 pVm->fpEnd = pDev->cScreenSize; 160 161 pVm->ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN; 162 DISPDBG((0, "fpStart %ld fpEnd %ld\n", pVm->fpStart, pVm->fpEnd)); 163 164 pVm++; 165 } 166 } 122 167 123 168 #if 0 /* not mandatory */ … … 172 217 pCallBacks->dwFlags = 0; 173 218 174 /*175 219 pCallBacks->dwFlags = DDHAL_CB32_CREATESURFACE | DDHAL_CB32_CANCREATESURFACE; 176 220 pCallBacks->CreateSurface = DdCreateSurface; 177 221 pCallBacks->CanCreateSurface = DdCanCreateSurface; 178 pCallBacks->WaitForVerticalBlank = DdWaitForVerticalBlank; 179 pCallBacks->GetScanLine = DdGetScanLine; 180 pCallBacks->MapMemory = DdMapMemory; 181 DDHAL_CB32_WAITFORVERTICALBLANK | DDHAL_CB32_MAPMEMORY | DDHAL_CB32_GETSCANLINE 182 */ 222 // pCallBacks->WaitForVerticalBlank = DdWaitForVerticalBlank; 223 // pCallBacks->GetScanLine = DdGetScanLine; 224 // pCallBacks->MapMemory = DdMapMemory; 225 // DDHAL_CB32_WAITFORVERTICALBLANK | DDHAL_CB32_MAPMEMORY | DDHAL_CB32_GETSCANLINE 183 226 /* Note: pCallBacks->SetMode & pCallBacks->DestroyDriver are unused in Windows 2000 and up */ 184 227 … … 652 695 DISPDBG((0, "%s: %p\n", __FUNCTION__, pDev)); 653 696 654 // remember setting of exclusive mode in p pdev,697 // remember setting of exclusive mode in pDev, 655 698 // so GDI can stop to promote DeviceBitmaps into 656 699 // video memory
Note:
See TracChangeset
for help on using the changeset viewer.