15 #include "wdxGraphicsPipe9.h"
16 #include "dxGraphicsDevice9.h"
17 #include "wdxGraphicsWindow9.h"
18 #include "wdxGraphicsBuffer9.h"
19 #include "config_dxgsg9.h"
23 #define LOWVIDMEMTHRESHOLD 5700000 // 4MB cards should fall below this
24 #define CRAPPY_DRIVER_IS_LYING_VIDMEMTHRESHOLD 1000000 // if # is > 1MB, card is lying and I cant tell what it is
25 #define UNKNOWN_VIDMEM_SIZE 0xFFFFFFFF
47 RELEASE(__d3d9, wdxdisplay9,
"ID3D9", RELEASE_DOWN_TO_ZERO);
48 SAFE_FREELIB(_hD3D9_DLL);
49 SAFE_FREELIB(_hDDrawDLL);
85 make_output(const
string &name,
101 DCAST_INTO_R(wdxgsg, gsg, NULL);
107 if (((flags&BF_require_parasite)!=0)||
108 ((flags&BF_refuse_window)!=0)||
109 ((flags&BF_resizeable)!=0)||
110 ((flags&BF_size_track_host)!=0)||
111 ((flags&BF_rtt_cumulative)!=0)||
112 ((flags&BF_can_bind_color)!=0)||
113 ((flags&BF_can_bind_every)!=0)) {
118 if ((flags & BF_fb_props_optional) == 0) {
119 if ((fb_prop.get_aux_rgba() > 0)||
120 (fb_prop.get_aux_rgba() > 0)||
121 (fb_prop.get_aux_float() > 0)) {
132 if ((!support_render_texture)||
133 ((flags&BF_require_parasite)!=0)||
134 ((flags&BF_require_window)!=0)||
135 ((flags&BF_rtt_cumulative)!=0)||
136 ((flags&BF_can_bind_every)!=0)) {
141 if ((flags & BF_fb_props_optional) == 0) {
142 if (fb_prop.get_indexed_color() ||
143 (fb_prop.get_back_buffers() > 0)||
144 (fb_prop.get_accum_bits() > 0)||
145 (fb_prop.get_multisamples() > 0)) {
174 bool wdxGraphicsPipe9::
176 if (!MyLoadLib(_hDDrawDLL,
"ddraw.dll")) {
180 if (!MyGetProcAddr(_hDDrawDLL, (FARPROC*)&_DirectDrawCreateEx,
"DirectDrawCreateEx")) {
184 if (!MyGetProcAddr(_hDDrawDLL, (FARPROC*)&_DirectDrawEnumerateExA,
"DirectDrawEnumerateExA")) {
188 if (!MyLoadLib(_hD3D9_DLL,
"d3d9.dll")) {
192 if (!MyGetProcAddr(_hD3D9_DLL, (FARPROC*)&_Direct3DCreate9,
"Direct3DCreate9")) {
201 #define D3D_SDK_VERSION_9_0 D3D_SDK_VERSION
202 #define D3D_SDK_VERSION_9_1 D3D_SDK_VERSION
205 WIN32_FIND_DATA TempFindData;
207 char tmppath[_MAX_PATH + 128];
208 GetSystemDirectory(tmppath, MAX_PATH);
209 strcat(tmppath,
"\\dpnhpast.dll");
210 hFind = FindFirstFile (tmppath, &TempFindData);
211 if (hFind != INVALID_HANDLE_VALUE) {
215 __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION_9_1);
218 __d3d9 = (*_Direct3DCreate9)(D3D_SDK_VERSION_9_0);
220 if (__d3d9 == NULL) {
221 wdxdisplay9_cat.error() <<
"Direct3DCreate9(9." << (__is_dx9_1 ?
"1" :
"0") <<
") failed!, error = " << GetLastError() << endl;
226 Init_D3DFORMAT_map();
228 if (dx_count_all_cards_memory){
229 return find_all_card_memavails();
245 bool wdxGraphicsPipe9::
246 find_all_card_memavails() {
249 hr = (*_DirectDrawEnumerateExA)(dx7_driver_enum_callback,
this,
250 DDENUM_ATTACHEDSECONDARYDEVICES | DDENUM_NONDISPLAYDEVICES);
252 wdxdisplay9_cat.fatal()
253 <<
"DirectDrawEnumerateEx failed" << D3DERRORSTRING(hr);
257 if (_card_ids.empty()) {
258 wdxdisplay9_cat.error()
259 <<
"DirectDrawEnumerateEx enum'ed no devices!\n";
264 ZeroMemory(&ZeroGUID,
sizeof(GUID));
266 if (_card_ids.size() > 1) {
267 assert(IsEqualGUID(ZeroGUID, _card_ids[0].DX7_DeviceGUID));
270 _card_ids.erase(_card_ids.begin());
273 for (UINT i = 0; i < _card_ids.size(); i++) {
275 BYTE ddd_space[
sizeof(DDDEVICEIDENTIFIER2)+4];
276 DDDEVICEIDENTIFIER2 *pDX7DeviceID = (DDDEVICEIDENTIFIER2 *)&ddd_space[0];
277 GUID *pGUID = &(_card_ids[i].DX7_DeviceGUID);
279 if (IsEqualGUID(*pGUID, ZeroGUID)) {
284 hr = (*_DirectDrawCreateEx)(pGUID, (
void **)&pDD, IID_IDirectDraw7, NULL);
286 wdxdisplay9_cat.error()
287 <<
"DirectDrawCreateEx failed for device (" << i
288 <<
")" << D3DERRORSTRING(hr);
292 ZeroMemory(ddd_space,
sizeof(DDDEVICEIDENTIFIER2));
294 hr = pDD->GetDeviceIdentifier(pDX7DeviceID, 0x0);
296 wdxdisplay9_cat.error()
297 <<
"GetDeviceID failed for device (" << i <<
")" << D3DERRORSTRING(hr);
301 _card_ids[i].DeviceID = pDX7DeviceID->dwDeviceId;
302 _card_ids[i].VendorID = pDX7DeviceID->dwVendorId;
309 DDSCAPS2 ddsGAVMCaps;
310 DWORD dwVidMemTotal, dwVidMemFree;
311 dwVidMemTotal = dwVidMemFree = 0;
317 ZeroMemory(&ddsGAVMCaps,
sizeof(DDSCAPS2));
318 ddsGAVMCaps.dwCaps = DDSCAPS_VIDEOMEMORY;
320 hr = pDD->GetAvailableVidMem(&ddsGAVMCaps, &dwVidMemTotal, &dwVidMemFree);
322 wdxdisplay9_cat.error()
323 <<
"GetAvailableVidMem failed for device #" << i
324 << D3DERRORSTRING(hr);
330 wdxdisplay9_cat.info()
331 <<
"DX 9.0c GetAvailableVidMem (including AGP) returns Total: "
332 << dwVidMemTotal <<
", Free: " << dwVidMemFree
333 <<
" for device #" << i << endl;
335 ZeroMemory(&ddsGAVMCaps,
sizeof(DDSCAPS2));
338 ddsGAVMCaps.dwCaps = DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM;
340 hr = pDD->GetAvailableVidMem(&ddsGAVMCaps, &dwVidMemTotal, &dwVidMemFree);
342 wdxdisplay9_cat.error() <<
"GetAvailableVidMem failed for device #" << i<< D3DERRORSTRING(hr);
345 if (hr == DDERR_NODIRECTDRAWHW)
350 wdxdisplay9_cat.info()
351 <<
"GetAvailableVidMem (no AGP) returns Total: " << dwVidMemTotal
352 <<
", Free: " << dwVidMemFree <<
" for device #" << i<< endl;
356 if (!dx_do_vidmemsize_check) {
358 _card_ids[i]._max_available_video_memory = UNKNOWN_VIDMEM_SIZE;
359 _card_ids[i]._is_low_memory_card =
false;
363 if (dwVidMemTotal == 0) {
364 dwVidMemTotal = UNKNOWN_VIDMEM_SIZE;
366 if (!ISPOW2(dwVidMemTotal)) {
370 while ((dwVidMemTotal >> count) != 0x0) {
373 dwVidMemTotal = (1 << count);
381 _card_ids[i]._max_available_video_memory = dwVidMemTotal;
391 bool bLowVidMemFlag =
392 ((dwVidMemTotal > CRAPPY_DRIVER_IS_LYING_VIDMEMTHRESHOLD) &&
393 (dwVidMemTotal< LOWVIDMEMTHRESHOLD));
395 _card_ids[i]._is_low_memory_card = bLowVidMemFlag;
396 wdxdisplay9_cat.info()
397 <<
"SetLowVidMem flag to " << bLowVidMemFlag
398 <<
" based on adjusted VidMemTotal: " << dwVidMemTotal << endl;
408 BOOL WINAPI wdxGraphicsPipe9::
409 dx7_driver_enum_callback(GUID *pGUID, TCHAR *strDesc, TCHAR *strName,
410 VOID *argptr, HMONITOR hm) {
414 ZeroMemory(&card_id,
sizeof(CardID));
417 card_id._monitor = MonitorFromWindow(GetDesktopWindow(),
418 MONITOR_DEFAULTTOPRIMARY);
420 card_id._monitor = hm;
424 memcpy(&card_id.DX7_DeviceGUID, pGUID,
sizeof(GUID));
427 card_id._max_available_video_memory = UNKNOWN_VIDMEM_SIZE;
429 self->_card_ids.push_back(card_id);
439 bool wdxGraphicsPipe9::
440 find_best_depth_format(
DXScreenData &Display, D3DDISPLAYMODE &Test_display_mode,
441 D3DFORMAT *pBestFmt,
bool bWantStencil,
442 bool bForce16bpp,
bool bVerboseMode)
const {
443 if (dxgsg9_cat.is_debug()) {
449 #define NUM_TEST_ZFMTS 6
450 #define FIRST_NON_STENCIL_ZFMT 3
451 static D3DFORMAT FormatPrefList[NUM_TEST_ZFMTS] = {
452 D3DFMT_D24S8, D3DFMT_D24X4S4, D3DFMT_D15S1,
453 D3DFMT_D32, D3DFMT_D24X8, D3DFMT_D16
458 *pBestFmt = D3DFMT_UNKNOWN;
462 bool bOnlySelect16bpp = (bForce16bpp ||
463 (IS_NVIDIA(Display._dx_device_id) && IS_16BPP_DISPLAY_FORMAT(Test_display_mode.Format)));
466 wdxdisplay9_cat.info()
467 <<
"FindBestDepthFmt: bSelectOnly16bpp: " << bOnlySelect16bpp << endl;
470 int first_format = (bWantStencil ? 0 : FIRST_NON_STENCIL_ZFMT);
471 for (
int i = first_format; i < NUM_TEST_ZFMTS; i++) {
472 D3DFORMAT TestDepthFmt = FormatPrefList[i];
474 if (bOnlySelect16bpp && !IS_16BPP_ZBUFFER(TestDepthFmt)) {
478 hr = Display._d3d9->CheckDeviceFormat(Display._card_id,
480 Test_display_mode.Format,
481 D3DUSAGE_DEPTHSTENCIL,
482 D3DRTYPE_SURFACE, TestDepthFmt);
485 if (hr == D3DERR_NOTAVAILABLE) {
487 wdxdisplay9_cat.info()
488 <<
"FindBestDepthFmt: ChkDevFmt returns NotAvail for "
489 << D3DFormatStr(TestDepthFmt) << endl;
493 wdxdisplay9_cat.error()
494 <<
"unexpected CheckDeviceFormat failure" << D3DERRORSTRING(hr)
499 hr = Display._d3d9->CheckDepthStencilMatch(Display._card_id,
501 Test_display_mode.Format,
502 Test_display_mode.Format,
505 *pBestFmt = TestDepthFmt;
508 if (hr == D3DERR_NOTAVAILABLE) {
510 wdxdisplay9_cat.info()
511 <<
"FindBestDepthFmt: ChkDepMatch returns NotAvail for "
512 << D3DFormatStr(Test_display_mode.Format) <<
", "
513 << D3DFormatStr(TestDepthFmt) << endl;
516 wdxdisplay9_cat.error()
517 <<
"unexpected CheckDepthStencilMatch failure for "
518 << D3DFormatStr(Test_display_mode.Format) <<
", "
519 << D3DFormatStr(TestDepthFmt) << endl;
526 wdxdisplay9_cat.info()
527 <<
"FindBestDepthFmt returns fmt " << D3DFormatStr(*pBestFmt) << endl;
530 return (*pBestFmt != D3DFMT_UNKNOWN);
542 DWORD VendorId = scrn._dx_device_id.VendorId;
543 DWORD DeviceId = scrn._dx_device_id.DeviceId;
547 if ((x_size == 640) && (y_size == 480)) {
550 if ((x_size == 800) && (y_size == 600)) {
553 if ((x_size == 1024) && (y_size == 768)) {
570 UINT RequestedX_Size, UINT RequestedY_Size,
571 bool bWantZBuffer,
bool bWantStencil,
572 UINT *p_supported_screen_depths_mask,
573 bool *pCouldntFindAnyValidZBuf,
574 D3DFORMAT *pSuggestedPixFmt,
575 bool bForce16bppZBuffer,
577 if (dxgsg9_cat.is_debug()) {
581 assert(IS_VALID_PTR(scrn._d3d9));
585 *pSuggestedPixFmt = D3DFMT_UNKNOWN;
586 *p_supported_screen_depths_mask = 0x0;
587 *pCouldntFindAnyValidZBuf =
false;
589 #define TOTAL_D3D_FORMATS 5
590 static D3DFORMAT d3d_format_array [TOTAL_D3D_FORMATS] =
601 for (format_index = 0; format_index < TOTAL_D3D_FORMATS; format_index++) {
602 D3DFORMAT d3d_format;
604 d3d_format = d3d_format_array [format_index];
606 int cNumModes = scrn._d3d9->GetAdapterModeCount(scrn._card_id, d3d_format);
608 D3DDISPLAYMODE BestDispMode;
609 ZeroMemory(&BestDispMode,
sizeof(BestDispMode));
612 wdxdisplay9_cat.info()
613 <<
"searching for valid display modes at res: ("
614 << RequestedX_Size <<
", " << RequestedY_Size
615 <<
"), TotalModes: " << cNumModes << endl;
621 bool bDoMemBasedChecks =
622 ((!((RequestedX_Size == 640)&&(RequestedY_Size == 480))) &&
623 (scrn._max_available_video_memory != UNKNOWN_VIDMEM_SIZE) &&
627 wdxdisplay9_cat.info()
628 <<
"DoMemBasedChecks = " << bDoMemBasedChecks << endl;
631 for (
int i = 0; i < cNumModes; i++) {
632 D3DDISPLAYMODE dispmode;
633 hr = scrn._d3d9->EnumAdapterModes(scrn._card_id, d3d_format, i, &dispmode);
635 wdxdisplay9_cat.error()
636 <<
"EnumAdapter_display_mode failed for device #"
637 << scrn._card_id << D3DERRORSTRING(hr);
641 if ((dispmode.Width != RequestedX_Size) ||
642 (dispmode.Height != RequestedY_Size)) {
644 wdxdisplay9_cat.info()
645 <<
"Mode dimension " << dispmode.Width <<
"x" << dispmode.Height
646 <<
"; format " << D3DFormatStr(dispmode.Format)
647 <<
": onto next mode\n";
655 if ((dispmode.RefreshRate<60) && (dispmode.RefreshRate>1)) {
659 wdxdisplay9_cat.info()
660 <<
"skipping mode[" << i <<
"], bad refresh rate: "
661 << dispmode.RefreshRate << endl;
671 hr = scrn._d3d9->CheckDeviceFormat(scrn._card_id, D3DDEVTYPE_HAL, dispmode.Format,
672 D3DUSAGE_RENDERTARGET, D3DRTYPE_SURFACE,
675 if (hr == D3DERR_NOTAVAILABLE) {
677 wdxdisplay9_cat.info()
678 <<
"skipping mode[" << i
679 <<
"], CheckDevFmt returns NotAvail for fmt: "
680 << D3DFormatStr(dispmode.Format) << endl;
684 wdxdisplay9_cat.error()
685 <<
"CheckDeviceFormat failed for device #"
686 << scrn._card_id << D3DERRORSTRING(hr);
691 bool bIs16bppRenderTgt = IS_16BPP_DISPLAY_FORMAT(dispmode.Format);
692 PN_stdfloat RendTgtMinMemReqmt = 0.0f;
696 if (bDoMemBasedChecks) {
704 #define REQD_TEXMEM 1800000
706 PN_stdfloat bytes_per_pixel = (bIs16bppRenderTgt ? 2 : 4);
711 ((PN_stdfloat)RequestedX_Size) * ((PN_stdfloat)RequestedY_Size) *
712 bytes_per_pixel * 2 + REQD_TEXMEM;
715 wdxdisplay9_cat.info()
716 <<
"Testing Mode (" <<RequestedX_Size<<
"x" << RequestedY_Size
717 <<
", " << D3DFormatStr(dispmode.Format) <<
")\nReqdVidMem: "
718 << (int)RendTgtMinMemReqmt <<
" AvailVidMem: "
719 << scrn._max_available_video_memory << endl;
721 if (RendTgtMinMemReqmt > scrn._max_available_video_memory) {
723 wdxdisplay9_cat.info()
724 <<
"not enough VidMem for render tgt, skipping display fmt "
725 << D3DFormatStr(dispmode.Format) <<
" ("
726 << (int)RendTgtMinMemReqmt <<
" > "
727 << scrn._max_available_video_memory <<
")\n";
734 if (!find_best_depth_format(scrn, dispmode, &zformat,
735 bWantStencil, bForce16bppZBuffer)) {
736 *pCouldntFindAnyValidZBuf =
true;
740 PN_stdfloat MinMemReqmt = 0.0f;
742 if (bDoMemBasedChecks) {
744 PN_stdfloat zbytes_per_pixel = (IS_16BPP_ZBUFFER(zformat) ? 2 : 4);
745 PN_stdfloat MinMemReqmt = RendTgtMinMemReqmt + ((PN_stdfloat)RequestedX_Size)*((PN_stdfloat)RequestedY_Size)*zbytes_per_pixel;
748 wdxdisplay9_cat.info()
749 <<
"Testing Mode w/Z (" << RequestedX_Size <<
"x"
750 << RequestedY_Size <<
", " << D3DFormatStr(dispmode.Format)
751 <<
")\nReqdVidMem: " << (int)MinMemReqmt <<
" AvailVidMem: "
752 << scrn._max_available_video_memory << endl;
754 if (MinMemReqmt > scrn._max_available_video_memory) {
756 wdxdisplay9_cat.info()
757 <<
"not enough VidMem for RendTgt+zbuf, skipping display fmt "
758 << D3DFormatStr(dispmode.Format) <<
" (" << (int)MinMemReqmt
759 <<
" > " << scrn._max_available_video_memory <<
")\n";
766 if ((!bDoMemBasedChecks) || (MinMemReqmt<scrn._max_available_video_memory)) {
767 if (!IS_16BPP_ZBUFFER(zformat)) {
770 if (!find_best_depth_format(scrn, dispmode, &zformat,
771 bWantStencil,
true, bVerboseMode)) {
773 wdxdisplay9_cat.info()
774 <<
"FindBestDepthFmt rejected Mode[" << i <<
"] ("
775 << RequestedX_Size <<
"x" << RequestedY_Size
776 <<
", " << D3DFormatStr(dispmode.Format) << endl;
777 *pCouldntFindAnyValidZBuf =
true;
783 *p_supported_screen_depths_mask |=
784 (IS_16BPP_DISPLAY_FORMAT(dispmode.Format) ? DISPLAY_16BPP_REQUIRES_16BPP_ZBUFFER_FLAG : DISPLAY_32BPP_REQUIRES_16BPP_ZBUFFER_FLAG);
791 wdxdisplay9_cat.info()
792 <<
"Validated Mode (" << RequestedX_Size <<
"x"
793 << RequestedY_Size <<
", " << D3DFormatStr(dispmode.Format) << endl;
800 switch (dispmode.Format) {
801 case D3DFMT_X1R5G5B5:
802 *p_supported_screen_depths_mask |= X1R5G5B5_FLAG;
804 case D3DFMT_X8R8G8B8:
805 *p_supported_screen_depths_mask |= X8R8G8B8_FLAG;
807 case D3DFMT_A8R8G8B8:
808 *p_supported_screen_depths_mask |= A8R8G8B8_FLAG;
811 *p_supported_screen_depths_mask |= R5G6B5_FLAG;
813 case D3DFMT_A2R10G10B10:
814 *p_supported_screen_depths_mask |= A2B10G10R10_FLAG;
817 wdxdisplay9_cat.error()
818 <<
"unrecognized supported fmt " << D3DFormatStr(dispmode.Format)
819 <<
" returned by EnumAdapter_display_modes!\n";
825 if (*p_supported_screen_depths_mask & X8R8G8B8_FLAG) {
826 *pSuggestedPixFmt = D3DFMT_X8R8G8B8;
827 }
else if (*p_supported_screen_depths_mask & A8R8G8B8_FLAG) {
828 *pSuggestedPixFmt = D3DFMT_A8R8G8B8;
829 }
else if (*p_supported_screen_depths_mask & R5G6B5_FLAG) {
830 *pSuggestedPixFmt = D3DFMT_R5G6B5;
831 }
else if (*p_supported_screen_depths_mask & X1R5G5B5_FLAG) {
832 *pSuggestedPixFmt = D3DFMT_X1R5G5B5;
833 }
else if (*p_supported_screen_depths_mask & A2B10G10R10_FLAG) {
834 *pSuggestedPixFmt = D3DFMT_A2R10G10B10;
838 wdxdisplay9_cat.info()
839 <<
"search_for_valid_device returns fmt: "
840 << D3DFormatStr(*pSuggestedPixFmt) << endl;
843 if (*pSuggestedPixFmt != D3DFMT_UNKNOWN) {
856 make_device(
void *scrn) {
858 memcpy(&device->_Scrn, scrn, sizeof(device->_Scrn));
859 device->_d3d_device = device->_Scrn._d3d_device;
862 wdxdisplay9_cat.info() << "walla: device" << device << "\n";
867 pmap<D3DFORMAT_FLAG, D3DFORMAT> g_D3DFORMATmap;
869 void Init_D3DFORMAT_map() {
870 if (g_D3DFORMATmap.size() != 0)
873 #define INSERT_ELEM(XX) g_D3DFORMATmap[XX##_FLAG] = D3DFMT_##XX;
876 INSERT_ELEM(A8R8G8B8);
877 INSERT_ELEM(X8R8G8B8);
879 INSERT_ELEM(X1R5G5B5);
880 INSERT_ELEM(A1R5G5B5);
881 INSERT_ELEM(A4R4G4B4);
884 INSERT_ELEM(A8R3G3B2);
885 INSERT_ELEM(X4R4G4B4);
886 INSERT_ELEM(A2B10G10R10);
895 INSERT_ELEM(X8L8V8U8);
896 INSERT_ELEM(Q8W8V8U8);
900 INSERT_ELEM(A2W10V10U10);
912 const char *D3DFormatStr(D3DFORMAT fmt) {
914 #define CASESTR(XX) case XX: return #XX;
916 CASESTR(D3DFMT_UNKNOWN);
917 CASESTR(D3DFMT_R8G8B8);
918 CASESTR(D3DFMT_A8R8G8B8);
919 CASESTR(D3DFMT_X8R8G8B8);
920 CASESTR(D3DFMT_R5G6B5);
921 CASESTR(D3DFMT_X1R5G5B5);
922 CASESTR(D3DFMT_A1R5G5B5);
923 CASESTR(D3DFMT_A4R4G4B4);
924 CASESTR(D3DFMT_R3G3B2);
926 CASESTR(D3DFMT_A8R3G3B2);
927 CASESTR(D3DFMT_X4R4G4B4);
928 CASESTR(D3DFMT_A2B10G10R10);
929 CASESTR(D3DFMT_G16R16);
930 CASESTR(D3DFMT_A8P8);
933 CASESTR(D3DFMT_A8L8);
934 CASESTR(D3DFMT_A4L4);
935 CASESTR(D3DFMT_V8U8);
936 CASESTR(D3DFMT_L6V5U5);
937 CASESTR(D3DFMT_X8L8V8U8);
938 CASESTR(D3DFMT_Q8W8V8U8);
939 CASESTR(D3DFMT_V16U16);
942 CASESTR(D3DFMT_A2W10V10U10);
943 CASESTR(D3DFMT_UYVY);
944 CASESTR(D3DFMT_YUY2);
945 CASESTR(D3DFMT_DXT1);
946 CASESTR(D3DFMT_DXT2);
947 CASESTR(D3DFMT_DXT3);
948 CASESTR(D3DFMT_DXT4);
949 CASESTR(D3DFMT_DXT5);
950 CASESTR(D3DFMT_D16_LOCKABLE);
952 CASESTR(D3DFMT_D15S1);
953 CASESTR(D3DFMT_D24S8);
955 CASESTR(D3DFMT_D24X8);
956 CASESTR(D3DFMT_D24X4S4);
957 CASESTR(D3DFMT_VERTEXDATA);
958 CASESTR(D3DFMT_INDEX16);
959 CASESTR(D3DFMT_INDEX32);
960 CASESTR(D3DFMT_A16B16G16R16F);
961 CASESTR(D3DFMT_A32B32G32R32F);
964 return "Invalid D3DFORMAT";
A GraphicsStateGuardian for rendering into DirectX9 contexts.
This is our own Panda specialization on the default STL map.
bool is_valid() const
Returns true if the GSG has been correctly initialized within a graphics context, false if there has ...
A GraphicsDevice necessary for multi-window rendering in DX.
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.
bool special_check_fullscreen_resolution(DXScreenData &scrn, UINT x_size, UINT y_size)
overrides of the general estimator for known working cases
An object to create GraphicsOutputs that share a particular 3-D API.
This is a base class for the various different classes that represent the result of a frame of render...
bool get_supports_render_texture() const
Returns true if this particular GSG can render from a wdxGraphicsBuffer9 directly into a texture...
A single graphics window for rendering DirectX under Microsoft Windows.
bool needs_reset() const
Returns true if the gsg is marked as needing a reset.
An abstract device object that is part of Graphics Pipe.
Encapsulates all the communication with a particular instance of a given rendering backend...
This graphics pipe represents the interface for creating DirectX9 graphics windows.
This class is the main interface to controlling the render process.
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...
virtual string get_interface_name() const
Returns the name of the rendering interface associated with this GraphicsPipe.