DXGL r564 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r563‎ | r564 | r565 >
Date:19:50, 10 November 2014
Author:admin
Status:new
Tags:
Comment:
Add new DXGLCFG UI resource script.
Modified paths:
  • /dxglcfg2/dxglcfg2.c (modified) (history)
  • /dxglcfg2/dxglcfg2.rc (modified) (history)
  • /dxglcfg2/resource.h (modified) (history)
  • /dxgltest/dxgltest.cpp (modified) (history)

Diff [purge]

Index: dxglcfg2/dxglcfg2.c
@@ -464,6 +464,7 @@
465465 LPTSTR regkey;
466466 BOOL failed;
467467 RECT r;
 468+ TCITEM tab;
468469 drawitem = (DRAWITEMSTRUCT*)lParam;
469470 switch (Msg)
470471 {
@@ -517,6 +518,21 @@
518519 wglDeleteContext(rc);
519520 ReleaseDC(hGLWnd,dc);
520521 DestroyWindow(hGLWnd);
 522+ // Add tabs
 523+ ZeroMemory(&tab, sizeof(TCITEM));
 524+ tab.mask = TCIF_TEXT;
 525+ tab.pszText = _T("Display");
 526+ SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 0, (LPARAM)&tab);
 527+ tab.pszText = _T("3D Graphics");
 528+ SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 1, (LPARAM)&tab);
 529+ tab.pszText = _T("Effects");
 530+ SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 2, (LPARAM)&tab);
 531+ tab.pszText = _T("Advanced");
 532+ SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 3, (LPARAM)&tab);
 533+ tab.pszText = _T("Debug");
 534+ SendDlgItemMessage(hWnd, IDC_TABS, TCM_INSERTITEM, 4, (LPARAM)&tab);
 535+
 536+
