Index: dxglcfg/common.h |
— | — | @@ -69,5 +69,8 @@ |
70 | 70 | #endif
|
71 | 71 |
|
72 | 72 | extern HRESULT(WINAPI *_EnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags);
|
| 73 | +// DXGL Config items for DXGL Test
|
| 74 | +extern HWND hDialog;
|
| 75 | +void SaveChanges(HWND hWnd);
|
73 | 76 |
|
74 | 77 | #endif //_COMMON_H
|
Index: dxglcfg/dxglcfg.cpp |
— | — | @@ -65,7 +65,7 @@ |
66 | 66 | HRESULT(WINAPI *_EnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags) = NULL;
|
67 | 67 | static BOOL ExtraModes_Dropdown = FALSE;
|
68 | 68 | static BOOL ColorDepth_Dropdown = FALSE;
|
69 | | -static HWND hDialog = NULL;
|
| 69 | +HWND hDialog = NULL;
|
70 | 70 | static BOOL EditInterlock = FALSE;
|
71 | 71 |
|
72 | 72 |
|
— | — | @@ -539,6 +539,106 @@ |
540 | 540 | SendDlgItemMessage(hWnd,DlgItem,CB_SETCURSEL,value,0);
|
541 | 541 | }
|
542 | 542 |
|
| 543 | +void SetGLCombo(HWND hWnd, int DlgItem, DWORD *major, DWORD *minor, DWORD *majormask, DWORD *minormask, DWORD tristate, HWND hDialog)
|
| 544 | +{
|
| 545 | + BOOL badversion = FALSE;
|
| 546 | + int position;
|
| 547 | + if (tristate && (!majormask || !minormask))
|
| 548 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL,
|
| 549 | + SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| 550 | + else
|
| 551 | + {
|
| 552 | + switch (*major)
|
| 553 | + {
|
| 554 | + case 0:
|
| 555 | + position = 0;
|
| 556 | + break;
|
| 557 | + case 2:
|
| 558 | + switch (*minor)
|
| 559 | + {
|
| 560 | + case 0:
|
| 561 | + position = 1;
|
| 562 | + break;
|
| 563 | + case 1:
|
| 564 | + position = 2;
|
| 565 | + break;
|
| 566 | + default:
|
| 567 | + badversion = TRUE;
|
| 568 | + break;
|
| 569 | + }
|
| 570 | + break;
|
| 571 | + case 3:
|
| 572 | + switch (*minor)
|
| 573 | + {
|
| 574 | + case 0:
|
| 575 | + position = 3;
|
| 576 | + break;
|
| 577 | + case 1:
|
| 578 | + position = 4;
|
| 579 | + break;
|
| 580 | + case 2:
|
| 581 | + position = 5;
|
| 582 | + break;
|
| 583 | + case 3:
|
| 584 | + position = 6;
|
| 585 | + break;
|
| 586 | + default:
|
| 587 | + badversion = TRUE;
|
| 588 | + break;
|
| 589 | + }
|
| 590 | + break;
|
| 591 | + case 4:
|
| 592 | + switch (*minor)
|
| 593 | + {
|
| 594 | + case 0:
|
| 595 | + position = 7;
|
| 596 | + break;
|
| 597 | + case 1:
|
| 598 | + position = 8;
|
| 599 | + break;
|
| 600 | + case 2:
|
| 601 | + position = 9;
|
| 602 | + break;
|
| 603 | + case 3:
|
| 604 | + position = 10;
|
| 605 | + break;
|
| 606 | + case 4:
|
| 607 | + position = 11;
|
| 608 | + break;
|
| 609 | + case 5:
|
| 610 | + position = 12;
|
| 611 | + break;
|
| 612 | + case 6:
|
| 613 | + position = 13;
|
| 614 | + break;
|
| 615 | + default:
|
| 616 | + badversion = TRUE;
|
| 617 | + break;
|
| 618 | + }
|
| 619 | + break;
|
| 620 | + default:
|
| 621 | + badversion = TRUE;
|
| 622 | + break;
|
| 623 | + }
|
| 624 | + if (badversion)
|
| 625 | + {
|
| 626 | + *major = 0;
|
| 627 | + *minor = 0;
|
| 628 | + if (tristate)
|
| 629 | + {
|
| 630 | + position = SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault);
|
| 631 | + *majormask = 0;
|
| 632 | + *minormask = 0;
|
| 633 | + }
|
| 634 | + else position = 0;
|
| 635 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 636 | + *dirty = TRUE;
|
| 637 | + }
|
| 638 | + SendDlgItemMessage(hWnd, DlgItem, CB_SETCURSEL, position, 0);
|
| 639 | + }
|
| 640 | +}
|
| 641 | +
|
| 642 | +
|
543 | 643 | void SetFloat3place(HWND hWnd, int DlgItem, float value, float mask)
|
544 | 644 | {
|
545 | 645 | TCHAR number[32];
|
— | — | @@ -678,6 +778,84 @@ |
679 | 779 | }
|
680 | 780 | }
|
681 | 781 |
|
| 782 | +void GetGLCombo(HWND hWnd, int DlgItem, DWORD *major, DWORD *minor, DWORD *majormask, DWORD *minormask)
|
| 783 | +{
|
| 784 | + int value = SendDlgItemMessage(hWnd, DlgItem, CB_GETCURSEL, 0, 0);
|
| 785 | + if (value == SendDlgItemMessage(hWnd, DlgItem, CB_FINDSTRING, -1, (LPARAM)strdefault))
|
| 786 | + {
|
| 787 | + *majormask = 0;
|
| 788 | + *minormask = 0;
|
| 789 | + *major = 0;
|
| 790 | + *minor = 0;
|
| 791 | + return;
|
| 792 | + }
|
| 793 | + else
|
| 794 | + {
|
| 795 | + *majormask = 1;
|
| 796 | + *minormask = 1;
|
| 797 | + switch (value)
|
| 798 | + {
|
| 799 | + case 0:
|
| 800 | + *major = 0;
|
| 801 | + *minor = 0;
|
| 802 | + break;
|
| 803 | + case 1:
|
| 804 | + *major = 2;
|
| 805 | + *minor = 0;
|
| 806 | + break;
|
| 807 | + case 2:
|
| 808 | + *major = 2;
|
| 809 | + *minor = 1;
|
| 810 | + break;
|
| 811 | + case 3:
|
| 812 | + *major = 3;
|
| 813 | + *minor = 0;
|
| 814 | + break;
|
| 815 | + case 4:
|
| 816 | + *major = 3;
|
| 817 | + *minor = 1;
|
| 818 | + break;
|
| 819 | + case 5:
|
| 820 | + *major = 3;
|
| 821 | + *minor = 2;
|
| 822 | + break;
|
| 823 | + case 6:
|
| 824 | + *major = 3;
|
| 825 | + *minor = 3;
|
| 826 | + break;
|
| 827 | + case 7:
|
| 828 | + *major = 4;
|
| 829 | + *minor = 0;
|
| 830 | + break;
|
| 831 | + case 8:
|
| 832 | + *major = 4;
|
| 833 | + *minor = 1;
|
| 834 | + break;
|
| 835 | + case 9:
|
| 836 | + *major = 4;
|
| 837 | + *minor = 2;
|
| 838 | + break;
|
| 839 | + case 10:
|
| 840 | + *major = 4;
|
| 841 | + *minor = 3;
|
| 842 | + break;
|
| 843 | + case 11:
|
| 844 | + *major = 4;
|
| 845 | + *minor = 4;
|
| 846 | + break;
|
| 847 | + case 12:
|
| 848 | + *major = 4;
|
| 849 | + *minor = 5;
|
| 850 | + break;
|
| 851 | + case 13:
|
| 852 | + *major = 4;
|
| 853 | + *minor = 6;
|
| 854 | + break;
|
| 855 | + }
|
| 856 | + return;
|
| 857 | + }
|
| 858 | +}
|
| 859 | +
|
682 | 860 | float GetFloat(HWND hWnd, int dlgitem, float *mask)
|
683 | 861 | {
|
684 | 862 | TCHAR buffer[32];
|
— | — | @@ -1945,6 +2123,12 @@ |
1946 | 2124 | *dirty = TRUE;
|
1947 | 2125 | }
|
1948 | 2126 | break;
|
| 2127 | + case IDC_GLVERSION:
|
| 2128 | + GetGLCombo(hWnd, IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
|
| 2129 | + &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor);
|
| 2130 | + EnableWindow(GetDlgItem(hDialog, IDC_APPLY), TRUE);
|
| 2131 | + *dirty = TRUE;
|
| 2132 | + break;
|
1949 | 2133 | default:
|
1950 | 2134 | break;
|
1951 | 2135 | }
|
— | — | @@ -2725,7 +2909,38 @@ |
2726 | 2910 | SendDlgItemMessage(hTabs[4], IDC_DEBUGLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
2727 | 2911 | /*_tcscpy(buffer, _T("Disable OpenGL errors (OpenGL 4.6+)"));
|
2728 | 2912 | SendDlgItemMessage(hTabs[4], IDC_DEBUGLIST, LB_ADDSTRING, 0, (LPARAM)buffer);*/
|
2729 | | -
|
| 2913 | + // Max OpenGL
|
| 2914 | + _tcscpy(buffer, _T("Maximum Available"));
|
| 2915 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2916 | + _tcscpy(buffer, _T("OpenGL 2.0"));
|
| 2917 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2918 | + _tcscpy(buffer, _T("OpenGL 2.1"));
|
| 2919 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2920 | + _tcscpy(buffer, _T("OpenGL 3.0"));
|
| 2921 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2922 | + _tcscpy(buffer, _T("OpenGL 3.1"));
|
| 2923 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2924 | + _tcscpy(buffer, _T("OpenGL 3.2"));
|
| 2925 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2926 | + _tcscpy(buffer, _T("OpenGL 3.3"));
|
| 2927 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2928 | + _tcscpy(buffer, _T("OpenGL 4.0"));
|
| 2929 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2930 | + _tcscpy(buffer, _T("OpenGL 4.1"));
|
| 2931 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2932 | + _tcscpy(buffer, _T("OpenGL 4.2"));
|
| 2933 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2934 | + _tcscpy(buffer, _T("OpenGL 4.3"));
|
| 2935 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2936 | + _tcscpy(buffer, _T("OpenGL 4.4"));
|
| 2937 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2938 | + _tcscpy(buffer, _T("OpenGL 4.5"));
|
| 2939 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2940 | + _tcscpy(buffer, _T("OpenGL 4.6"));
|
| 2941 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)buffer);
|
| 2942 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, WM_SETTEXT, 0, (LPARAM)buffer);
|
| 2943 | + SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
|
| 2944 | + &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, FALSE, hWnd);
|
2730 | 2945 | // Hacks
|
2731 | 2946 | _tcscpy(buffer, _T("Crop 640x480 to 640x400"));
|
2732 | 2947 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
— | — | @@ -2732,8 +2947,6 @@ |
2733 | 2948 | _tcscpy(buffer, _T("Expand 512x448 to 640x480 when border is blank"));
|
2734 | 2949 | SendDlgItemMessage(hTabs[5], IDC_HACKSLIST, LB_ADDSTRING, 0, (LPARAM)buffer);
|
2735 | 2950 |
|
2736 | | - EnableWindow(GetDlgItem(hWnd, IDC_APPLY), FALSE);
|
2737 | | -
|
2738 | 2951 | // Check install path
|
2739 | 2952 | installpath = NULL;
|
2740 | 2953 | error = RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\DXGL"), 0, KEY_READ, &hKey);
|
— | — | @@ -3037,8 +3250,10 @@ |
3038 | 3251 | SendDlgItemMessage(hTabs[2], IDC_LOWCOLORRENDER, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
3039 | 3252 | SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
3040 | 3253 | // Advanced tab
|
3041 | | - SendDlgItemMessage(hTabs[3],IDC_TEXTUREFORMAT,CB_ADDSTRING,0,(LPARAM)strdefault);
|
3042 | | - SendDlgItemMessage(hTabs[3],IDC_TEXUPLOAD,CB_ADDSTRING,0,(LPARAM)strdefault);
|
| 3254 | + SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 3255 | + SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
| 3256 | + // Debug tab
|
| 3257 | + SendDlgItemMessage(hTabs[4], IDC_GLVERSION, CB_ADDSTRING, 0, (LPARAM)strdefault);
|
3043 | 3258 | }
|
3044 | 3259 | else if(!current_app && tristate)
|
3045 | 3260 | {
|
— | — | @@ -3087,10 +3302,13 @@ |
3088 | 3303 | SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_DELETESTRING,
|
3089 | 3304 | SendDlgItemMessage(hTabs[2], IDC_DITHERING, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
3090 | 3305 | // Advanced tab
|
3091 | | - SendDlgItemMessage(hTabs[3],IDC_TEXTUREFORMAT,CB_DELETESTRING,
|
3092 | | - SendDlgItemMessage(hTabs[3],IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
3093 | | - SendDlgItemMessage(hTabs[3],IDC_TEXUPLOAD,CB_DELETESTRING,
|
3094 | | - SendDlgItemMessage(hTabs[3],IDC_ASPECT3D,CB_FINDSTRING,-1,(LPARAM)strdefault),0);
|
| 3306 | + SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_DELETESTRING,
|
| 3307 | + SendDlgItemMessage(hTabs[3], IDC_TEXTUREFORMAT, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| 3308 | + SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_DELETESTRING,
|
| 3309 | + SendDlgItemMessage(hTabs[3], IDC_TEXUPLOAD, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
| 3310 | + // Debug tab
|
| 3311 | + SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_DELETESTRING,
|
| 3312 | + SendDlgItemMessage(hTabs[3], IDC_GLVERSION, CB_FINDSTRING, -1, (LPARAM)strdefault), 0);
|
3095 | 3313 | }
|
3096 | 3314 | // Read settings into controls
|
3097 | 3315 | // Display tab
|
— | — | @@ -3179,6 +3397,8 @@ |
3180 | 3398 | SetCombo(hTabs[3],IDC_TEXUPLOAD,cfg->TexUpload,cfgmask->TexUpload,tristate);
|
3181 | 3399 | // Debug tab
|
3182 | 3400 | RedrawWindow(GetDlgItem(hTabs[4], IDC_DEBUGLIST), NULL, NULL, RDW_INVALIDATE);
|
| 3401 | + SetGLCombo(hTabs[4], IDC_GLVERSION, &cfg->DebugMaxGLVersionMajor, &cfg->DebugMaxGLVersionMinor,
|
| 3402 | + &cfgmask->DebugMaxGLVersionMajor, &cfgmask->DebugMaxGLVersionMinor, tristate, hWnd);
|
3183 | 3403 | // Hacks tab
|
3184 | 3404 | RedrawWindow(GetDlgItem(hTabs[5], IDC_HACKSLIST), NULL, NULL, RDW_INVALIDATE);
|
3185 | 3405 | }
|
Index: dxglcfg/dxgltest.cpp |
— | — | @@ -392,6 +392,13 @@ |
393 | 393 | }
|
394 | 394 | break;
|
395 | 395 | case IDC_TEST:
|
| 396 | + if (IsWindowEnabled(GetDlgItem(hDialog, IDC_APPLY)))
|
| 397 | + {
|
| 398 | + if(MessageBox(hDialog, _T("You have unsaved changes to your configuration.\r\n\
|
| 399 | +Do you want to apply them before running this test?"),
|
| 400 | + _T("Notice"), MB_YESNO| MB_ICONQUESTION) == IDYES)
|
| 401 | + SaveChanges(hDialog);
|
| 402 | + }
|
396 | 403 | if(SendDlgItemMessage(hWnd,IDC_RESIZABLE,BM_GETCHECK,0,0)) resizable = true;
|
397 | 404 | else resizable = false;
|
398 | 405 | if (buffer < minbuffer) buffer = minbuffer;
|