Index: dxgltest/Tests3D.cpp |
— | — | @@ -113,7 +113,7 @@ |
114 | 114 | },
|
115 | 115 | 0xFFFFFFFF,
|
116 | 116 | 0,
|
117 | | - 0,
|
| 117 | + 0xFFFFFFFF,
|
118 | 118 | D3DFOG_NONE,
|
119 | 119 | D3DFOG_NONE,
|
120 | 120 | 0.0,
|
— | — | @@ -862,6 +862,20 @@ |
863 | 863 | }
|
864 | 864 | }
|
865 | 865 |
|
| 866 | +void SelectTexture(MultiDirectDrawSurface **surface, int type, DWORD colorkey, LPCTSTR file)
|
| 867 | +{
|
| 868 | +}
|
| 869 | +
|
| 870 | +void SetShaderArg(HWND hWnd, UINT dropdown, UINT checkalpha, UINT checkinv, DWORD *texarg)
|
| 871 | +{
|
| 872 | + DWORD arg = SendDlgItemMessage(hWnd,dropdown,CB_GETCURSEL,0,0);
|
| 873 | + if(SendDlgItemMessage(hWnd,checkalpha,BM_GETCHECK,0,0) == BST_CHECKED)
|
| 874 | + arg |= D3DTA_ALPHAREPLICATE;
|
| 875 | + if(SendDlgItemMessage(hWnd,checkinv,BM_GETCHECK,0,0) == BST_CHECKED)
|
| 876 | + arg |= D3DTA_COMPLEMENT;
|
| 877 | + *texarg = arg;
|
| 878 | +}
|
| 879 | +
|
866 | 880 | INT_PTR CALLBACK TexShader7Proc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
867 | 881 | {
|
868 | 882 | HRESULT error;
|
— | — | @@ -922,6 +936,8 @@ |
923 | 937 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("DXGL logo (small)"));
|
924 | 938 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("DXGL logo (large)"));
|
925 | 939 | SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_ADDSTRING,0,(LPARAM)_T("Texture file"));
|
| 940 | + SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_SETCURSEL,0,0);
|
| 941 | + SendDlgItemMessage(hWnd,IDC_TEXCOLORKEY,WM_SETTEXT,0,(LPARAM)_T("00000000"));
|
926 | 942 | PopulateArgCombo(GetDlgItem(hWnd,IDC_CARG1));
|
927 | 943 | PopulateArgCombo(GetDlgItem(hWnd,IDC_CARG2));
|
928 | 944 | PopulateArgCombo(GetDlgItem(hWnd,IDC_AARG1));
|
— | — | @@ -1004,6 +1020,84 @@ |
1005 | 1021 | SendDlgItemMessage(hWnd,IDC_COLOROP,CB_SETCURSEL,texshaderstate.texstages[number].colorop-1,0);
|
1006 | 1022 | SendDlgItemMessage(hWnd,IDC_ALPHAOP,CB_SETCURSEL,texshaderstate.texstages[number].alphaop-1,0);
|
1007 | 1023 | }
|
| 1024 | + case IDC_TEXTURE:
|
| 1025 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 1026 | + {
|
| 1027 | + number = texshaderstate.currentstage;
|
| 1028 | + texshaderstate.texstages[number].texturetype =
|
| 1029 | + SendDlgItemMessage(hWnd,IDC_TEXTURE,CB_GETCURSEL,0,0);
|
| 1030 | + SelectTexture(&texshaderstate.texstages[number].texture,texshaderstate.texstages[number].texturetype,
|
| 1031 | + texshaderstate.texstages[number].colorkey,texshaderstate.texstages[number].texturefile);
|
| 1032 | + }
|
| 1033 | + case IDC_TEXTUREFILE:
|
| 1034 | + if(HIWORD(wParam) == EN_KILLFOCUS)
|
| 1035 | + {
|
| 1036 | + number = texshaderstate.currentstage;
|
| 1037 | + SendDlgItemMessage(hWnd,IDC_TEXTUREFILE,WM_GETTEXT,MAX_PATH+1,
|
| 1038 | + (LPARAM)texshaderstate.texstages[number].texturefile);
|
| 1039 | + SelectTexture(&texshaderstate.texstages[number].texture,texshaderstate.texstages[number].texturetype,
|
| 1040 | + texshaderstate.texstages[number].colorkey,texshaderstate.texstages[number].texturefile);
|
| 1041 | + }
|
| 1042 | + case IDC_CARG1:
|
| 1043 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 1044 | + {
|
| 1045 | + number = texshaderstate.currentstage;
|
| 1046 | + SetShaderArg(hWnd,IDC_CARG1,IDC_CARG1A,IDC_CARG1INV,&texshaderstate.texstages[number].colorarg1);
|
| 1047 | + d3d7dev->SetTextureStageState(number,D3DTSS_COLORARG1,texshaderstate.texstages[number].colorarg1);
|
| 1048 | + }
|
| 1049 | + case IDC_CARG1A:
|
| 1050 | + case IDC_CARG1INV:
|
| 1051 | + if(HIWORD(wParam) == BN_CLICKED)
|
| 1052 | + {
|
| 1053 | + number = texshaderstate.currentstage;
|
| 1054 | + SetShaderArg(hWnd,IDC_CARG1,IDC_CARG1A,IDC_CARG1INV,&texshaderstate.texstages[number].colorarg2);
|
| 1055 | + d3d7dev->SetTextureStageState(number,D3DTSS_COLORARG1,texshaderstate.texstages[number].colorarg2);
|
| 1056 | + }
|
| 1057 | + case IDC_CARG2:
|
| 1058 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 1059 | + {
|
| 1060 | + number = texshaderstate.currentstage;
|
| 1061 | + SetShaderArg(hWnd,IDC_CARG2,IDC_CARG2A,IDC_CARG2INV,&texshaderstate.texstages[number].colorarg2);
|
| 1062 | + d3d7dev->SetTextureStageState(number,D3DTSS_COLORARG2,texshaderstate.texstages[number].colorarg2);
|
| 1063 | + }
|
| 1064 | + case IDC_CARG2A:
|
| 1065 | + case IDC_CARG2INV:
|
| 1066 | + if(HIWORD(wParam) == BN_CLICKED)
|
| 1067 | + {
|
| 1068 | + number = texshaderstate.currentstage;
|
| 1069 | + SetShaderArg(hWnd,IDC_CARG2,IDC_CARG2A,IDC_CARG2INV,&texshaderstate.texstages[number].colorarg1);
|
| 1070 | + d3d7dev->SetTextureStageState(number,D3DTSS_COLORARG2,texshaderstate.texstages[number].colorarg1);
|
| 1071 | + }
|
| 1072 | + case IDC_AARG1:
|
| 1073 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 1074 | + {
|
| 1075 | + number = texshaderstate.currentstage;
|
| 1076 | + SetShaderArg(hWnd,IDC_AARG1,IDC_AARG1A,IDC_AARG1INV,&texshaderstate.texstages[number].alphaarg1);
|
| 1077 | + d3d7dev->SetTextureStageState(number,D3DTSS_ALPHAARG1,texshaderstate.texstages[number].alphaarg1);
|
| 1078 | + }
|
| 1079 | + case IDC_AARG1A:
|
| 1080 | + case IDC_AARG1INV:
|
| 1081 | + if(HIWORD(wParam) == BN_CLICKED)
|
| 1082 | + {
|
| 1083 | + number = texshaderstate.currentstage;
|
| 1084 | + SetShaderArg(hWnd,IDC_AARG1,IDC_AARG1A,IDC_AARG1INV,&texshaderstate.texstages[number].alphaarg1);
|
| 1085 | + d3d7dev->SetTextureStageState(number,D3DTSS_ALPHAARG1,texshaderstate.texstages[number].alphaarg1);
|
| 1086 | + }
|
| 1087 | + case IDC_AARG2:
|
| 1088 | + if(HIWORD(wParam) == CBN_SELCHANGE)
|
| 1089 | + {
|
| 1090 | + number = texshaderstate.currentstage;
|
| 1091 | + SetShaderArg(hWnd,IDC_AARG2,IDC_AARG2A,IDC_AARG2INV,&texshaderstate.texstages[number].alphaarg2);
|
| 1092 | + d3d7dev->SetTextureStageState(number,D3DTSS_ALPHAARG2,texshaderstate.texstages[number].alphaarg2);
|
| 1093 | + }
|
| 1094 | + case IDC_AARG2A:
|
| 1095 | + case IDC_AARG2INV:
|
| 1096 | + if(HIWORD(wParam) == BN_CLICKED)
|
| 1097 | + {
|
| 1098 | + number = texshaderstate.currentstage;
|
| 1099 | + SetShaderArg(hWnd,IDC_AARG2,IDC_AARG2A,IDC_AARG2INV,&texshaderstate.texstages[number].alphaarg2);
|
| 1100 | + d3d7dev->SetTextureStageState(number,D3DTSS_ALPHAARG2,texshaderstate.texstages[number].alphaarg2);
|
| 1101 | + }
|
1008 | 1102 | }
|
1009 | 1103 | break;
|
1010 | 1104 | case WM_CLOSE:
|
Index: dxgltest/dxgltest.rc |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |