#pragma once
// MFC库
#include <SDKDDKVer.h>//版本定义
#include <afxwin.h>//MFC核心标准组件
#include <afxdlgs.h>
// C++库
#include <set>
#include <map>
#include <unordered_map>
#include <list>
#include <vector>
#include <string>
#include <queue>
#include <mutex>
// SQLite库
#include <sqlite3.h>
// TinyXML库
#include <tinyxml2.h>
// MyDXRenderer
#include <MyDX11Renderer.h>
//宏定义
#define LOADHOTKEY(id) hAccel = ::LoadAccelerators(AfxGetApp()->m_hInstance, MAKEINTRESOURCE(id))//载入热键
#define HOTKEYPROC if (TranslateAccelerator(GetSafeHwnd(), hAccel, pMsg))return TRUE;return CDialog::PreTranslateMessage(pMsg)
void UTF16ToUTF8(const wchar_t* wstr, std::vector<char>*outData, int* outLen = nullptr);
void UTF8ToUTF16(const char* str, std::vector<wchar_t>*outData, int* outLen = nullptr);
#define DPISCALE(x) ((x)*dpi/100)
//压缩函数
void InitZLib();
void ZLibCompressData(std::vector<BYTE>*outData, size_t * outLen, const void* source, size_t sourceLen);//压缩数据
void ZLibUncompressData(std::vector<BYTE>*outData, size_t * outLen, const void* source, size_t sourceLen);//解压数据

void MoveToNeighborRect(CRect& rcDst, CRect& rcSrc, int directionDst, int directionSrc);
void MoveWindow(CWnd* wnd, int x, int y);
void LoadResourceTexture(MyDX11Renderer * pRenderer, UINT res, ID3D11Texture2D * *outTexture, ID3D11ShaderResourceView * *outSRV);
float MyFar(float myFar);//计算随距离增加，眼睛中物体移动比例

void Base64Encode(std::string & out, const void* data, size_t dataSize);
bool Base64Decode(std::vector<BYTE>&out, const char* base64Str);

int GetSafePxa(int X, int Y, std::vector<LONG>&pxmData, std::vector<int>&pxaData, int pxmArr_w, int pxmArr_h);
void MyWinExec(std::wstring cmd);