diff --git a/engineX.sln b/engineX.sln new file mode 100644 index 0000000..c4265e3 --- /dev/null +++ b/engineX.sln @@ -0,0 +1,31 @@ +п»ї +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31229.75 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engineX", "engineX\engineX.vcxproj", "{2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Debug|x64.ActiveCfg = Debug|x64 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Debug|x64.Build.0 = Debug|x64 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Debug|x86.ActiveCfg = Debug|Win32 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Debug|x86.Build.0 = Debug|Win32 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Release|x64.ActiveCfg = Release|x64 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Release|x64.Build.0 = Release|x64 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Release|x86.ActiveCfg = Release|Win32 + {2F0B6944-F3CB-4272-9C5F-C6BB105F8ACC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {B41AA472-F217-4F38-B1DF-756E626122A7} + EndGlobalSection +EndGlobal diff --git a/engineX/Window.cpp b/engineX/Window.cpp new file mode 100644 index 0000000..16671e2 --- /dev/null +++ b/engineX/Window.cpp @@ -0,0 +1,65 @@ +#include "Window.h" +const wchar_t MAIN_WINDOW_NAME[] = L"Sample Window Class"; +const wchar_t MAIN_WINDOW_DESCRIPRION[] = L"Direct X Application"; +Window* window = nullptr; +Window::Window() +{ + +} + + +LRESULT CALLBACK WindProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) +{ + + switch (msg) + { + case WM_CREATE: + { + // Событие срабатывает когда WINDOWS запускает, программу. + break; + } + case WM_DESTROY: + { + // Событие срабатывает когда WINDOWS убивает, программу. + ::PostQuitMessage(0); + break; + } + default: + return ::DefWindowProc(hwnd, msg, wparam, lparam); + } +}; +bool Window::init() +{ + WNDCLASSEX wc; + wc.cbClsExtra = NULL; + wc.cbSize = sizeof(WNDCLASSEX); + wc.cbWndExtra = NULL; + wc.hbrBackground = (HBRUSH)COLOR_WINDOW; + wc.hCursor = LoadCursor(NULL, IDC_ARROW); + wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); + wc.hInstance = NULL; + wc.lpfnWndProc = &WindProc; + wc.lpszClassName = MAIN_WINDOW_NAME; + if(!::RegisterClassExW(&wc)); // если класс регистрации не вызван + return false; + // создание окна + m_hwnd=::CreateWindowExW(WS_EX_OVERLAPPEDWINDOW, MAIN_WINDOW_NAME, MAIN_WINDOW_DESCRIPRION, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1024, 768, NULL, NULL, NULL, NULL); + // если создание не удалось + if (!m_hwnd) + return false; + // показывает и открывает окно + ::ShowWindow(m_hwnd, SW_SHOW); + ::UpdateWindow(m_hwnd); + return true; +} + +bool Window::realese() +{ + // Удаление окна + if (!::DestroyWindow(m_hwnd)) + return false; + return true; +} +Window::~Window() +{ +} \ No newline at end of file diff --git a/engineX/Window.h b/engineX/Window.h new file mode 100644 index 0000000..018e544 --- /dev/null +++ b/engineX/Window.h @@ -0,0 +1,14 @@ +#pragma once +#include + +class Window +{ + public: + Window(); + bool init(); + bool realese(); + ~Window(); +protected: + HWND m_hwnd; +}; + diff --git a/engineX/engineX.vcxproj b/engineX/engineX.vcxproj new file mode 100644 index 0000000..b278d91 --- /dev/null +++ b/engineX/engineX.vcxproj @@ -0,0 +1,151 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {2f0b6944-f3cb-4272-9c5f-c6bb105f8acc} + engineX + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + + \ No newline at end of file diff --git a/engineX/engineX.vcxproj.filters b/engineX/engineX.vcxproj.filters new file mode 100644 index 0000000..bb0432d --- /dev/null +++ b/engineX/engineX.vcxproj.filters @@ -0,0 +1,20 @@ +п»ї + + + + {544d7726-13fe-4e7e-90c6-56d5d4d29d17} + + + {ad491b5d-ac9b-466c-aeac-50a5fa04a9e6} + + + + + App + + + + + + + \ No newline at end of file diff --git a/engineX/main.cpp b/engineX/main.cpp new file mode 100644 index 0000000..ffc6dab --- /dev/null +++ b/engineX/main.cpp @@ -0,0 +1,3 @@ +int main() { + return 0; +} \ No newline at end of file