24 static bool MyGetProcAddr(HINSTANCE hDLL, FARPROC *pFn,
const char *szExportedFnName) {
25 *pFn = (FARPROC) GetProcAddress(hDLL, szExportedFnName);
26 if (*pFn ==
nullptr) {
27 wdxdisplay9_cat.error()
28 <<
"GetProcAddr failed for " << szExportedFnName <<
", error=" << GetLastError() <<endl;
34 #define LOWVIDMEMTHRESHOLD 5700000 // 4MB cards should fall below this 35 #define CRAPPY_DRIVER_IS_LYING_VIDMEMTHRESHOLD 1000000 // if # is > 1MB, card is lying and I cant tell what it is 36 #define UNKNOWN_VIDMEM_SIZE 0xFFFFFFFF 54 RELEASE(__d3d9, wdxdisplay9,
"ID3D9", RELEASE_DOWN_TO_ZERO);
55 SAFE_FREELIB(_hD3D9_DLL);
56 SAFE_FREELIB(_hDDrawDLL);
83 make_output(
const std::string &name,
99 DCAST_INTO_R(wdxgsg, gsg,
nullptr);
105 if (((flags&BF_require_parasite)!=0)||
106 ((flags&BF_refuse_window)!=0)||
107 ((flags&BF_resizeable)!=0)||
108 ((flags&BF_size_track_host)!=0)||
109 ((flags&BF_rtt_cumulative)!=0)||
110 ((flags&BF_can_bind_color)!=0)||
111 ((flags&BF_can_bind_every)!=0)) {
116 if ((flags & BF_fb_props_optional) == 0) {
117 if ((fb_prop.get_aux_rgba() > 0)||
118 (fb_prop.get_aux_rgba() > 0)||
119 (fb_prop.get_aux_float() > 0)) {
130 if ((!support_render_texture)||
131 ((flags&BF_require_parasite)!=0)||
132 ((flags&BF_require_window)!=0)||
133 ((flags&BF_rtt_cumulative)!=0)||
134 ((flags&BF_can_bind_every)!=0)) {
139 if ((flags & BF_fb_props_optional) == 0) {
140 if (fb_prop.get_indexed_color() ||
141 (fb_prop.get_back_buffers() > 0)||
142 (fb_prop.get_accum_bits() > 0)||
143 (fb_prop.get_multisamples() > 0)) {
167 bool wdxGraphicsPipe9::
169 _hDDrawDLL = LoadLibrary(
"ddraw.dll");
170 if (_hDDrawDLL ==
nullptr) {
171 wdxdisplay9_cat.error()
172 <<
"LoadLibrary failed for ddraw.dll, error=" << GetLastError() <<endl;
176 if (!MyGetProcAddr(_hDDrawDLL, (FARPROC*)&_DirectDrawCreateEx,
"DirectDrawCreateEx")) {
180 if (!MyGetProcAddr(_hDDrawDLL, (FARPROC*)&_DirectDrawEnumerateExA,
"DirectDrawEnumerateExA")) {
184 _hD3D9_DLL = LoadLibrary(
"d3d9.dll");
185 if (_hD3D9_DLL ==
nullptr) {
186 wdxdisplay9_cat.error()
187 <<
"LoadLibrary failed for d3d9.dll, error=" << GetLastError() <<endl;
191 if (!MyGetProcAddr(_hD3D9_DLL, (FARPROC*)&_Direct3DCreate9,
"Direct3DCreate9")) {
196 __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION);
198 if (__d3d9 ==
nullptr) {
199 wdxdisplay9_cat.error() <<
"Direct3DCreate9 failed!, error = " << GetLastError() << endl;
204 Init_D3DFORMAT_map();
206 if (dx_count_all_cards_memory){
207 return find_all_card_memavails();
220 bool wdxGraphicsPipe9::
221 find_all_card_memavails() {
224 hr = (*_DirectDrawEnumerateExA)(dx7_driver_enum_callback,
this,
225 DDENUM_ATTACHEDSECONDARYDEVICES | DDENUM_NONDISPLAYDEVICES);
227 wdxdisplay9_cat.fatal()
228 <<
"DirectDrawEnumerateEx failed" << D3DERRORSTRING(hr);
232 if (_card_ids.empty()) {
233 wdxdisplay9_cat.error()
234 <<
"DirectDrawEnumerateEx enum'ed no devices!\n";
239 ZeroMemory(&ZeroGUID,
sizeof(GUID));
241 if (_card_ids.size() > 1) {
242 assert(IsEqualGUID(ZeroGUID, _card_ids[0].DX7_DeviceGUID));
245 _card_ids.erase(_card_ids.begin());
248 for (UINT i = 0; i < _card_ids.size(); i++) {
250 BYTE ddd_space[
sizeof(DDDEVICEIDENTIFIER2)+4];
251 DDDEVICEIDENTIFIER2 *pDX7DeviceID = (DDDEVICEIDENTIFIER2 *)&ddd_space[0];
252 GUID *pGUID = &(_card_ids[i].DX7_DeviceGUID);
254 if (IsEqualGUID(*pGUID, ZeroGUID)) {
259 hr = (*_DirectDrawCreateEx)(pGUID, (
void **)&pDD, IID_IDirectDraw7,
nullptr);
261 wdxdisplay9_cat.error()
262 <<
"DirectDrawCreateEx failed for device (" << i
263 <<
")" << D3DERRORSTRING(hr);
267 ZeroMemory(ddd_space,
sizeof(DDDEVICEIDENTIFIER2));
269 hr = pDD->GetDeviceIdentifier(pDX7DeviceID, 0x0);
271 wdxdisplay9_cat.error()
272 <<
"GetDeviceID failed for device (" << i <<
")" << D3DERRORSTRING(hr);
276 _card_ids[i].DeviceID = pDX7DeviceID->dwDeviceId;
277 _card_ids[i].VendorID = pDX7DeviceID->dwVendorId;
284 DDSCAPS2 ddsGAVMCaps;
285 DWORD dwVidMemTotal, dwVidMemFree;
286 dwVidMemTotal = dwVidMemFree = 0;
291 ZeroMemory(&ddsGAVMCaps,
sizeof(DDSCAPS2));
292 ddsGAVMCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
294 hr = pDD->GetAvailableVidMem(&ddsGAVMCaps, &dwVidMemTotal, &dwVidMemFree);
296 wdxdisplay9_cat.error()
297 <<
"GetAvailableVidMem failed for device #" << i
298 << D3DERRORSTRING(hr);
304 wdxdisplay9_cat.info()
305 <<
"DX 9.0c GetAvailableVidMem (including AGP) returns Total: " 306 << dwVidMemTotal <<
", Free: " << dwVidMemFree
307 <<
" for device #" << i << endl;
309 ZeroMemory(&ddsGAVMCaps,
sizeof(DDSCAPS2));
312 ddsGAVMCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
314 hr = pDD->GetAvailableVidMem(&ddsGAVMCaps, &dwVidMemTotal, &dwVidMemFree);
316 wdxdisplay9_cat.error() <<
"GetAvailableVidMem failed for device #" << i<< D3DERRORSTRING(hr);
320 if (hr == DDERR_NODIRECTDRAWHW)
325 wdxdisplay9_cat.info()
326 <<
"GetAvailableVidMem (no AGP) returns Total: " << dwVidMemTotal
327 <<
", Free: " << dwVidMemFree <<
" for device #" << i<< endl;
331 if (!dx_do_vidmemsize_check) {
333 _card_ids[i]._max_available_video_memory = UNKNOWN_VIDMEM_SIZE;
334 _card_ids[i]._is_low_memory_card =
false;
338 if (dwVidMemTotal == 0) {
339 dwVidMemTotal = UNKNOWN_VIDMEM_SIZE;
341 if (!ISPOW2(dwVidMemTotal)) {
347 dwVidMemTotal = 0xffffffffu;
349 dwVidMemTotal = (1u << count);
358 _card_ids[i]._max_available_video_memory = dwVidMemTotal;
368 bool bLowVidMemFlag =
369 ((dwVidMemTotal > CRAPPY_DRIVER_IS_LYING_VIDMEMTHRESHOLD) &&
370 (dwVidMemTotal< LOWVIDMEMTHRESHOLD));
372 _card_ids[i]._is_low_memory_card = bLowVidMemFlag;
373 wdxdisplay9_cat.info()
374 <<
"SetLowVidMem flag to " << bLowVidMemFlag
375 <<
" based on adjusted VidMemTotal: " << dwVidMemTotal << endl;
383 BOOL WINAPI wdxGraphicsPipe9::
384 dx7_driver_enum_callback(GUID *pGUID, TCHAR *strDesc, TCHAR *strName,
385 VOID *argptr, HMONITOR hm) {
389 ZeroMemory(&card_id,
sizeof(CardID));
392 card_id._monitor = MonitorFromWindow(GetDesktopWindow(),
393 MONITOR_DEFAULTTOPRIMARY);
395 card_id._monitor = hm;
398 if (pGUID !=
nullptr) {
399 memcpy(&card_id.DX7_DeviceGUID, pGUID,
sizeof(GUID));
402 card_id._max_available_video_memory = UNKNOWN_VIDMEM_SIZE;
404 self->_card_ids.push_back(card_id);
412 bool wdxGraphicsPipe9::
413 find_best_depth_format(
DXScreenData &Display, D3DDISPLAYMODE &Test_display_mode,
414 D3DFORMAT *pBestFmt,
bool bWantStencil,
415 bool bForce16bpp,
bool bVerboseMode)
const {
416 if (dxgsg9_cat.is_debug()) {
422 #define NUM_TEST_ZFMTS 6 423 #define FIRST_NON_STENCIL_ZFMT 3 424 static D3DFORMAT FormatPrefList[NUM_TEST_ZFMTS] = {
425 D3DFMT_D24S8, D3DFMT_D24X4S4, D3DFMT_D15S1,
426 D3DFMT_D32, D3DFMT_D24X8, D3DFMT_D16
432 *pBestFmt = D3DFMT_UNKNOWN;
436 bool bOnlySelect16bpp = (bForce16bpp ||
437 (IS_NVIDIA(Display._dx_device_id) && IS_16BPP_DISPLAY_FORMAT(Test_display_mode.Format)));
440 wdxdisplay9_cat.info()
441 <<
"FindBestDepthFmt: bSelectOnly16bpp: " << bOnlySelect16bpp << endl;
444 int first_format = (bWantStencil ? 0 : FIRST_NON_STENCIL_ZFMT);
445 for (
int i = first_format; i < NUM_TEST_ZFMTS; i++) {
446 D3DFORMAT TestDepthFmt = FormatPrefList[i];
448 if (bOnlySelect16bpp && !IS_16BPP_ZBUFFER(TestDepthFmt)) {
452 hr = Display._d3d9->CheckDeviceFormat(Display._card_id,
454 Test_display_mode.Format,
455 D3DUSAGE_DEPTHSTENCIL,
456 D3DRTYPE_SURFACE, TestDepthFmt);
459 if (hr == D3DERR_NOTAVAILABLE) {
461 wdxdisplay9_cat.info()
462 <<
"FindBestDepthFmt: ChkDevFmt returns NotAvail for " 463 << D3DFormatStr(TestDepthFmt) << endl;
467 wdxdisplay9_cat.error()
468 <<
"unexpected CheckDeviceFormat failure" << D3DERRORSTRING(hr)
473 hr = Display._d3d9->CheckDepthStencilMatch(Display._card_id,
475 Test_display_mode.Format,
476 Test_display_mode.Format,
479 *pBestFmt = TestDepthFmt;
482 if (hr == D3DERR_NOTAVAILABLE) {
484 wdxdisplay9_cat.info()
485 <<
"FindBestDepthFmt: ChkDepMatch returns NotAvail for " 486 << D3DFormatStr(Test_display_mode.Format) <<
", " 487 << D3DFormatStr(TestDepthFmt) << endl;
490 wdxdisplay9_cat.error()
491 <<
"unexpected CheckDepthStencilMatch failure for " 492 << D3DFormatStr(Test_display_mode.Format) <<
", " 493 << D3DFormatStr(TestDepthFmt) << endl;
500 wdxdisplay9_cat.info()
501 <<
"FindBestDepthFmt returns fmt " << D3DFormatStr(*pBestFmt) << endl;
504 return (*pBestFmt != D3DFMT_UNKNOWN);
513 DWORD VendorId = scrn._dx_device_id.VendorId;
514 DWORD DeviceId = scrn._dx_device_id.DeviceId;
518 if ((x_size == 640) && (y_size == 480)) {
521 if ((x_size == 800) && (y_size == 600)) {
524 if ((x_size == 1024) && (y_size == 768)) {
539 UINT RequestedX_Size, UINT RequestedY_Size,
540 bool bWantZBuffer,
bool bWantStencil,
541 UINT *p_supported_screen_depths_mask,
542 bool *pCouldntFindAnyValidZBuf,
543 D3DFORMAT *pSuggestedPixFmt,
544 bool bForce16bppZBuffer,
546 if (dxgsg9_cat.is_debug()) {
550 assert(IS_VALID_PTR(scrn._d3d9));
554 *pSuggestedPixFmt = D3DFMT_UNKNOWN;
555 *p_supported_screen_depths_mask = 0x0;
556 *pCouldntFindAnyValidZBuf =
false;
558 #define TOTAL_D3D_FORMATS 5 559 static D3DFORMAT d3d_format_array [TOTAL_D3D_FORMATS] =
570 for (format_index = 0; format_index < TOTAL_D3D_FORMATS; format_index++) {
571 D3DFORMAT d3d_format;
573 d3d_format = d3d_format_array [format_index];
575 int cNumModes = scrn._d3d9->GetAdapterModeCount(scrn._card_id, d3d_format);
577 D3DDISPLAYMODE BestDispMode;
578 ZeroMemory(&BestDispMode,
sizeof(BestDispMode));
581 wdxdisplay9_cat.info()
582 <<
"searching for valid display modes at res: (" 583 << RequestedX_Size <<
", " << RequestedY_Size
584 <<
"), TotalModes: " << cNumModes << endl;
590 bool bDoMemBasedChecks =
591 ((!((RequestedX_Size == 640)&&(RequestedY_Size == 480))) &&
592 (scrn._max_available_video_memory != UNKNOWN_VIDMEM_SIZE) &&
596 wdxdisplay9_cat.info()
597 <<
"DoMemBasedChecks = " << bDoMemBasedChecks << endl;
600 for (
int i = 0; i < cNumModes; i++) {
601 D3DDISPLAYMODE dispmode;
602 hr = scrn._d3d9->EnumAdapterModes(scrn._card_id, d3d_format, i, &dispmode);
604 wdxdisplay9_cat.error()
605 <<
"EnumAdapter_display_mode failed for device #" 606 << scrn._card_id << D3DERRORSTRING(hr);
610 if ((dispmode.Width != RequestedX_Size) ||
611 (dispmode.Height != RequestedY_Size)) {
613 wdxdisplay9_cat.info()
614 <<
"Mode dimension " << dispmode.Width <<
"x" << dispmode.Height
615 <<
"; format " << D3DFormatStr(dispmode.Format)
616 <<
": onto next mode\n";
624 if ((dispmode.RefreshRate<60) && (dispmode.RefreshRate>1)) {
628 wdxdisplay9_cat.info()
629 <<
"skipping mode[" << i <<
"], bad refresh rate: " 630 << dispmode.RefreshRate << endl;
640 hr = scrn._d3d9->CheckDeviceFormat(scrn._card_id, D3DDEVTYPE_HAL, dispmode.Format,
641 D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE,
644 if (hr == D3DERR_NOTAVAILABLE) {
646 wdxdisplay9_cat.info()
647 <<
"skipping mode[" << i
648 <<
"], CheckDevFmt returns NotAvail for fmt: " 649 << D3DFormatStr(dispmode.Format) << endl;
653 wdxdisplay9_cat.error()
654 <<
"CheckDeviceFormat failed for device #" 655 << scrn._card_id << D3DERRORSTRING(hr);
660 bool bIs16bppRenderTgt = IS_16BPP_DISPLAY_FORMAT(dispmode.Format);
661 PN_stdfloat RendTgtMinMemReqmt = 0.0f;
665 if (bDoMemBasedChecks) {
673 #define REQD_TEXMEM 1800000 675 PN_stdfloat bytes_per_pixel = (bIs16bppRenderTgt ? 2 : 4);
680 ((PN_stdfloat)RequestedX_Size) * ((PN_stdfloat)RequestedY_Size) *
681 bytes_per_pixel * 2 + REQD_TEXMEM;
684 wdxdisplay9_cat.info()
685 <<
"Testing Mode (" <<RequestedX_Size<<
"x" << RequestedY_Size
686 <<
", " << D3DFormatStr(dispmode.Format) <<
")\nReqdVidMem: " 687 << (int)RendTgtMinMemReqmt <<
" AvailVidMem: " 688 << scrn._max_available_video_memory << endl;
690 if (RendTgtMinMemReqmt > scrn._max_available_video_memory) {
692 wdxdisplay9_cat.info()
693 <<
"not enough VidMem for render tgt, skipping display fmt " 694 << D3DFormatStr(dispmode.Format) <<
" (" 695 << (int)RendTgtMinMemReqmt <<
" > " 696 << scrn._max_available_video_memory <<
")\n";
703 if (!find_best_depth_format(scrn, dispmode, &zformat,
704 bWantStencil, bForce16bppZBuffer)) {
705 *pCouldntFindAnyValidZBuf =
true;
709 PN_stdfloat MinMemReqmt = 0.0f;
711 if (bDoMemBasedChecks) {
713 PN_stdfloat zbytes_per_pixel = (IS_16BPP_ZBUFFER(zformat) ? 2 : 4);
714 PN_stdfloat MinMemReqmt = RendTgtMinMemReqmt + ((PN_stdfloat)RequestedX_Size)*((PN_stdfloat)RequestedY_Size)*zbytes_per_pixel;
717 wdxdisplay9_cat.info()
718 <<
"Testing Mode w/Z (" << RequestedX_Size <<
"x" 719 << RequestedY_Size <<
", " << D3DFormatStr(dispmode.Format)
720 <<
")\nReqdVidMem: " << (int)MinMemReqmt <<
" AvailVidMem: " 721 << scrn._max_available_video_memory << endl;
723 if (MinMemReqmt > scrn._max_available_video_memory) {
725 wdxdisplay9_cat.info()
726 <<
"not enough VidMem for RendTgt+zbuf, skipping display fmt " 727 << D3DFormatStr(dispmode.Format) <<
" (" << (int)MinMemReqmt
728 <<
" > " << scrn._max_available_video_memory <<
")\n";
735 if ((!bDoMemBasedChecks) || (MinMemReqmt<scrn._max_available_video_memory)) {
736 if (!IS_16BPP_ZBUFFER(zformat)) {
739 if (!find_best_depth_format(scrn, dispmode, &zformat,
740 bWantStencil,
true, bVerboseMode)) {
742 wdxdisplay9_cat.info()
743 <<
"FindBestDepthFmt rejected Mode[" << i <<
"] (" 744 << RequestedX_Size <<
"x" << RequestedY_Size
745 <<
", " << D3DFormatStr(dispmode.Format) << endl;
746 *pCouldntFindAnyValidZBuf =
true;
752 *p_supported_screen_depths_mask |=
753 (IS_16BPP_DISPLAY_FORMAT(dispmode.Format) ? DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG : DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG);
760 wdxdisplay9_cat.info()
761 <<
"Validated Mode (" << RequestedX_Size <<
"x" 762 << RequestedY_Size <<
", " << D3DFormatStr(dispmode.Format) << endl;
769 switch (dispmode.Format) {
770 case D3DFMT_X1R5G5B5:
771 *p_supported_screen_depths_mask |= X1R5G5B5_FLAG;
773 case D3DFMT_X8R8G8B8:
774 *p_supported_screen_depths_mask |= X8R8G8B8_FLAG;
776 case D3DFMT_A8R8G8B8:
777 *p_supported_screen_depths_mask |= A8R8G8B8_FLAG;
780 *p_supported_screen_depths_mask |= R5G6B5_FLAG;
782 case D3DFMT_A2R10G10B10:
783 *p_supported_screen_depths_mask |= A2B10G10R10_FLAG;
786 wdxdisplay9_cat.error()
787 <<
"unrecognized supported fmt " << D3DFormatStr(dispmode.Format)
788 <<
" returned by EnumAdapter_display_modes!\n";
794 if (*p_supported_screen_depths_mask & X8R8G8B8_FLAG) {
795 *pSuggestedPixFmt = D3DFMT_X8R8G8B8;
796 }
else if (*p_supported_screen_depths_mask & A8R8G8B8_FLAG) {
797 *pSuggestedPixFmt = D3DFMT_A8R8G8B8;
798 }
else if (*p_supported_screen_depths_mask & R5G6B5_FLAG) {
799 *pSuggestedPixFmt = D3DFMT_R5G6B5;
800 }
else if (*p_supported_screen_depths_mask & X1R5G5B5_FLAG) {
801 *pSuggestedPixFmt = D3DFMT_X1R5G5B5;
802 }
else if (*p_supported_screen_depths_mask & A2B10G10R10_FLAG) {
803 *pSuggestedPixFmt = D3DFMT_A2R10G10B10;
807 wdxdisplay9_cat.info()
808 <<
"search_for_valid_device returns fmt: " 809 << D3DFormatStr(*pSuggestedPixFmt) << endl;
812 if (*pSuggestedPixFmt != D3DFMT_UNKNOWN) {
823 make_device(
void *scrn) {
825 memcpy(&device->_Scrn, scrn,
sizeof(device->_Scrn));
826 device->_d3d_device = device->_Scrn._d3d_device;
829 wdxdisplay9_cat.info() <<
"walla: device" << device <<
"\n";
836 void Init_D3DFORMAT_map() {
837 if (g_D3DFORMATmap.size() != 0)
840 #define INSERT_ELEM(XX) g_D3DFORMATmap[XX##_FLAG] = D3DFMT_##XX; 843 INSERT_ELEM(A8R8G8B8);
844 INSERT_ELEM(X8R8G8B8);
846 INSERT_ELEM(X1R5G5B5);
847 INSERT_ELEM(A1R5G5B5);
848 INSERT_ELEM(A4R4G4B4);
851 INSERT_ELEM(A8R3G3B2);
852 INSERT_ELEM(X4R4G4B4);
853 INSERT_ELEM(A2B10G10R10);
866 INSERT_ELEM(A2W10V10U10);
878 const char *D3DFormatStr(D3DFORMAT fmt) {
880 #define CASESTR(XX) case XX: return #XX; 882 CASESTR(D3DFMT_UNKNOWN);
883 CASESTR(D3DFMT_R8G8B8);
884 CASESTR(D3DFMT_A8R8G8B8);
885 CASESTR(D3DFMT_X8R8G8B8);
886 CASESTR(D3DFMT_R5G6B5);
887 CASESTR(D3DFMT_X1R5G5B5);
888 CASESTR(D3DFMT_A1R5G5B5);
889 CASESTR(D3DFMT_A4R4G4B4);
890 CASESTR(D3DFMT_R3G3B2);
892 CASESTR(D3DFMT_A8R3G3B2);
893 CASESTR(D3DFMT_X4R4G4B4);
894 CASESTR(D3DFMT_A2B10G10R10);
895 CASESTR(D3DFMT_G16R16);
896 CASESTR(D3DFMT_A8P8);
899 CASESTR(D3DFMT_A8L8);
900 CASESTR(D3DFMT_A4L4);
901 CASESTR(D3DFMT_V8U8);
902 CASESTR(D3DFMT_L6V5U5);
903 CASESTR(D3DFMT_X8L8V8U8);
904 CASESTR(D3DFMT_Q8W8V8U8);
905 CASESTR(D3DFMT_V16U16);
907 CASESTR(D3DFMT_A2W10V10U10);
908 CASESTR(D3DFMT_ATI1);
909 CASESTR(D3DFMT_ATI2);
910 CASESTR(D3DFMT_DXT1);
911 CASESTR(D3DFMT_DXT2);
912 CASESTR(D3DFMT_DXT3);
913 CASESTR(D3DFMT_DXT4);
914 CASESTR(D3DFMT_DXT5);
915 CASESTR(D3DFMT_D16_LOCKABLE);
917 CASESTR(D3DFMT_D15S1);
918 CASESTR(D3DFMT_D24S8);
920 CASESTR(D3DFMT_D24X8);
921 CASESTR(D3DFMT_D24X4S4);
922 CASESTR(D3DFMT_INTZ);
923 CASESTR(D3DFMT_VERTEXDATA);
924 CASESTR(D3DFMT_INDEX16);
925 CASESTR(D3DFMT_INDEX32);
926 CASESTR(D3DFMT_A16B16G16R16F);
927 CASESTR(D3DFMT_A32B32G32R32F);
930 return "Invalid D3DFORMAT";
A GraphicsStateGuardian for rendering into DirectX9 contexts.
This is our own Panda specialization on the default STL map.
A GraphicsDevice necessary for multi-window rendering in DX.
int get_next_higher_bit(uint16_t x)
Returns the smallest power of 2 greater than x.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual std::string get_interface_name() const
Returns the name of the rendering interface associated with this GraphicsPipe.
void search_for_valid_displaymode(DXScreenData &scrn, UINT RequestedX_Size, UINT RequestedY_Size, bool bWantZBuffer, bool bWantStencil, UINT *p_supported_screen_depths_mask, bool *pCouldntFindAnyValidZBuf, D3DFORMAT *pSuggestedPixFmt, bool bForce16bppZBuffer, bool bVerboseMode=false)
All ptr args are output parameters.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An offscreen render buffer.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool special_check_fullscreen_resolution(DXScreenData &scrn, UINT x_size, UINT y_size)
overrides of the general estimator for known working cases
is_valid
Returns true if the GSG has been correctly initialized within a graphics context, false if there has ...
An object to create GraphicsOutputs that share a particular 3-D API.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
bool get_supports_render_texture() const
Returns true if this particular GSG can render from a wdxGraphicsBuffer9 directly into a texture,...
This is a base class for the various different classes that represent the result of a frame of render...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single graphics window for rendering DirectX under Microsoft Windows.
An abstract device object that is part of Graphics Pipe.
Encapsulates all the communication with a particular instance of a given rendering backend.
PT(GraphicsPipe) wdxGraphicsPipe9
This function is passed to the GraphicsPipeSelection object to allow the user to make a default wdxGr...
bool needs_reset() const
Returns true if the gsg is marked as needing a reset.
This graphics pipe represents the interface for creating DirectX9 graphics windows.
This class is the main interface to controlling the render process.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...