• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得windowscocoapythonphprubygameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

練習用です。いろんなものがごちゃまぜです。


Commit MetaInfo

Revision21c29ff1e09772093692290b9cfe5d16cb1eedfc (tree)
Time2017-04-04 17:34:07
Authorbellyoshi <tccwas@gmai...>
Commiterbellyoshi

Log Message

Merge branch 'master' of git.pf.osdn.jp:/gitroot/b/be/bellyoshi/VSPRAC

Change Summary

Incremental Difference

--- a/CPP/ITP1_11/con.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
1-#include <iostream>
2-using namespace std;
3-
4-class cls{
5-public:
6- cls();
7- cls(const cls &c);
8-};
9-
10-cls::cls(){
11- cout << "cls::cls\n";
12-}
13-cls::cls(const cls &c){
14- cout << "cls::cls(cls c)\n";
15-}
16-
17-int main(int argc, char *argv[]){
18- cls c1;
19- cls c2 = c1;
20- return 0;
21-}
--- /dev/null
+++ b/HelloWord/HelloWord.sln
@@ -0,0 +1,28 @@
1+
2+Microsoft Visual Studio Solution File, Format Version 12.00
3+# Visual Studio 15
4+VisualStudioVersion = 15.0.26228.4
5+MinimumVisualStudioVersion = 10.0.40219.1
6+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HelloWord", "HelloWord\HelloWord.vcxproj", "{44E5025A-16BE-41E7-85C6-3ED09C61FEA8}"
7+EndProject
8+Global
9+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+ Debug|x64 = Debug|x64
11+ Debug|x86 = Debug|x86
12+ Release|x64 = Release|x64
13+ Release|x86 = Release|x86
14+ EndGlobalSection
15+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Debug|x64.ActiveCfg = Debug|x64
17+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Debug|x64.Build.0 = Debug|x64
18+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Debug|x86.ActiveCfg = Debug|Win32
19+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Debug|x86.Build.0 = Debug|Win32
20+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Release|x64.ActiveCfg = Release|x64
21+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Release|x64.Build.0 = Release|x64
22+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Release|x86.ActiveCfg = Release|Win32
23+ {44E5025A-16BE-41E7-85C6-3ED09C61FEA8}.Release|x86.Build.0 = Release|Win32
24+ EndGlobalSection
25+ GlobalSection(SolutionProperties) = preSolution
26+ HideSolutionNode = FALSE
27+ EndGlobalSection
28+EndGlobal
--- /dev/null
+++ b/HelloWord/HelloWord/HelloWord.vcxproj
@@ -0,0 +1,119 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup Label="ProjectConfigurations">
4+ <ProjectConfiguration Include="Debug|Win32">
5+ <Configuration>Debug</Configuration>
6+ <Platform>Win32</Platform>
7+ </ProjectConfiguration>
8+ <ProjectConfiguration Include="Release|Win32">
9+ <Configuration>Release</Configuration>
10+ <Platform>Win32</Platform>
11+ </ProjectConfiguration>
12+ <ProjectConfiguration Include="Debug|x64">
13+ <Configuration>Debug</Configuration>
14+ <Platform>x64</Platform>
15+ </ProjectConfiguration>
16+ <ProjectConfiguration Include="Release|x64">
17+ <Configuration>Release</Configuration>
18+ <Platform>x64</Platform>
19+ </ProjectConfiguration>
20+ </ItemGroup>
21+ <PropertyGroup Label="Globals">
22+ <VCProjectVersion>15.0</VCProjectVersion>
23+ <ProjectGuid>{44E5025A-16BE-41E7-85C6-3ED09C61FEA8}</ProjectGuid>
24+ <RootNamespace>HelloWord</RootNamespace>
25+ <WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
26+ </PropertyGroup>
27+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
28+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
29+ <ConfigurationType>Application</ConfigurationType>
30+ <UseDebugLibraries>true</UseDebugLibraries>
31+ <PlatformToolset>v141</PlatformToolset>
32+ <CharacterSet>MultiByte</CharacterSet>
33+ </PropertyGroup>
34+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
35+ <ConfigurationType>Application</ConfigurationType>
36+ <UseDebugLibraries>false</UseDebugLibraries>
37+ <PlatformToolset>v141</PlatformToolset>
38+ <WholeProgramOptimization>true</WholeProgramOptimization>
39+ <CharacterSet>MultiByte</CharacterSet>
40+ </PropertyGroup>
41+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
42+ <ConfigurationType>Application</ConfigurationType>
43+ <UseDebugLibraries>true</UseDebugLibraries>
44+ <PlatformToolset>v141</PlatformToolset>
45+ <CharacterSet>MultiByte</CharacterSet>
46+ </PropertyGroup>
47+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
48+ <ConfigurationType>Application</ConfigurationType>
49+ <UseDebugLibraries>false</UseDebugLibraries>
50+ <PlatformToolset>v141</PlatformToolset>
51+ <WholeProgramOptimization>true</WholeProgramOptimization>
52+ <CharacterSet>MultiByte</CharacterSet>
53+ </PropertyGroup>
54+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
55+ <ImportGroup Label="ExtensionSettings">
56+ </ImportGroup>
57+ <ImportGroup Label="Shared">
58+ </ImportGroup>
59+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
60+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
61+ </ImportGroup>
62+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
63+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+ </ImportGroup>
65+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
66+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+ </ImportGroup>
68+ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
69+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
70+ </ImportGroup>
71+ <PropertyGroup Label="UserMacros" />
72+ <PropertyGroup />
73+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
74+ <ClCompile>
75+ <WarningLevel>Level3</WarningLevel>
76+ <Optimization>Disabled</Optimization>
77+ <SDLCheck>true</SDLCheck>
78+ </ClCompile>
79+ </ItemDefinitionGroup>
80+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
81+ <ClCompile>
82+ <WarningLevel>Level3</WarningLevel>
83+ <Optimization>Disabled</Optimization>
84+ <SDLCheck>true</SDLCheck>
85+ </ClCompile>
86+ </ItemDefinitionGroup>
87+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
88+ <ClCompile>
89+ <WarningLevel>Level3</WarningLevel>
90+ <Optimization>MaxSpeed</Optimization>
91+ <FunctionLevelLinking>true</FunctionLevelLinking>
92+ <IntrinsicFunctions>true</IntrinsicFunctions>
93+ <SDLCheck>true</SDLCheck>
94+ </ClCompile>
95+ <Link>
96+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
97+ <OptimizeReferences>true</OptimizeReferences>
98+ </Link>
99+ </ItemDefinitionGroup>
100+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
101+ <ClCompile>
102+ <WarningLevel>Level3</WarningLevel>
103+ <Optimization>MaxSpeed</Optimization>
104+ <FunctionLevelLinking>true</FunctionLevelLinking>
105+ <IntrinsicFunctions>true</IntrinsicFunctions>
106+ <SDLCheck>true</SDLCheck>
107+ </ClCompile>
108+ <Link>
109+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
110+ <OptimizeReferences>true</OptimizeReferences>
111+ </Link>
112+ </ItemDefinitionGroup>
113+ <ItemGroup>
114+ <ClCompile Include="winmain.cpp" />
115+ </ItemGroup>
116+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
117+ <ImportGroup Label="ExtensionTargets">
118+ </ImportGroup>
119+</Project>
\ No newline at end of file
--- /dev/null
+++ b/HelloWord/HelloWord/HelloWord.vcxproj.filters
@@ -0,0 +1,22 @@
1+<?xml version="1.0" encoding="utf-8"?>
2+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+ <ItemGroup>
4+ <Filter Include="ソース ファイル">
5+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
6+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
7+ </Filter>
8+ <Filter Include="ヘッダー ファイル">
9+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
10+ <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
11+ </Filter>
12+ <Filter Include="リソース ファイル">
13+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
14+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
15+ </Filter>
16+ </ItemGroup>
17+ <ItemGroup>
18+ <ClCompile Include="winmain.cpp">
19+ <Filter>ソース ファイル</Filter>
20+ </ClCompile>
21+ </ItemGroup>
22+</Project>
\ No newline at end of file
--- /dev/null
+++ b/HelloWord/HelloWord/winmain.cpp
@@ -0,0 +1,197 @@
1+//#define WIN32_LEAN_AND_MEAN
2+
3+#include <windows.h>
4+
5+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow);
6+
7+bool CreateMainWindow(HINSTANCE, int);
8+LRESULT WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
9+
10+
11+const char CLASS_NAME[] = "WinMain";
12+const char APP_TITLE[] = "Hello World";
13+const int WINDOW_WIDTH = 400;
14+const int WINDOW_HEIGHT = 400;
15+char ch;
16+HDC hdc;
17+RECT rect;
18+PAINTSTRUCT ps;
19+bool vkKeys[256];
20+
21+int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
22+{
23+ MSG msg;
24+ if (!CreateMainWindow(hInstance, nCmdShow))
25+ return false;
26+ bool done = false;
27+ while (!done) {
28+ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
29+ {
30+ if (msg.message == WM_QUIT) {
31+ done = true;
32+ }
33+ TranslateMessage(&msg);
34+ DispatchMessage(&msg);
35+ }
36+ }
37+ return msg.wParam;
38+}
39+
40+bool CreateMainWindow(HINSTANCE hInstance, int nCmdShow)
41+{
42+ HWND hwnd;
43+ WNDCLASSEX wcx;
44+
45+ wcx.cbSize = sizeof(wcx);
46+ wcx.style = CS_HREDRAW | CS_VREDRAW;
47+ wcx.lpfnWndProc = (WNDPROC)WinProc;
48+ wcx.cbClsExtra = 0;
49+ wcx.cbWndExtra = 0;
50+ wcx.hInstance = hInstance;
51+ wcx.hIcon = NULL;
52+ wcx.hCursor = LoadCursor(NULL, IDC_ARROW);
53+ wcx.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
54+ wcx.lpszMenuName = NULL;
55+ wcx.lpszClassName = CLASS_NAME;
56+ wcx.hIconSm = NULL;
57+
58+ if (RegisterClassEx(&wcx) == 0) {
59+ return false;
60+ }
61+
62+ hwnd = CreateWindow(
63+ CLASS_NAME,
64+ APP_TITLE,
65+ WS_OVERLAPPEDWINDOW,
66+ CW_USEDEFAULT,
67+ CW_USEDEFAULT,
68+ WINDOW_WIDTH,
69+ WINDOW_HEIGHT,
70+ (HWND)NULL,
71+ (HMENU)NULL,
72+ hInstance,
73+ (LPVOID)NULL);
74+
75+ if (!hwnd) {
76+ return false;
77+ }
78+
79+ ShowWindow(hwnd, nCmdShow);
80+
81+ UpdateWindow(hwnd);
82+
83+ return true;
84+
85+
86+ return false;
87+}
88+
89+LRESULT WinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
90+{
91+ short nVirtualKey;
92+ const short SHIFTED = (short)0x8000;
93+ TEXTMETRIC tm;
94+ DWORD chWidth = 20;
95+ DWORD chHeight = 20;
96+
97+ switch (msg) {
98+ case WM_CREATE:
99+ hdc = GetDC(hWnd);
100+ GetTextMetrics(hdc, &tm);
101+ ReleaseDC(hWnd, hdc);
102+ chWidth = tm.tmAveCharWidth;
103+ chHeight = tm.tmHeight;
104+ return 0;
105+ case WM_DESTROY:
106+ PostQuitMessage(0);
107+ return 0;
108+ case WM_CHAR:
109+ switch(wParam) {
110+ case 0x08:
111+ case 0x09:
112+ case 0x0A:
113+ case 0x0d:
114+ case 0x1b:
115+ MessageBeep((UINT)-1);
116+ return 0;
117+ default:
118+ ch = (TCHAR)wParam;
119+ InvalidateRect(hWnd, NULL, TRUE);
120+ return 0;
121+ }
122+ case WM_PAINT:
123+ hdc = BeginPaint(hWnd, &ps);
124+ TextOut(hdc, 0, 0, &ch, 1);
125+ for (int r = 0; r < 16; r++) {
126+ for (int c = 0; c < 16; c++)
127+ {
128+ if (vkKeys[r * 16 + c]) {
129+ SetBkMode(hdc, OPAQUE);
130+ TextOut(hdc, c * chWidth + chWidth * 2, r* chHeight + chHeight * 2, "T ", 2);
131+ }
132+ else {
133+ SetBkMode(hdc, TRANSPARENT);
134+ TextOut(hdc, c * chWidth + chWidth * 2, r* chHeight + chHeight * 2, "F ", 2);
135+ }
136+ }
137+ }
138+ EndPaint(hWnd, &ps);
139+ return 0;
140+ case WM_KEYDOWN:
141+ vkKeys[wParam] = true;
142+ switch (wParam)
143+ {
144+ case VK_SHIFT:
145+ nVirtualKey = GetKeyState(VK_LSHIFT);
146+ if (nVirtualKey & SHIFTED) {
147+ vkKeys[VK_LSHIFT] = true;
148+ }
149+ nVirtualKey = GetKeyState(VK_RSHIFT);
150+ if (nVirtualKey & SHIFTED) {
151+ vkKeys[VK_RSHIFT] = true;
152+ }
153+ break;
154+ case VK_CONTROL:
155+ nVirtualKey = GetKeyState(VK_LCONTROL);
156+ if (nVirtualKey & SHIFTED) {
157+ vkKeys[VK_LCONTROL] = true;
158+ }
159+ nVirtualKey = GetKeyState(VK_RCONTROL);
160+ if (nVirtualKey & SHIFTED) {
161+ vkKeys[VK_RCONTROL] = true;
162+ }
163+ break;
164+ }
165+ InvalidateRect(hWnd, NULL, TRUE);
166+ return 0;
167+ case WM_KEYUP:
168+ vkKeys[wParam] = false;
169+ switch (wParam)
170+ {
171+ case VK_SHIFT:
172+ nVirtualKey = GetKeyState(VK_LSHIFT);
173+ if ((nVirtualKey & SHIFTED) == 0) {
174+ vkKeys[VK_LSHIFT] = false;
175+ }
176+ nVirtualKey = GetKeyState(VK_RSHIFT);
177+ if ((nVirtualKey & SHIFTED) == 0) {
178+ vkKeys[VK_RSHIFT] = false;
179+ }
180+ break;
181+ case VK_CONTROL:
182+ nVirtualKey = GetKeyState(VK_LCONTROL);
183+ if ((nVirtualKey & SHIFTED) == 0) {
184+ vkKeys[VK_LCONTROL] = false;
185+ }
186+ nVirtualKey = GetKeyState(VK_RCONTROL);
187+ if ((nVirtualKey & SHIFTED) == 0) {
188+ vkKeys[VK_RCONTROL] = false;
189+ }
190+ break;
191+ }
192+ InvalidateRect(hWnd, NULL, TRUE);
193+ return 0;
194+
195+ }
196+ return DefWindowProc(hWnd, msg, wParam, lParam);
197+}