521537 // Load global settings.
522538 /* // scaler
523539 _tcscpy(buffer,_T("Change desktop resolution"));
Index: dxglcfg2/dxglcfg2.rc
@@ -1,5 +1,5 @@
22 // DXGL
3 -// Copyright (C) 2011-2012 William Feely
 3+// Copyright (C) 2011-2014 William Feely
44
55 // This library is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU Lesser General Public
@@ -28,24 +28,109 @@
2929 // Dialog resources
3030 //
3131 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
32 -IDD_DXGLCFG DIALOG 0, 0, 405, 250
 32+IDD_DISPLAY DIALOG 0, 0, 283, 176
 33+STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 34+FONT 8, "Ms Shell Dlg"
 35+{
 36+ COMBOBOX IDC_VSYNC, 114, 92, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 37+ LTEXT "Vertical sync", IDC_STATIC, 114, 82, 41, 8, SS_LEFT, WS_EX_LEFT
 38+ COMBOBOX IDC_EXTRAMODES, 114, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 39+ LTEXT "Additional display modes", 0, 114, 32, 78, 8, SS_LEFT, WS_EX_LEFT
 40+ COMBOBOX IDC_COLORDEPTH, 114, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 41+ LTEXT "Add color depths", 0, 114, 7, 54, 8, SS_LEFT, WS_EX_LEFT
 42+ LTEXT "DPI scaling mode", IDC_STATIC, 7, 82, 55, 8, SS_LEFT, WS_EX_LEFT
 43+ COMBOBOX IDC_DPISCALE, 7, 92, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 44+ LTEXT "Screen aspect ratio", IDC_STATIC, 7, 57, 63, 8, SS_LEFT, WS_EX_LEFT
 45+ COMBOBOX IDC_ASPECT, 7, 67, 102, 30, CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 46+ COMBOBOX IDC_SCALE, 7, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 47+ LTEXT "Scaling method", IDC_STATIC, 7, 32, 49, 8, SS_LEFT, WS_EX_LEFT
 48+ COMBOBOX IDC_SORTMODES, 114, 67, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 49+ LTEXT "Sort video modes", IDC_STATIC, 114, 57, 56, 8, SS_LEFT, WS_EX_LEFT
 50+ COMBOBOX IDC_VIDMODE, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 51+ LTEXT "Video mode", IDC_STATIC, 7, 7, 38, 8, SS_LEFT, WS_EX_LEFT
 52+}
 53+
 54+
 55+
 56+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 57+IDD_3DGRAPHICS DIALOG 0, 0, 283, 176
 58+STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 59+FONT 8, "Ms Shell Dlg"
 60+{
 61+ LTEXT "Texture filter", IDC_STATIC, 7, 7, 43, 8, SS_LEFT, WS_EX_LEFT
 62+ COMBOBOX IDC_TEXFILTER, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 63+ LTEXT "Anisotropic filtering", IDC_STATIC, 114, 7, 62, 8, SS_LEFT, WS_EX_LEFT
 64+ COMBOBOX IDC_ANISO, 114, 17, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 65+ LTEXT "Antialiasing (MSAA)", IDC_STATIC, 7, 32, 63, 8, SS_LEFT, WS_EX_LEFT
 66+ COMBOBOX IDC_MSAA, 7, 42, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 67+ LTEXT "Renderer aspect ratio", IDC_STATIC, 114, 32, 71, 8, SS_LEFT, WS_EX_LEFT
 68+ COMBOBOX IDC_ASPECT3D, 114, 42, 100, 14, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 69+}
 70+
 71+
 72+
 73+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 74+IDD_DEBUG DIALOG 0, 0, 283, 176
 75+STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 76+FONT 8, "Ms Shell Dlg"
 77+{
 78+ LISTBOX IDC_DEBUGLIST, 7, 7, 269, 162, WS_TABSTOP | WS_VSCROLL | LBS_NOINTEGRALHEIGHT | LBS_OWNERDRAWFIXED | LBS_SORT | LBS_NOTIFY, WS_EX_LEFT
 79+}
 80+
 81+
 82+
 83+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 84+IDD_EFFECTS DIALOG 0, 0, 283, 176
 85+STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 86+FONT 8, "Ms Shell Dlg"
 87+{
 88+ LTEXT "Y", IDC_CUSTOMSCALELABELY, 57, 72, 6, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 89+ LTEXT "Custom scale", IDC_CUSTOMSCALELABEL, 7, 59, 43, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 90+ LTEXT "Primary buffer scaling", 0, 7, 34, 68, 8, SS_LEFT, WS_EX_LEFT
 91+ COMBOBOX IDC_PRIMARYSCALE, 7, 44, 101, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 92+ EDITTEXT IDC_CUSTOMSCALEX, 15, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
 93+ LTEXT "X", IDC_CUSTOMSCALELABELX, 7, 72, 6, 8, WS_DISABLED | SS_LEFT, WS_EX_LEFT
 94+ EDITTEXT IDC_CUSTOMSCALEY, 65, 69, 40, 14, WS_DISABLED | ES_AUTOHSCROLL, WS_EX_LEFT
 95+ AUTOCHECKBOX "Use post-processing shader", 0, 7, 8, 103, 8, 0, WS_EX_LEFT
 96+ COMBOBOX IDC_SHADER, 7, 18, 247, 92, WS_DISABLED | CBS_DROPDOWN | CBS_HASSTRINGS, WS_EX_LEFT
 97+ PUSHBUTTON "...", IDC_BROWSESHADER, 256, 17, 20, 14, WS_DISABLED, WS_EX_LEFT
 98+}
 99+
 100+
 101+
 102+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 103+IDD_DXGLCFG DIALOG 0, 0, 301, 247
33104 STYLE DS_3DLOOK | DS_CONTEXTHELP | DS_SETFONT | WS_CAPTION | WS_SYSMENU
34105 CAPTION "DXGL Config (Experimental)"
35106 FONT 8, "Ms Shell Dlg 2"
36107 {
37 - CONTROL "", IDC_TABS, WC_TABCONTROL, 0, 7, 35, 391, 192, WS_EX_LEFT
38 - DEFPUSHBUTTON "OK", IDOK, 244, 229, 50, 14, 0, WS_EX_LEFT
39 - PUSHBUTTON "Cancel", IDCANCEL, 296, 229, 50, 14, 0, WS_EX_LEFT
40 - PUSHBUTTON "&Apply", IDC_APPLY, 348, 229, 50, 14, WS_DISABLED, WS_EX_LEFT
41 - COMBOBOX IDC_APPS, 7, 17, 207, 195, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_NOINTEGRALHEIGHT | CBS_OWNERDRAWFIXED, WS_EX_LEFT
 108+ CONTROL "", IDC_TABS, WC_TABCONTROL, 0, 7, 35, 287, 189, WS_EX_LEFT
 109+ DEFPUSHBUTTON "OK", IDOK, 140, 226, 50, 14, 0, WS_EX_LEFT
 110+ PUSHBUTTON "Cancel", IDCANCEL, 192, 226, 50, 14, 0, WS_EX_LEFT
 111+ PUSHBUTTON "&Apply", IDC_APPLY, 244, 226, 50, 14, WS_DISABLED, WS_EX_LEFT
 112+ COMBOBOX IDC_APPS, 7, 17, 287, 195, WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_OWNERDRAWFIXED | 0x00000400, WS_EX_LEFT
42113 LTEXT "Application profile", IDC_STATIC, 7, 7, 58, 8, SS_LEFT, WS_EX_LEFT
43 - PUSHBUTTON "A&dd...", IDC_ADD, 216, 17, 90, 14, 0, WS_EX_LEFT
44 - PUSHBUTTON "&Remove", IDC_REMOVE, 308, 17, 90, 14, WS_DISABLED, WS_EX_LEFT
 114+ PUSHBUTTON "A&dd...", IDC_ADD, 7, 226, 50, 14, 0, WS_EX_LEFT
 115+ PUSHBUTTON "&Remove", IDC_REMOVE, 59, 226, 50, 14, WS_DISABLED, WS_EX_LEFT
45116 }
46117
47118
48119
49120 LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
 121+IDD_ADVANCED DIALOG 0, 0, 283, 176
 122+STYLE DS_3DLOOK | DS_CENTER | DS_SHELLFONT | WS_VISIBLE | WS_POPUP | WS_SYSMENU
 123+FONT 8, "Ms Shell Dlg"
 124+{
 125+ PUSHBUTTON "Write INI file...", IDC_WRITEINI, 203, 155, 73, 14, 0, WS_EX_LEFT
 126+ COMBOBOX IDC_TEXTUREFORMAT, 7, 17, 102, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 127+ LTEXT "Texture format", IDC_STATIC, 7, 7, 50, 8, SS_LEFT, WS_EX_LEFT
 128+ LTEXT "Texture access method", IDC_STATIC, 111, 7, 76, 8, SS_LEFT, WS_EX_LEFT
 129+ COMBOBOX IDC_TEXUPLOAD, 111, 17, 100, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS, WS_EX_LEFT
 130+}
 131+
 132+
 133+
 134+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
50135 IDD_LOADING DIALOG 0, 0, 246, 41
51136 STYLE DS_3DLOOK | DS_CENTER | DS_MODALFRAME | DS_SHELLFONT | WS_BORDER | WS_VISIBLE | WS_POPUP | WS_SYSMENU
52137 EXSTYLE WS_EX_WINDOWEDGE
Index: dxglcfg2/resource.h
@@ -1,5 +1,5 @@
22 // DXGL
3 -// Copyright (C) 2011-2012 William Feely
 3+// Copyright (C) 2011-2014 William Feely
44
55 // This library is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU Lesser General Public
@@ -19,13 +19,42 @@
2020 #define IDC_STATIC (-1)
2121 #endif
2222
23 -#define IDD_DXGLCFG 103
24 -#define IDI_DXGL 107
25 -#define IDI_DXGLSM 109
26 -#define IDI_STAR 111
27 -#define IDD_LOADING 113
 23+#define IDD_DXGLCFG 100
 24+#define IDI_DXGL 101
 25+#define IDI_DXGLSM 102
 26+#define IDI_STAR 103
 27+#define IDD_LOADING 110
 28+#define IDD_DISPLAY 111
 29+#define IDD_3DGRAPHICS 112
 30+#define IDD_EFFECTS 113
 31+#define IDD_ADVANCED 114
 32+#define IDD_DEBUG 115
2833 #define IDC_APPLY 1000
2934 #define IDC_APPS 1001
3035 #define IDC_ADD 1002
3136 #define IDC_REMOVE 1003
3237 #define IDC_TABS 1004
 38+#define IDC_DEBUGLIST 1005
 39+#define IDC_SHADER 1006
 40+#define IDC_SORTMODES 1007
 41+#define IDC_TEXFILTER 1008
 42+#define IDC_TEXTUREFORMAT 1009
 43+#define IDC_ANISO 1010
 44+#define IDC_BROWSESHADER 1011
 45+#define IDC_TEXUPLOAD 1012
 46+#define IDC_VIDMODE 1013
 47+#define IDC_MSAA 1014
 48+#define IDC_PRIMARYSCALE 1015
 49+#define IDC_SCALE 1016
 50+#define IDC_WRITEINI 1017
 51+#define IDC_ASPECT 1018
 52+#define IDC_ASPECT3D 1019
 53+#define IDC_CUSTOMSCALELABEL 1020
 54+#define IDC_CUSTOMSCALELABELX 1021
 55+#define IDC_DPISCALE 1022
 56+#define IDC_COLORDEPTH 1023
 57+#define IDC_CUSTOMSCALEX 1024
 58+#define IDC_CUSTOMSCALELABELY 1025
 59+#define IDC_EXTRAMODES 1026
 60+#define IDC_CUSTOMSCALEY 1027
 61+#define IDC_VSYNC 1028
Index: dxgltest/dxgltest.cpp
@@ -724,6 +724,7 @@
725725 NMHDR *nm;
726726 HICON icon;
727727 int newtab;
 728+ ZeroMemory(&tab, sizeof(TCITEM));
728729 switch(Msg)
729730 {
730731 case WM_INITDIALOG: