Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma comment(linker, "/subsystem:windows /ENTRY:mainCRTStartup")
- #include "imgui.h"
- #include "imgui_impl_dx9.h"
- #include "imgui_impl_win32.h"
- #include <d3d9.h>
- #include <tchar.h>
- #include <string>
- #include <vector>
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #include <iostream>
- #include <fstream>
- #include <filesystem>
- #include <sstream>
- #include "imgui_internal.h"
- #include "imgui.h"
- #include <D3dx9tex.h>
- #pragma comment(lib, "D3dx9")
- namespace fs = std::filesystem;
- static LPDIRECT3D9 g_pD3D = NULL;
- static LPDIRECT3DDEVICE9 g_pd3dDevice = NULL;
- static D3DPRESENT_PARAMETERS g_d3dpp = {};
- bool CreateDeviceD3D(HWND hWnd);
- void CleanupDeviceD3D();
- void ResetDevice();
- LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- struct Wnds
- {
- //int ID = 0;
- std::string Name;
- std::string Text;
- };
- std::vector<Wnds> WndList;
- std::vector<Wnds> WndList2;
- char Buffer[64];
- char Buffer2[512];
- bool bDelete = false;
- bool bShowWindows = true;
- bool bTextCenter = false;
- bool bOnlyText = false;
- int GlobalIndex = -1;
- int GlobalIndex2 = -1;
- bool LoadTextureFromFile(const char* filename, PDIRECT3DTEXTURE9* out_texture, int* out_width, int* out_height)
- {
- PDIRECT3DTEXTURE9 texture;
- HRESULT hr = D3DXCreateTextureFromFileA(g_pd3dDevice, filename, &texture);
- if (hr != S_OK)
- return false;
- D3DSURFACE_DESC my_image_desc;
- texture->GetLevelDesc(0, &my_image_desc);
- *out_texture = texture;
- *out_width = (int)my_image_desc.Width;
- *out_height = (int)my_image_desc.Height;
- return true;
- }
- void TextCentered(std::string text) {
- float win_width = ImGui::GetWindowSize().x;
- float text_width = ImGui::CalcTextSize(text.c_str()).x;
- float text_indentation = (win_width - text_width) * 0.5f;
- float min_indentation = 20.0f;
- if (text_indentation <= min_indentation) {
- text_indentation = min_indentation;
- }
- ImGui::SameLine(text_indentation);
- ImGui::PushTextWrapPos(win_width - text_indentation);
- ImGui::TextWrapped(text.c_str());
- ImGui::PopTextWrapPos();
- }
- int main(int, char**)
- {
- srand (time(NULL));
- //Wnds tmp;
- //tmp.ID = 1234;
- //tmp.Name = "ay##*";
- //WndList.push_back(tmp);
- std::string path = "Data/";
- std::string path2 = "Data2/";
- for (const auto& entry : fs::directory_iterator(path))
- {
- std::string line;
- std::ifstream myfile (entry.path());
- std::string name;
- std::stringstream ss;
- ss << entry.path();
- ss >> name;
- name = name.substr(0, name.length()-1);
- name.erase(0, 6);
- Wnds tmp;
- tmp.Name = name;
- if (myfile.is_open())
- {
- while ( getline (myfile,line) )
- {
- tmp.Text += line + "\n";
- }
- }
- myfile.close();
- WndList.push_back(tmp);
- }
- for (const auto& entry : fs::directory_iterator(path2))
- {
- std::string line;
- std::ifstream myfile (entry.path());
- std::string name;
- std::stringstream ss;
- ss << entry.path();
- ss >> name;
- name = name.substr(0, name.length()-1);
- name.erase(0, 7);
- Wnds tmp;
- tmp.Name = name;
- if (myfile.is_open())
- {
- while ( getline (myfile,line) )
- {
- tmp.Text += line + "\n";
- }
- }
- myfile.close();
- WndList2.push_back(tmp);
- }
- std::ifstream myfile ("bCenter");
- if (myfile.is_open())
- {
- bTextCenter = true;
- }
- myfile.close();
- WNDCLASSEX wc = { sizeof(WNDCLASSEX), CS_CLASSDC, WndProc, 0L, 0L, GetModuleHandle(NULL), NULL, NULL, NULL, NULL, _T("ImGui Example"), NULL };
- ::RegisterClassEx(&wc);
- HWND hwnd = ::CreateWindow(wc.lpszClassName, _T("Social-Media-Planer"), WS_OVERLAPPEDWINDOW, 0, 0, 1920, 1080, NULL, NULL, wc.hInstance, NULL);
- if (!CreateDeviceD3D(hwnd))
- {
- CleanupDeviceD3D();
- ::UnregisterClass(wc.lpszClassName, wc.hInstance);
- return 1;
- }
- // Show the window
- ::ShowWindow(hwnd, SW_SHOWDEFAULT);
- ::UpdateWindow(hwnd);
- IMGUI_CHECKVERSION();
- ImGui::CreateContext();
- ImGuiIO& io = ImGui::GetIO(); (void)io;
- io.IniFilename = "Windows.ini";
- io.Fonts->AddFontFromFileTTF("Roboto.ttf",25.0f);
- int my_image_width = 1920;
- int my_image_height = 1080;
- PDIRECT3DTEXTURE9 my_texture = NULL;
- bool ret = LoadTextureFromFile("IMG.png", &my_texture, &my_image_width, &my_image_height);
- IM_ASSERT(ret);
- ImGui::StyleColorsDark();
- ImGui_ImplWin32_Init(hwnd);
- ImGui_ImplDX9_Init(g_pd3dDevice);
- // Our state
- bool show_demo_window = true;
- bool show_another_window = false;
- ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
- clear_color = ImVec4(0.88f, 0.55f, 1.0f, 1.0f);
- // Main loop
- bool done = false;
- while (!done)
- {
- MSG msg;
- while (::PeekMessage(&msg, NULL, 0U, 0U, PM_REMOVE))
- {
- ::TranslateMessage(&msg);
- ::DispatchMessage(&msg);
- if (msg.message == WM_QUIT)
- done = true;
- }
- if (done)
- break;
- ImGuiStyle& style = ImGui::GetStyle();
- //style.WindowRounding = 5.3f;
- //style.FrameRounding = 2.3f;
- //style.ScrollbarRounding = 0;
- style.Colors[ImGuiCol_Text] = ImVec4(0.90f, 0.90f, 0.90f, 0.90f);
- style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.09f, 0.09f, 0.15f, 1.00f);
- style.Colors[ImGuiCol_PopupBg] = ImVec4(0.05f, 0.05f, 0.10f, 0.85f);
- style.Colors[ImGuiCol_Border] = ImVec4(0.70f, 0.70f, 0.70f, 0.65f);
- style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
- style.Colors[ImGuiCol_FrameBg] = ImVec4(0.00f, 0.00f, 0.01f, 1.00f);
- style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.90f, 0.80f, 0.80f, 0.40f);
- style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.90f, 0.65f, 0.65f, 0.45f);
- style.Colors[ImGuiCol_TitleBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.83f);
- style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.0f, 0.40f, 0.80f, 0.20f);
- style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.00f, 0.00f, 0.00f, 0.87f);
- style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.01f, 0.01f, 0.02f, 0.80f);
- style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.20f, 0.25f, 0.30f, 0.60f);
- style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.55f, 0.53f, 0.55f, 0.51f);
- style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.56f, 0.56f, 0.56f, 1.00f);
- style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.56f, 0.56f, 0.56f, 0.91f);
- style.Colors[ImGuiCol_CheckMark] = ImVec4(0.90f, 0.90f, 0.90f, 0.83f);
- style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.70f, 0.70f, 0.70f, 0.62f);
- style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.30f, 0.30f, 0.30f, 0.84f);
- style.Colors[ImGuiCol_Button] = ImVec4(0.48f, 0.72f, 0.89f, 0.49f);
- style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.50f, 0.69f, 0.99f, 0.68f);
- style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.80f, 0.50f, 0.50f, 1.00f);
- style.Colors[ImGuiCol_Header] = ImVec4(0.30f, 0.69f, 1.00f, 0.53f);
- style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.44f, 0.61f, 0.86f, 1.00f);
- style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.38f, 0.62f, 0.83f, 1.00f);
- style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.85f);
- style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.60f);
- style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 0.90f);
- style.Colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
- style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.00f, 0.00f, 1.00f, 0.35f);
- style.Alpha = 1.0f;
- style.FrameRounding = 3.0f;
- style.Colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
- style.Colors[ImGuiCol_WindowBg] = ImVec4(0.94f, 0.94f, 0.94f, 0.94f);
- style.Colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.94f);
- style.Colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.39f);
- style.Colors[ImGuiCol_BorderShadow] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f);
- style.Colors[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.94f);
- style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
- style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
- style.Colors[ImGuiCol_TitleBg] = ImVec4(0.96f, 0.96f, 0.96f, 1.00f);
- style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 1.00f, 1.00f, 0.51f);
- style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f);
- style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f);
- style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.98f, 0.98f, 0.98f, 0.53f);
- style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.69f, 0.69f, 0.69f, 1.00f);
- style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.59f, 0.59f, 0.59f, 1.00f);
- style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f);
- style.Colors[ImGuiCol_CheckMark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
- style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f);
- style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
- style.Colors[ImGuiCol_Button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
- style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
- style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f);
- style.Colors[ImGuiCol_Header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f);
- style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f);
- style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
- style.Colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.50f);
- style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
- style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
- style.Colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
- style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
- style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
- style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
- // Start the Dear ImGui frame
- ImGui_ImplDX9_NewFrame();
- ImGui_ImplWin32_NewFrame();
- ImGui::NewFrame();
- if (GetAsyncKeyState(VK_F1) & 0x1)
- {
- bShowWindows = !bShowWindows;
- Sleep(250);
- }
- if (GetAsyncKeyState(0x2) )
- {
- bDelete = true;
- }
- else
- {
- bDelete = false;
- }
- ImGui::Begin(" ", (bool*)true, ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoTitleBar);
- ImGui::SetWindowPos(ImVec2(0, 0));
- ImGui::Image((void*)my_texture, ImVec2(1920, 1000));
- ImGui::End();
- if (bShowWindows)
- {
- ImGui::Begin("Einstellungen");
- ImGui::SetWindowSize(ImVec2(300, 494));
- ImGui::Text("F1 = Einstellungen Sichtbar?");
- //ImGui::SetWindowPos(ImVec2(0, 0));
- // only set size
- if (ImGui::Button("Neues Fenster"))
- {
- bool bOkay = true;
- for (char c : Buffer)
- {
- if (c == 32)
- {
- bOkay = false;
- }
- }
- if (!bOnlyText && strlen(Buffer) > 0 && bOkay)
- {
- Wnds tmp;
- int ID = rand() % 10000;
- std::string IDString;
- std::stringstream ss;
- ss << ID;
- ss >> IDString;
- std::string str(Buffer);
- str += "##";
- str += IDString;
- tmp.Name = str;
- tmp.Text = Buffer2;
- WndList.push_back(tmp);
- }
- if (bOnlyText && strlen(Buffer) > 0 && bOkay)
- {
- Wnds tmp;
- int ID = rand() % 10000;
- std::string IDString;
- std::stringstream ss;
- ss << ID;
- ss >> IDString;
- std::string str(Buffer);
- str += "##";
- str += IDString;
- tmp.Name = str;
- tmp.Text = Buffer2;
- WndList2.push_back(tmp);
- }
- }
- if (ImGui::Button("Speichern"))
- {
- //std::remove("Windows.ini");
- std::filesystem::remove_all("Data");
- Sleep(200);
- std::filesystem::create_directory("Data");
- Sleep(200);
- std::filesystem::remove_all("Data2");
- Sleep(200);
- std::filesystem::create_directory("Data2");
- Sleep(200);
- for (Wnds w : WndList)
- {
- std::ofstream myfile;
- std::string PathName = "Data/";
- PathName += w.Name;
- if (bTextCenter)
- {
- std::ofstream mybool;
- mybool.open ("bCenter");
- mybool << "dummy";
- mybool.close();
- }
- else
- {
- std::remove("bCenter");
- }
- myfile.open (PathName);
- myfile << w.Text << std::endl;
- myfile.close();
- }
- for (Wnds w : WndList2)
- {
- std::ofstream myfile;
- std::string PathName = "Data2/";
- PathName += w.Name;
- myfile.open (PathName);
- myfile << w.Text << std::endl;
- myfile.close();
- }
- }
- ImGui::InputText(":Titel", Buffer, 60);
- ImGui::InputTextMultiline(":Text", Buffer2, 512);
- ImGui::Checkbox("Delete Button?", &bDelete);
- ImGui::Checkbox("Center Text?", &bTextCenter);
- ImGui::Checkbox("Nur Text", &bOnlyText);
- ImGui::End();
- }
- for (Wnds w : WndList)
- {
- std::string Name = " ";
- int len = w.Name.length();
- len = len - 13;
- if (len > 1)
- {
- for (int i = 0; i < len; i++)
- {
- if (i % 2 == 0)
- {
- Name.erase(0, 1);
- }
- }
- }
- Name += w.Name;
- ImGui::Begin(Name.c_str());
- ImVec2 Pos = ImGui::GetWindowPos();
- if ((int)Pos.x % 15 != 0)
- {
- Pos.x++;
- }
- if ((int)Pos.y % 20 != 0)
- {
- Pos.y++;
- }
- ImGui::SetWindowPos(Pos);
- ImGui::SetWindowSize(ImVec2(250, 120));
- if (bDelete && ImGui::Button("Del"))
- {
- int Counter = 0;
- for (Wnds ww : WndList)
- {
- if (ww.Name == w.Name)
- {
- GlobalIndex = Counter;
- break;
- }
- Counter++;
- }
- }
- //
- if (bTextCenter)
- {
- TextCentered(w.Text);
- }
- else
- {
- ImGui::Text(w.Text.c_str());
- }
- ImGui::End();
- }
- for (Wnds w : WndList2)
- {
- ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.f);
- ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
- ImGui::Begin(w.Name.c_str(), reinterpret_cast<bool*>(true), ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoResize);
- if (bDelete)
- {
- if (ImGui::Button("Del"))
- {
- int Counter = 0;
- for (Wnds ww : WndList2)
- {
- if (ww.Name == w.Name)
- {
- GlobalIndex2 = Counter;
- break;
- }
- Counter++;
- }
- }
- }
- ImGui::Text(w.Text.c_str());
- ImGui::End();
- ImGui::PopStyleColor();
- ImGui::PopStyleVar();
- }
- if (GlobalIndex != -1)
- {
- WndList.erase(WndList.begin() + GlobalIndex);
- GlobalIndex = -1;
- }
- if (GlobalIndex2 != -1)
- {
- WndList2.erase(WndList2.begin() + GlobalIndex2);
- GlobalIndex2 = -1;
- }
- ImGui::EndFrame();
- g_pd3dDevice->SetRenderState(D3DRS_ZENABLE, FALSE);
- g_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
- g_pd3dDevice->SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
- D3DCOLOR clear_col_dx = D3DCOLOR_RGBA((int)(clear_color.x*clear_color.w*255.0f), (int)(clear_color.y*clear_color.w*255.0f), (int)(clear_color.z*clear_color.w*255.0f), (int)(clear_color.w*255.0f));
- g_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, clear_col_dx, 1.0f, 0);
- if (g_pd3dDevice->BeginScene() >= 0)
- {
- ImGui::Render();
- ImGui_ImplDX9_RenderDrawData(ImGui::GetDrawData());
- g_pd3dDevice->EndScene();
- }
- HRESULT result = g_pd3dDevice->Present(NULL, NULL, NULL, NULL);
- if (result == D3DERR_DEVICELOST && g_pd3dDevice->TestCooperativeLevel() == D3DERR_DEVICENOTRESET)
- ResetDevice();
- }
- ImGui_ImplDX9_Shutdown();
- ImGui_ImplWin32_Shutdown();
- ImGui::DestroyContext();
- CleanupDeviceD3D();
- ::DestroyWindow(hwnd);
- ::UnregisterClass(wc.lpszClassName, wc.hInstance);
- return 0;
- }
- bool CreateDeviceD3D(HWND hWnd)
- {
- if ((g_pD3D = Direct3DCreate9(D3D_SDK_VERSION)) == NULL)
- return false;
- ZeroMemory(&g_d3dpp, sizeof(g_d3dpp));
- g_d3dpp.Windowed = true;
- g_d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
- g_d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
- g_d3dpp.EnableAutoDepthStencil = TRUE;
- g_d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
- g_d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE;
- //g_d3dpp.PresentationInterval
- if (g_pD3D->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &g_d3dpp, &g_pd3dDevice) < 0)
- return false;
- return true;
- }
- void CleanupDeviceD3D()
- {
- if (g_pd3dDevice) { g_pd3dDevice->Release(); g_pd3dDevice = NULL; }
- if (g_pD3D) { g_pD3D->Release(); g_pD3D = NULL; }
- }
- void ResetDevice()
- {
- ImGui_ImplDX9_InvalidateDeviceObjects();
- HRESULT hr = g_pd3dDevice->Reset(&g_d3dpp);
- if (hr == D3DERR_INVALIDCALL)
- IM_ASSERT(0);
- ImGui_ImplDX9_CreateDeviceObjects();
- }
- extern IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
- LRESULT WINAPI WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
- {
- if (ImGui_ImplWin32_WndProcHandler(hWnd, msg, wParam, lParam))
- return true;
- switch (msg)
- {
- case WM_SIZE:
- if (g_pd3dDevice != NULL && wParam != SIZE_MINIMIZED)
- {
- g_d3dpp.BackBufferWidth = LOWORD(lParam);
- g_d3dpp.BackBufferHeight = HIWORD(lParam);
- ResetDevice();
- }
- return 0;
- case WM_SYSCOMMAND:
- if ((wParam & 0xfff0) == SC_KEYMENU) // Disable ALT application menu
- return 0;
- break;
- case WM_DESTROY:
- ::PostQuitMessage(0);
- return 0;
- }
- return ::DefWindowProc(hWnd, msg, wParam, lParam);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement