DXGL r233 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r232‎ | r233 | r234 >
Date:00:22, 9 August 2012
Author:admin
Status:new
Tags:
Comment:
Add color selection to Texture Shader dialog.
Update to version 0.3.1
Modified paths:
  • /ReadMe.txt (modified) (history)
  • /common/releasever.h (modified) (history)
  • /dxgltest/Tests3D.cpp (modified) (history)

Diff [purge]

Index: ReadMe.txt
@@ -1,4 +1,4 @@
2 -DXGL 0.3.0
 2+DXGL 0.3.1
33 http://www.williamfeely.info/wiki/DXGL
44
55 == Introduction ==
Index: common/releasever.h
@@ -4,7 +4,7 @@
55
66 #define DXGLMAJORVER 0
77 #define DXGLMINORVER 3
8 -#define DXGLPOINTVER 0
 8+#define DXGLPOINTVER 1
99
1010 #define STR2(x) #x
1111 #define STR(x) STR2(x)
Index: dxgltest/Tests3D.cpp
@@ -517,6 +517,19 @@
518518 litvertices[23] = D3DLVERTEX(points[2],0xFFFFFFFF,0,1,0);
519519 }
520520
 521+void SetVertexColor(D3DLVERTEX *start, int count, DWORD color)
 522+{
 523+ for(int i = 0; i < count; i++)
 524+ start[i].color = color;
 525+}
 526+
 527+void SetVertexSpecular(D3DLVERTEX *start, int count, DWORD color)
 528+{
 529+ for(int i = 0; i < count; i++)
 530+ start[i].specular = color;
 531+}
 532+
 533+
521534 DDPIXELFORMAT texformats[256];
522535 int texformatindex = 0;
523536
@@ -1249,6 +1262,30 @@
12501263 _stscanf(tmpstring,_T("%x"),&bgcolor);
12511264 }
12521265 break;
 1266+ case IDC_DIFFUSE:
 1267+ if(HIWORD(wParam) == EN_CHANGE)
 1268+ {
 1269+ SendDlgItemMessage(hWnd,IDC_DIFFUSE,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
 1270+ _stscanf(tmpstring,_T("%x"),&number);
 1271+ SetVertexColor(litvertices,24,number);
 1272+ }
 1273+ break;
 1274+ case IDC_SPECULAR:
 1275+ if(HIWORD(wParam) == EN_CHANGE)
 1276+ {
 1277+ SendDlgItemMessage(hWnd,IDC_SPECULAR,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
 1278+ _stscanf(tmpstring,_T("%x"),&number);
 1279+ SetVertexSpecular(litvertices,24,number);
 1280+ }
 1281+ break;
 1282+ case IDC_FACTOR:
 1283+ if(HIWORD(wParam) == EN_CHANGE)
 1284+ {
 1285+ SendDlgItemMessage(hWnd,IDC_FACTOR,WM_GETTEXT,MAX_PATH,(LPARAM)tmpstring);
 1286+ _stscanf(tmpstring,_T("%x"),&number);
 1287+ d3d7dev->SetRenderState(D3DRENDERSTATE_TEXTUREFACTOR,number);
 1288+ }
 1289+ break;
12531290 }
12541291 break;
12551292 case WM_CLOSE: