资源简介
外部窗口绘制方块,内存占用小,小不闪烁
导入进程名,和坐标就能用
代码片段和文件信息
#include “DirectX.h“
IDirect3D9Ex* p_object = 0;
IDirect3DDevice9Ex* p_Device = 0;
D3DPRESENT_PARAMETERS p_Params;
ID3DXFont* pFontSmall=0;
ID3DXLine *pLine=0;
int DirectXInit(HWND hWnd)
{
if(FAILED(Direct3DCreate9Ex(D3D_SDK_VERSION &p_object)))
exit(1);
ZeroMemory(&p_Params sizeof(p_Params));
p_Params.Windowed = TRUE;
p_Params.SwapEffect = D3DSWAPEFFECT_DISCARD;
p_Params.hDeviceWindow = hWnd;
p_Params.MultiSampleQuality = D3DMULTISAMPLE_NONE;
p_Params.BackBufferFormat = D3DFMT_A8R8G8B8 ;
p_Params.BackBufferWidth = Width;
p_Params.BackBufferHeight = Height;
p_Params.EnableAutoDepthStencil = TRUE;
p_Params.AutoDepthStencilFormat = D3DFMT_D16;
if (FAILED(p_object->CreateDeviceEx(D3DADAPTER_DEFAULT D3DDEVTYPE_HAL hWnd D3DCREATE_HARDWARE_VERTEXPROCESSING &p_Params 0 &p_Device)))
exit(1);
if (!pLine)
D3DXCreateLine(p_Device &pLine);
return 0;
}
int Render()
{
if (tWnd == GetForegroundWindow())
{
p_Device->Clear(0 0 D3DCLEAR_TARGET 0 1.0f 0);
p_Device->BeginScene();
//绘制
DrawLine(400 400 500 5005 D3DCOLOR_RGBA(255 0 0 255));
DrawFilledRectangle(50 50 100 100 D3DCOLOR_RGBA(255 0 0 255));
DrawString(“Simple Text“17 10 20 D3DCOLOR_RGBA(255 242 245 7));
DrawBorderBox(200 200 300 300 1 D3DCOLOR_RGBA(255 0 0 255));
Box3D(500 500 500600 D3DCOLOR_RGBA(255 0 0 255));
//
p_Device->EndScene();
p_Device->PresentEx(0 0 0 0 0);
pFontSmall->Release();
pFontSmall = nullptr;
return 0;
}
p_Device->Clear(0 0 D3DCLEAR_TARGET 0 1.0f 0);
p_Device->BeginScene();
p_Device->EndScene();
p_Device->PresentEx(0 0 0 0 0);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 71680 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.exe
文件 725532 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.ilk
文件 1264640 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.pdb
文件 1512 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\cl.command.1.tlog
文件 75992 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\CL.read.1.tlog
文件 2048 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\CL.write.1.tlog
文件 184 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\D3D9.lastbuildstate
文件 1422 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\li
文件 3114 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\li
文件 698 2018-06-11 10:20 hjijhjkh5456\Debug\D3D9.tlog\li
文件 1447 2018-06-11 10:20 hjijhjkh5456\Debug\DirectX Overlay.log
文件 172646 2018-06-11 10:20 hjijhjkh5456\Debug\DirectX.obj
文件 176416 2018-06-11 10:00 hjijhjkh5456\Debug\Drawings.obj
文件 177224 2018-06-11 10:07 hjijhjkh5456\Debug\Main.obj
文件 1084416 2018-06-11 10:20 hjijhjkh5456\Debug\vc120.idb
文件 667648 2018-06-11 10:20 hjijhjkh5456\Debug\vc120.pdb
文件 5387 2018-06-11 10:00 hjijhjkh5456\DirectX Overlay.vcxproj
文件 1187 2018-04-20 15:37 hjijhjkh5456\DirectX Overlay.vcxproj.filters
文件 165 2016-10-15 18:19 hjijhjkh5456\DirectX Overlay.vcxproj.user
文件 1837 2018-06-11 10:20 hjijhjkh5456\DirectX.cpp
文件 532 2018-04-20 04:00 hjijhjkh5456\DirectX.h
文件 42336256 2018-06-11 21:43 hjijhjkh5456\DirectX9.sdf
文件 1448 2018-04-19 11:16 hjijhjkh5456\DirectX9.sln
..A..H. 25600 2018-06-11 21:43 hjijhjkh5456\DirectX9.v12.suo
文件 4309 2018-04-20 15:37 hjijhjkh5456\Drawings.cpp
文件 658 2018-04-20 03:29 hjijhjkh5456\Drawings.h
文件 2665 2018-06-11 10:07 hjijhjkh5456\Main.cpp
文件 667 2018-04-20 14:32 hjijhjkh5456\Main.h
目录 0 2018-06-12 09:56 hjijhjkh5456\Debug\D3D9.tlog
目录 0 2018-06-12 09:56 hjijhjkh5456\Debug
............此处省略4个文件信息
- 上一篇:CCS6.1安装文件,破解文件,安装步骤
- 下一篇:信号与线性系统分析习题全解
评论
共有 条评论