| Index: dxgltest/Tests3D.cpp |
| — | — | @@ -838,11 +838,37 @@ |
| 839 | 839 | SendMessage(hWnd,CB_ADDSTRING,0,(LPARAM)_T("Linear"));
|
| 840 | 840 | }
|
| 841 | 841 |
|
| | 842 | +void strupper(TCHAR *str)
|
| | 843 | +{
|
| | 844 | + TCHAR *ptr = str;
|
| | 845 | + while(*ptr != 0)
|
| | 846 | + {
|
| | 847 | + *ptr = _totupper(*ptr);
|
| | 848 | + ptr++;
|
| | 849 | + }
|
| | 850 | +}
|
| | 851 | +
|
| | 852 | +void paddwordzeroes(TCHAR *str)
|
| | 853 | +{
|
| | 854 | + TCHAR str2[16];
|
| | 855 | + str2[0] = 0;
|
| | 856 | + int len = _tcslen(str);
|
| | 857 | + if(len < 8)
|
| | 858 | + {
|
| | 859 | + for(int i = 0; i < 8-len; i++)
|
| | 860 | + _tcscat(str2,_T("0"));
|
| | 861 | + _tcscat(str2,str);
|
| | 862 | + _tcscpy(str,str2);
|
| | 863 | + }
|
| | 864 | +}
|
| | 865 | +
|
| 842 | 866 | INT_PTR CALLBACK TexShader7Proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
| 843 | 867 | {
|
| 844 | 868 | HRESULT error;
|
| 845 | 869 | D3DVIEWPORT7 vp;
|
| 846 | 870 | HWND hDisplay;
|
| | 871 | + int number;
|
| | 872 | + TCHAR tmpstring[MAX_PATH+1];
|
| 847 | 873 | switch(Msg)
|
| 848 | 874 | {
|
| 849 | 875 | case WM_INITDIALOG:
|
| — | — | @@ -891,14 +917,11 @@ |
| 892 | 918 | error = d3d7dev->SetViewport(&vp);
|
| 893 | 919 | error = d3d7dev->SetRenderState(D3DRENDERSTATE_ZENABLE,TRUE);
|
| 894 | 920 | InitTest3D(2);
|
| 895 | | - SendDlgItemMessage(hWnd,IDC_SPINSTAGE,UDM_SETRANGE32,0,7);
|
| 896 | | - SendDlgItemMessage(hWnd,IDC_TEXCOLORKEY,WM_SETTEXT,0,(LPARAM)_T("FFFFFFFF"));
|
| 897 | 921 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("None"));
|
| 898 | 922 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("Gradients"));
|
| 899 | 923 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("DXGL logo (small)"));
|
| 900 | 924 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("DXGL logo (large)"));
|
| 901 | 925 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("Texture file"));
|
| 902 | | - SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_SETCURSEL,0,0);
|
| 903 | 926 | PopulateArgCombo(GetDlgItem(hWnd,IDC_CARG1));
|
| 904 | 927 | PopulateArgCombo(GetDlgItem(hWnd,IDC_CARG2));
|
| 905 | 928 | PopulateArgCombo(GetDlgItem(hWnd,IDC_AARG1));
|
| — | — | @@ -928,10 +951,61 @@ |
| 929 | 952 | SendDlgItemMessage(hWnd,IDC_FOGSTART,WM_SETTEXT,0,(LPARAM)_T("0.0"));
|
| 930 | 953 | SendDlgItemMessage(hWnd,IDC_FOGEND,WM_SETTEXT,0,(LPARAM)_T("1.0"));
|
| 931 | 954 | SendDlgItemMessage(hWnd,IDC_FOGDENSITY,WM_SETTEXT,0,(LPARAM)_T("1.0"));
|
| | 955 | + SendDlgItemMessage(hWnd,IDC_SPINSTAGE,UDM_SETRANGE32,0,7);
|
| 932 | 956 | ::width = ddsd.dwWidth;
|
| 933 | 957 | ::height = ddsd.dwHeight;
|
| 934 | 958 | StartTimer(hWnd,WM_APP,60);
|
| 935 | 959 | break;
|
| | 960 | + case WM_COMMAND:
|
| | 961 | + switch(LOWORD(wParam))
|
| | 962 | + {
|
| | 963 | + case IDC_TEXSTAGE:
|
| | 964 | + if(HIWORD(wParam) == EN_CHANGE)
|
| | 965 | + {
|
| | 966 | + SendDlgItemMessage(hWnd,IDC_TEXSTAGE,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
|
| | 967 | + number = _ttoi(tmpstring);
|
| | 968 | + if(number < 0) SendDlgItemMessage(hWnd,IDC_TEXSTAGE,WM_SETTEXT,0,(LPARAM)_T("0"));
|
| | 969 | + if(number > 7) SendDlgItemMessage(hWnd,IDC_TEXSTAGE,WM_SETTEXT,0,(LPARAM)_T("7"));
|
| | 970 | + texshaderstate.currentstage = number;
|
| | 971 | + _itot(texshaderstate.texstages[number].keycolor,tmpstring,16);
|
| | 972 | + strupper(tmpstring);
|
| | 973 | + paddwordzeroes(tmpstring);
|
| | 974 | + SendDlgItemMessage(hWnd,IDC_TEXCOLORKEY,WM_SETTEXT,0,(LPARAM)tmpstring);
|
| | 975 | + SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_SETCURSEL,texshaderstate.texstages[number].texturetype,0);
|
| | 976 | + SendDlgItemMessage(hWnd,IDC_TEXTUREFILE,WM_SETTEXT,0,(LPARAM)texshaderstate.texstages[number].texturefile);
|
| | 977 | + SendDlgItemMessage(hWnd,IDC_CARG1,CB_SETCURSEL,texshaderstate.texstages[number].colorarg1 & D3DTA_SELECTMASK,0);
|
| | 978 | + SendDlgItemMessage(hWnd,IDC_CARG2,CB_SETCURSEL,texshaderstate.texstages[number].colorarg2 & D3DTA_SELECTMASK,0);
|
| | 979 | + SendDlgItemMessage(hWnd,IDC_AARG1,CB_SETCURSEL,texshaderstate.texstages[number].alphaarg1 & D3DTA_SELECTMASK,0);
|
| | 980 | + SendDlgItemMessage(hWnd,IDC_AARG2,CB_SETCURSEL,texshaderstate.texstages[number].alphaarg2 & D3DTA_SELECTMASK,0);
|
| | 981 | + if(texshaderstate.texstages[number].colorarg1 & D3DTA_ALPHAREPLICATE)
|
| | 982 | + SendDlgItemMessage(hWnd,IDC_CARG1A,BM_SETCHECK,BST_CHECKED,0);
|
| | 983 | + else SendDlgItemMessage(hWnd,IDC_CARG1A,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 984 | + if(texshaderstate.texstages[number].colorarg2 & D3DTA_ALPHAREPLICATE)
|
| | 985 | + SendDlgItemMessage(hWnd,IDC_CARG2A,BM_SETCHECK,BST_CHECKED,0);
|
| | 986 | + else SendDlgItemMessage(hWnd,IDC_CARG2A,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 987 | + if(texshaderstate.texstages[number].alphaarg1 & D3DTA_ALPHAREPLICATE)
|
| | 988 | + SendDlgItemMessage(hWnd,IDC_AARG1A,BM_SETCHECK,BST_CHECKED,0);
|
| | 989 | + else SendDlgItemMessage(hWnd,IDC_AARG1A,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 990 | + if(texshaderstate.texstages[number].alphaarg2 & D3DTA_ALPHAREPLICATE)
|
| | 991 | + SendDlgItemMessage(hWnd,IDC_AARG2A,BM_SETCHECK,BST_CHECKED,0);
|
| | 992 | + else SendDlgItemMessage(hWnd,IDC_AARG2A,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 993 | + if(texshaderstate.texstages[number].colorarg1 & D3DTA_COMPLEMENT)
|
| | 994 | + SendDlgItemMessage(hWnd,IDC_CARG1INV,BM_SETCHECK,BST_CHECKED,0);
|
| | 995 | + else SendDlgItemMessage(hWnd,IDC_CARG1INV,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 996 | + if(texshaderstate.texstages[number].colorarg2 & D3DTA_COMPLEMENT)
|
| | 997 | + SendDlgItemMessage(hWnd,IDC_CARG2INV,BM_SETCHECK,BST_CHECKED,0);
|
| | 998 | + else SendDlgItemMessage(hWnd,IDC_CARG2INV,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 999 | + if(texshaderstate.texstages[number].alphaarg1 & D3DTA_COMPLEMENT)
|
| | 1000 | + SendDlgItemMessage(hWnd,IDC_AARG1INV,BM_SETCHECK,BST_CHECKED,0);
|
| | 1001 | + else SendDlgItemMessage(hWnd,IDC_AARG1INV,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 1002 | + if(texshaderstate.texstages[number].alphaarg2 & D3DTA_COMPLEMENT)
|
| | 1003 | + SendDlgItemMessage(hWnd,IDC_AARG2INV,BM_SETCHECK,BST_CHECKED,0);
|
| | 1004 | + else SendDlgItemMessage(hWnd,IDC_AARG2INV,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 1005 | + SendDlgItemMessage(hWnd,IDC_COLOROP,CB_SETCURSEL,texshaderstate.texstages[number].colorop-1,0);
|
| | 1006 | + SendDlgItemMessage(hWnd,IDC_ALPHAOP,CB_SETCURSEL,texshaderstate.texstages[number].alphaop-1,0);
|
| | 1007 | + }
|
| | 1008 | + }
|
| | 1009 | + break;
|
| 936 | 1010 | case WM_CLOSE:
|
| 937 | 1011 | ddinterface->Release();
|
| 938 | 1012 | EndDialog(hWnd,IDCANCEL);
|
| Index: dxgltest/common.h |
| — | — | @@ -60,4 +60,11 @@ |
| 61 | 61 | // DirectX/DXGL headers
|
| 62 | 62 | #include <ddraw.h>
|
| 63 | 63 | extern const unsigned char DefaultPalette[1024];
|
| | 64 | +
|
| | 65 | +#ifdef _UNICODE
|
| | 66 | +#define _ttof _wtof
|
| | 67 | +#else
|
| | 68 | +#define _ttof atof
|
| | 69 | +#endif
|
| | 70 | +
|
| 64 | 71 | #endif //_COMMON_H
|
| Index: dxgltest/dxgltest.cpp |
| — | — | @@ -18,11 +18,6 @@ |
| 19 | 19 | #include "common.h"
|
| 20 | 20 | #include "dxgltest.h"
|
| 21 | 21 | #include "tests.h"
|
| 22 | | -#ifdef _UNICODE
|
| 23 | | -#define _ttof _wtof
|
| 24 | | -#else
|
| 25 | | -#define _ttof atof
|
| 26 | | -#endif
|
| 27 | 22 |
|
| 28 | 23 | HINSTANCE hinstance;
|
| 29 | 24 | bool gradientavailable;
|
| — | — | @@ -523,10 +518,33 @@ |
| 524 | 519 | maxbuffer3d = Tests3D[i].buffermax;
|
| 525 | 520 | fps_enabled3d = Tests3D[i].usesfps;
|
| 526 | 521 | if(Tests3D[i].usesfps) framerate3d = Tests3D[i].defaultfps;
|
| 527 | | - EnableWindow(GetDlgItem(hWnd,IDC_BUFFERS),TRUE);
|
| 528 | | - EnableWindow(GetDlgItem(hWnd,IDC_APIVER),TRUE);
|
| 529 | | - EnableWindow(GetDlgItem(hWnd,IDC_FRAMERATE),fps_enabled3d);
|
| 530 | | - EnableWindow(GetDlgItem(hWnd,IDC_TEST),TRUE);
|
| | 522 | + if(i != 2)
|
| | 523 | + {
|
| | 524 | + EnableWindow(GetDlgItem(hWnd,IDC_BUFFERS),TRUE);
|
| | 525 | + EnableWindow(GetDlgItem(hWnd,IDC_APIVER),TRUE);
|
| | 526 | + EnableWindow(GetDlgItem(hWnd,IDC_FRAMERATE),fps_enabled3d);
|
| | 527 | + EnableWindow(GetDlgItem(hWnd,IDC_TEST),TRUE);
|
| | 528 | + EnableWindow(GetDlgItem(hWnd,IDC_WINDOWED),TRUE);
|
| | 529 | + EnableWindow(GetDlgItem(hWnd,IDC_FULLSCREEN),TRUE);
|
| | 530 | + EnableWindow(GetDlgItem(hWnd,IDC_RESIZABLE),TRUE);
|
| | 531 | + EnableWindow(GetDlgItem(hWnd,IDC_VSYNC),TRUE);
|
| | 532 | + EnableWindow(GetDlgItem(hWnd,IDC_VIDMODES),TRUE);
|
| | 533 | + }
|
| | 534 | + else
|
| | 535 | + {
|
| | 536 | + EnableWindow(GetDlgItem(hWnd,IDC_BUFFERS),FALSE);
|
| | 537 | + EnableWindow(GetDlgItem(hWnd,IDC_APIVER),TRUE);
|
| | 538 | + EnableWindow(GetDlgItem(hWnd,IDC_FRAMERATE),FALSE);
|
| | 539 | + EnableWindow(GetDlgItem(hWnd,IDC_TEST),TRUE);
|
| | 540 | + EnableWindow(GetDlgItem(hWnd,IDC_WINDOWED),FALSE);
|
| | 541 | + EnableWindow(GetDlgItem(hWnd,IDC_FULLSCREEN),FALSE);
|
| | 542 | + EnableWindow(GetDlgItem(hWnd,IDC_RESIZABLE),FALSE);
|
| | 543 | + EnableWindow(GetDlgItem(hWnd,IDC_VSYNC),FALSE);
|
| | 544 | + EnableWindow(GetDlgItem(hWnd,IDC_VIDMODES),FALSE);
|
| | 545 | + SendDlgItemMessage(hWnd,IDC_WINDOWED,BM_SETCHECK,BST_CHECKED,0);
|
| | 546 | + SendDlgItemMessage(hWnd,IDC_FULLSCREEN,BM_SETCHECK,BST_UNCHECKED,0);
|
| | 547 | + fullscreen3d = false;
|
| | 548 | + }
|
| 531 | 549 | SendDlgItemMessage(hWnd,IDC_BUFFERS,EM_SETLIMITTEXT,2,0);
|
| 532 | 550 | SendDlgItemMessage(hWnd,IDC_APIVER,EM_SETLIMITTEXT,1,0);
|
| 533 | 551 | SendDlgItemMessage(hWnd,IDC_FRAMERATE,EM_SETLIMITTEXT,5,0);
|
| Index: dxgltest/dxgltest.rc |
| Cannot display: file marked as a binary type. |
| svn:mime-type = application/octet-stream |