- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 vTable Hook 挂接 Directx9 游戏。到目前为止,我已经能够成功地 Hook “Present”和“EndScene”(当然还有 CreateDevice 和 Direct3dCreate9),但是 - 这就是陷阱 - 只要我尝试实际绘制任何东西(例如,文本), 我的 Present hook 不再被击中。 (这可能是内置的安全例程……我不太确定)。
例如...下面的代码有效
HRESULT APIENTRY hook_EndScene(IDirect3DDevice9* pInterface){
pInterface->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 255, 255), 1.0f, 0);
return orig_EndScene(pInterface);
}
导致屏幕永久显示白色。但是,尝试呈现文本(在 CreateDevice Hook 中创建的字体,使用返回的 IDirect3DDevice9 指针 - 我已确保使用 __asm pushad 和 popad 来恢复寄存器)或 Sprite ,导致 EndScene Hook 根本不再被击中.
我想知道是否需要任何特殊代码来确保 EndScene Hook 工作...以及为什么我可以清除屏幕,但一旦我想向它呈现额外的内容... Hook 不再起作用(不再命中断点)。文本确实呈现成功……一瞬间,然后被 Bink 视频替换……在这种情况下 Hook 不再起作用。
我完全一无所知...希望能为更有经验的 DirectX 编码人员提供一些帮助。谢谢。
编辑这是我的 CreateDevice Hook 以防万一
HRESULT APIENTRY hook_CreateDevice(IDirect3D9* pInterface, UINT Adapter,D3DDEVTYPE DeviceType,HWND hFocusWindow,DWORD BehaviorFlags,D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DDevice9** ppReturnedDeviceInterface){
HRESULT ret = orig_CreateDevice(pInterface, Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, ppReturnedDeviceInterface);
__asm pushad
IDirect3DDevice9* d3ddev = *ppReturnedDeviceInterface;
D3DXCreateFont(d3ddev, 30, 0, FW_NORMAL,1, false, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY,DEFAULT_PITCH | FF_DONTCARE, "Arial", &lpfont);
//We have located the d3ddevice pointer. Now we can hook it!
DWORD* vTable = (DWORD*)*((DWORD*)d3ddev);
HookVTableFunc(vTable, (void*)&hook_EndScene, (void*)&orig_EndScene, 42);
__asm popad
return ret;
}
并且 EndScene Hook 不起作用(完全破坏 Hook ):
LPD3DXFONT lpfont;
HRESULT APIENTRY hook_EndScene(IDirect3DDevice9* pInterface){
static RECT textbox; SetRect(&textbox, 0, 0, 640, 480);
lpfont->DrawTextA(NULL, "Testing", 22, &textbox, 0, D3DCOLOR_ARGB(0,255,255,255));
return orig_EndScene(pInterface);
}
最佳答案
它对我有用,我认为问题是你将 alpha 设置为 0?
我的 Hook 代码生成这些变量
使用这些命名方案,其余函数也可以由宏自动生成。
实际示例/ Hook (适用于 32 位和 64 位):
LPD3DXFONT g_Font;
D3DXFONT_DESC FontDesc = {24,
0,
400,
0,
false,
DEFAULT_CHARSET,
OUT_TT_PRECIS,
CLIP_DEFAULT_PRECIS,
DEFAULT_PITCH,
"Arial"};
void initHook() {
IDirect3DDevice9* pD3DDevice = .. you got this one
hookVT(pD3DDevice, IDirect3DDevice9, EndScene);
D3DXCreateFontIndirect(pD3DDevice, &FontDesc,&g_Font);
}
#undef METHOD
#undef INTERFACE
#define INTERFACE IDirect3DDevice9
#define METHOD EndScene
GEN_HOOK(INTERFACE FAR* This)
{
static RECT textbox;
SetRect(&textbox, 5, 0, 640, 480);
g_Font->DrawTextA(NULL, "Testing sadsadsad asd sadas asd sad sad as das dsadas dsa dsadas dasd ", -1, &textbox, DT_CENTER, 0xffffffff);
CALL_ORGINAL();
return hr;
}
#undef METHOD
我为此工作创建了一些辅助函数/宏:
template<typename func, typename vttype> void changeVTEx(void** vt, vttype n, func target)
{
DWORD OldProtections = 0;
VirtualProtect(&vt[n], sizeof(LPCVOID), PAGE_EXECUTE_READWRITE, &OldProtections);
vt[n] = (void*)target;
VirtualProtect(&vt[n], sizeof(LPCVOID), OldProtections, &OldProtections);
}
// preprocessor tools
#define PPCAT_NX(A, B) A ## B
#define PPCAT(A, B) PPCAT_NX(A, B)
#define getVT(ptr) (*(void***)ptr)
#define changeVT(n, target) changeVTEx(getVT(This), n, target)
#define hookVT(ptr, INTERFACE, METHOD) \
{\
PPCAT(PPCAT(PPCAT(fo, INTERFACE),_), METHOD) = (PPCAT(PPCAT(PPCAT(f, INTERFACE), _), METHOD))(getVT(ptr)[PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), METHOD)]);\
changeVTEx(getVT(ptr), PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), METHOD), PPCAT(PPCAT(PPCAT(fh, INTERFACE),_), METHOD));\
}
#define GEN_HOOK_(TYPE, ...) \
PPCAT(PPCAT(PPCAT(f, INTERFACE), _), METHOD) PPCAT(PPCAT(PPCAT(fo, INTERFACE),_), METHOD) = NULL;\
TYPE STDMETHODCALLTYPE PPCAT(PPCAT(PPCAT(fh, INTERFACE),_), METHOD)(__VA_ARGS__)
#define GEN_HOOK(...) \
GEN_HOOK_(HRESULT, __VA_ARGS__)
#define UNHOOK \
changeVT(PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), METHOD), PPCAT(PPCAT(PPCAT(fo, INTERFACE),_), METHOD))
#define REHOOK \
changeVT(PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), METHOD), PPCAT(PPCAT(PPCAT(fh, INTERFACE),_), METHOD))
#define CALL_ORGINAL_(RET, ...) \
UNHOOK;\
RET = PPCAT(This->, METHOD)(__VA_ARGS__);\
REHOOK;
#define CALL_ORGINAL(...) \
CALL_ORGINAL_(HRESULT hr, __VA_ARGS__)
// Create function pointer types
#undef INTERFACE
#define INTERFACE IDirect3DDevice9
#undef PURE
#define PURE
#undef THIS_
#define THIS_ INTERFACE FAR* This,
#undef THIS
#define THIS INTERFACE FAR* This
#undef STDMETHOD
#define STDMETHOD(method) typedef HRESULT (STDMETHODCALLTYPE *PPCAT(PPCAT(PPCAT(f, INTERFACE),_), method))
#undef STDMETHOD_
#define STDMETHOD_(type,method) typedef type (STDMETHODCALLTYPE *PPCAT(PPCAT(PPCAT(f, INTERFACE),_), method))
// 1:1 copy from d3d9.h:
STDMETHOD(QueryInterface)(THIS_ REFIID riid, void** ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
STDMETHOD(TestCooperativeLevel)(THIS) PURE;
STDMETHOD_(UINT, GetAvailableTextureMem)(THIS) PURE;
STDMETHOD(EvictManagedResources)(THIS) PURE;
STDMETHOD(GetDirect3D)(THIS_ IDirect3D9** ppD3D9) PURE;
STDMETHOD(GetDeviceCaps)(THIS_ D3DCAPS9* pCaps) PURE;
STDMETHOD(GetDisplayMode)(THIS_ UINT iSwapChain,D3DDISPLAYMODE* pMode) PURE;
STDMETHOD(GetCreationParameters)(THIS_ D3DDEVICE_CREATION_PARAMETERS *pParameters) PURE;
STDMETHOD(SetCursorProperties)(THIS_ UINT XHotSpot,UINT YHotSpot,IDirect3DSurface9* pCursorBitmap) PURE;
STDMETHOD_(void, SetCursorPosition)(THIS_ int X,int Y,DWORD Flags) PURE;
STDMETHOD_(BOOL, ShowCursor)(THIS_ BOOL bShow) PURE;
STDMETHOD(CreateAdditionalSwapChain)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters,IDirect3DSwapChain9** pSwapChain) PURE;
STDMETHOD(GetSwapChain)(THIS_ UINT iSwapChain,IDirect3DSwapChain9** pSwapChain) PURE;
STDMETHOD_(UINT, GetNumberOfSwapChains)(THIS) PURE;
STDMETHOD(Reset)(THIS_ D3DPRESENT_PARAMETERS* pPresentationParameters) PURE;
STDMETHOD(Present)(THIS_ CONST RECT* pSourceRect,CONST RECT* pDestRect,HWND hDestWindowOverride,CONST RGNDATA* pDirtyRegion) PURE;
STDMETHOD(GetBackBuffer)(THIS_ UINT iSwapChain,UINT iBackBuffer,D3DBACKBUFFER_TYPE Type,IDirect3DSurface9** ppBackBuffer) PURE;
STDMETHOD(GetRasterStatus)(THIS_ UINT iSwapChain,D3DRASTER_STATUS* pRasterStatus) PURE;
STDMETHOD(SetDialogBoxMode)(THIS_ BOOL bEnableDialogs) PURE;
STDMETHOD_(void, SetGammaRamp)(THIS_ UINT iSwapChain,DWORD Flags,CONST D3DGAMMARAMP* pRamp) PURE;
STDMETHOD_(void, GetGammaRamp)(THIS_ UINT iSwapChain,D3DGAMMARAMP* pRamp) PURE;
STDMETHOD(CreateTexture)(THIS_ UINT Width,UINT Height,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DTexture9** ppTexture,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateVolumeTexture)(THIS_ UINT Width,UINT Height,UINT Depth,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DVolumeTexture9** ppVolumeTexture,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateCubeTexture)(THIS_ UINT EdgeLength,UINT Levels,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DCubeTexture9** ppCubeTexture,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateVertexBuffer)(THIS_ UINT Length,DWORD Usage,DWORD FVF,D3DPOOL Pool,IDirect3DVertexBuffer9** ppVertexBuffer,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateIndexBuffer)(THIS_ UINT Length,DWORD Usage,D3DFORMAT Format,D3DPOOL Pool,IDirect3DIndexBuffer9** ppIndexBuffer,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateRenderTarget)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Lockable,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
STDMETHOD(CreateDepthStencilSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DMULTISAMPLE_TYPE MultiSample,DWORD MultisampleQuality,BOOL Discard,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
STDMETHOD(UpdateSurface)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestinationSurface,CONST POINT* pDestPoint) PURE;
STDMETHOD(UpdateTexture)(THIS_ IDirect3DBaseTexture9* pSourceTexture,IDirect3DBaseTexture9* pDestinationTexture) PURE;
STDMETHOD(GetRenderTargetData)(THIS_ IDirect3DSurface9* pRenderTarget,IDirect3DSurface9* pDestSurface) PURE;
STDMETHOD(GetFrontBufferData)(THIS_ UINT iSwapChain,IDirect3DSurface9* pDestSurface) PURE;
STDMETHOD(StretchRect)(THIS_ IDirect3DSurface9* pSourceSurface,CONST RECT* pSourceRect,IDirect3DSurface9* pDestSurface,CONST RECT* pDestRect,D3DTEXTUREFILTERTYPE Filter) PURE;
STDMETHOD(ColorFill)(THIS_ IDirect3DSurface9* pSurface,CONST RECT* pRect,D3DCOLOR color) PURE;
STDMETHOD(CreateOffscreenPlainSurface)(THIS_ UINT Width,UINT Height,D3DFORMAT Format,D3DPOOL Pool,IDirect3DSurface9** ppSurface,HANDLE* pSharedHandle) PURE;
STDMETHOD(SetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9* pRenderTarget) PURE;
STDMETHOD(GetRenderTarget)(THIS_ DWORD RenderTargetIndex,IDirect3DSurface9** ppRenderTarget) PURE;
STDMETHOD(SetDepthStencilSurface)(THIS_ IDirect3DSurface9* pNewZStencil) PURE;
STDMETHOD(GetDepthStencilSurface)(THIS_ IDirect3DSurface9** ppZStencilSurface) PURE;
STDMETHOD(BeginScene)(THIS) PURE;
STDMETHOD(EndScene)(THIS) PURE;
STDMETHOD(Clear)(THIS_ DWORD Count,CONST D3DRECT* pRects,DWORD Flags,D3DCOLOR Color,float Z,DWORD Stencil) PURE;
STDMETHOD(SetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,CONST D3DMATRIX* pMatrix) PURE;
STDMETHOD(GetTransform)(THIS_ D3DTRANSFORMSTATETYPE State,D3DMATRIX* pMatrix) PURE;
STDMETHOD(MultiplyTransform)(THIS_ D3DTRANSFORMSTATETYPE,CONST D3DMATRIX*) PURE;
STDMETHOD(SetViewport)(THIS_ CONST D3DVIEWPORT9* pViewport) PURE;
STDMETHOD(GetViewport)(THIS_ D3DVIEWPORT9* pViewport) PURE;
STDMETHOD(SetMaterial)(THIS_ CONST D3DMATERIAL9* pMaterial) PURE;
STDMETHOD(GetMaterial)(THIS_ D3DMATERIAL9* pMaterial) PURE;
STDMETHOD(SetLight)(THIS_ DWORD Index,CONST D3DLIGHT9*) PURE;
STDMETHOD(GetLight)(THIS_ DWORD Index,D3DLIGHT9*) PURE;
STDMETHOD(LightEnable)(THIS_ DWORD Index,BOOL Enable) PURE;
STDMETHOD(GetLightEnable)(THIS_ DWORD Index,BOOL* pEnable) PURE;
STDMETHOD(SetClipPlane)(THIS_ DWORD Index,CONST float* pPlane) PURE;
STDMETHOD(GetClipPlane)(THIS_ DWORD Index,float* pPlane) PURE;
STDMETHOD(SetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD Value) PURE;
STDMETHOD(GetRenderState)(THIS_ D3DRENDERSTATETYPE State,DWORD* pValue) PURE;
STDMETHOD(CreateStateBlock)(THIS_ D3DSTATEBLOCKTYPE Type,IDirect3DStateBlock9** ppSB) PURE;
STDMETHOD(BeginStateBlock)(THIS) PURE;
STDMETHOD(EndStateBlock)(THIS_ IDirect3DStateBlock9** ppSB) PURE;
STDMETHOD(SetClipStatus)(THIS_ CONST D3DCLIPSTATUS9* pClipStatus) PURE;
STDMETHOD(GetClipStatus)(THIS_ D3DCLIPSTATUS9* pClipStatus) PURE;
STDMETHOD(GetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9** ppTexture) PURE;
STDMETHOD(SetTexture)(THIS_ DWORD Stage,IDirect3DBaseTexture9* pTexture) PURE;
STDMETHOD(GetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD* pValue) PURE;
STDMETHOD(SetTextureStageState)(THIS_ DWORD Stage,D3DTEXTURESTAGESTATETYPE Type,DWORD Value) PURE;
STDMETHOD(GetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD* pValue) PURE;
STDMETHOD(SetSamplerState)(THIS_ DWORD Sampler,D3DSAMPLERSTATETYPE Type,DWORD Value) PURE;
STDMETHOD(ValidateDevice)(THIS_ DWORD* pNumPasses) PURE;
STDMETHOD(SetPaletteEntries)(THIS_ UINT PaletteNumber,CONST PALETTEENTRY* pEntries) PURE;
STDMETHOD(GetPaletteEntries)(THIS_ UINT PaletteNumber,PALETTEENTRY* pEntries) PURE;
STDMETHOD(SetCurrentTexturePalette)(THIS_ UINT PaletteNumber) PURE;
STDMETHOD(GetCurrentTexturePalette)(THIS_ UINT *PaletteNumber) PURE;
STDMETHOD(SetScissorRect)(THIS_ CONST RECT* pRect) PURE;
STDMETHOD(GetScissorRect)(THIS_ RECT* pRect) PURE;
STDMETHOD(SetSoftwareVertexProcessing)(THIS_ BOOL bSoftware) PURE;
STDMETHOD_(BOOL, GetSoftwareVertexProcessing)(THIS) PURE;
STDMETHOD(SetNPatchMode)(THIS_ float nSegments) PURE;
STDMETHOD_(float, GetNPatchMode)(THIS) PURE;
STDMETHOD(DrawPrimitive)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT StartVertex,UINT PrimitiveCount) PURE;
STDMETHOD(DrawIndexedPrimitive)(THIS_ D3DPRIMITIVETYPE,INT BaseVertexIndex,UINT MinVertexIndex,UINT NumVertices,UINT startIndex,UINT primCount) PURE;
STDMETHOD(DrawPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT PrimitiveCount,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
STDMETHOD(DrawIndexedPrimitiveUP)(THIS_ D3DPRIMITIVETYPE PrimitiveType,UINT MinVertexIndex,UINT NumVertices,UINT PrimitiveCount,CONST void* pIndexData,D3DFORMAT IndexDataFormat,CONST void* pVertexStreamZeroData,UINT VertexStreamZeroStride) PURE;
STDMETHOD(ProcessVertices)(THIS_ UINT SrcStartIndex,UINT DestIndex,UINT VertexCount,IDirect3DVertexBuffer9* pDestBuffer,IDirect3DVertexDeclaration9* pVertexDecl,DWORD Flags) PURE;
STDMETHOD(CreateVertexDeclaration)(THIS_ CONST D3DVERTEXELEMENT9* pVertexElements,IDirect3DVertexDeclaration9** ppDecl) PURE;
STDMETHOD(SetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9* pDecl) PURE;
STDMETHOD(GetVertexDeclaration)(THIS_ IDirect3DVertexDeclaration9** ppDecl) PURE;
STDMETHOD(SetFVF)(THIS_ DWORD FVF) PURE;
STDMETHOD(GetFVF)(THIS_ DWORD* pFVF) PURE;
STDMETHOD(CreateVertexShader)(THIS_ CONST DWORD* pFunction,IDirect3DVertexShader9** ppShader) PURE;
STDMETHOD(SetVertexShader)(THIS_ IDirect3DVertexShader9* pShader) PURE;
STDMETHOD(GetVertexShader)(THIS_ IDirect3DVertexShader9** ppShader) PURE;
STDMETHOD(SetVertexShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE;
STDMETHOD(GetVertexShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE;
STDMETHOD(SetVertexShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE;
STDMETHOD(GetVertexShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE;
STDMETHOD(SetVertexShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE;
STDMETHOD(GetVertexShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
STDMETHOD(SetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9* pStreamData,UINT OffsetInBytes,UINT Stride) PURE;
STDMETHOD(GetStreamSource)(THIS_ UINT StreamNumber,IDirect3DVertexBuffer9** ppStreamData,UINT* pOffsetInBytes,UINT* pStride) PURE;
STDMETHOD(SetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT Setting) PURE;
STDMETHOD(GetStreamSourceFreq)(THIS_ UINT StreamNumber,UINT* pSetting) PURE;
STDMETHOD(SetIndices)(THIS_ IDirect3DIndexBuffer9* pIndexData) PURE;
STDMETHOD(GetIndices)(THIS_ IDirect3DIndexBuffer9** ppIndexData) PURE;
STDMETHOD(CreatePixelShader)(THIS_ CONST DWORD* pFunction,IDirect3DPixelShader9** ppShader) PURE;
STDMETHOD(SetPixelShader)(THIS_ IDirect3DPixelShader9* pShader) PURE;
STDMETHOD(GetPixelShader)(THIS_ IDirect3DPixelShader9** ppShader) PURE;
STDMETHOD(SetPixelShaderConstantF)(THIS_ UINT StartRegister,CONST float* pConstantData,UINT Vector4fCount) PURE;
STDMETHOD(GetPixelShaderConstantF)(THIS_ UINT StartRegister,float* pConstantData,UINT Vector4fCount) PURE;
STDMETHOD(SetPixelShaderConstantI)(THIS_ UINT StartRegister,CONST int* pConstantData,UINT Vector4iCount) PURE;
STDMETHOD(GetPixelShaderConstantI)(THIS_ UINT StartRegister,int* pConstantData,UINT Vector4iCount) PURE;
STDMETHOD(SetPixelShaderConstantB)(THIS_ UINT StartRegister,CONST BOOL* pConstantData,UINT BoolCount) PURE;
STDMETHOD(GetPixelShaderConstantB)(THIS_ UINT StartRegister,BOOL* pConstantData,UINT BoolCount) PURE;
STDMETHOD(DrawRectPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DRECTPATCH_INFO* pRectPatchInfo) PURE;
STDMETHOD(DrawTriPatch)(THIS_ UINT Handle,CONST float* pNumSegs,CONST D3DTRIPATCH_INFO* pTriPatchInfo) PURE;
STDMETHOD(DeletePatch)(THIS_ UINT Handle) PURE;
STDMETHOD(CreateQuery)(THIS_ D3DQUERYTYPE Type,IDirect3DQuery9** ppQuery) PURE;
// Create vtable offsets
#undef STDMETHOD
#define STDMETHOD(method) PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), method),
#undef STDMETHOD_
#define STDMETHOD_(type,method) PPCAT(PPCAT(PPCAT(vt, INTERFACE),_), method),
enum PPCAT(vt, INTERFACE)
{
// 1:1 copy from d3d9.h: replace (THIS* -> ""
STDMETHOD(QueryInterface)
STDMETHOD_(ULONG,AddRef)
STDMETHOD_(ULONG,Release)
STDMETHOD(TestCooperativeLevel)
STDMETHOD_(UINT, GetAvailableTextureMem)
STDMETHOD(EvictManagedResources)
STDMETHOD(GetDirect3D)
STDMETHOD(GetDeviceCaps)
STDMETHOD(GetDisplayMode)
STDMETHOD(GetCreationParameters)
STDMETHOD(SetCursorProperties)
STDMETHOD_(void, SetCursorPosition)
STDMETHOD_(BOOL, ShowCursor)
STDMETHOD(CreateAdditionalSwapChain)
STDMETHOD(GetSwapChain)
STDMETHOD_(UINT, GetNumberOfSwapChains)
STDMETHOD(Reset)
STDMETHOD(Present)
STDMETHOD(GetBackBuffer)
STDMETHOD(GetRasterStatus)
STDMETHOD(SetDialogBoxMode)
STDMETHOD_(void, SetGammaRamp)
STDMETHOD_(void, GetGammaRamp)
STDMETHOD(CreateTexture)
STDMETHOD(CreateVolumeTexture)
STDMETHOD(CreateCubeTexture)
STDMETHOD(CreateVertexBuffer)
STDMETHOD(CreateIndexBuffer)
STDMETHOD(CreateRenderTarget)
STDMETHOD(CreateDepthStencilSurface)
STDMETHOD(UpdateSurface)
STDMETHOD(UpdateTexture)
STDMETHOD(GetRenderTargetData)
STDMETHOD(GetFrontBufferData)
STDMETHOD(StretchRect)
STDMETHOD(ColorFill)
STDMETHOD(CreateOffscreenPlainSurface)
STDMETHOD(SetRenderTarget)
STDMETHOD(GetRenderTarget)
STDMETHOD(SetDepthStencilSurface)
STDMETHOD(GetDepthStencilSurface)
STDMETHOD(BeginScene)
STDMETHOD(EndScene)
STDMETHOD(Clear)
STDMETHOD(SetTransform)
STDMETHOD(GetTransform)
STDMETHOD(MultiplyTransform)
STDMETHOD(SetViewport)
STDMETHOD(GetViewport)
STDMETHOD(SetMaterial)
STDMETHOD(GetMaterial)
STDMETHOD(SetLight)
STDMETHOD(GetLight)
STDMETHOD(LightEnable)
STDMETHOD(GetLightEnable)
STDMETHOD(SetClipPlane)
STDMETHOD(GetClipPlane)
STDMETHOD(SetRenderState)
STDMETHOD(GetRenderState)
STDMETHOD(CreateStateBlock)
STDMETHOD(BeginStateBlock)
STDMETHOD(EndStateBlock)
STDMETHOD(SetClipStatus)
STDMETHOD(GetClipStatus)
STDMETHOD(GetTexture)
STDMETHOD(SetTexture)
STDMETHOD(GetTextureStageState)
STDMETHOD(SetTextureStageState)
STDMETHOD(GetSamplerState)
STDMETHOD(SetSamplerState)
STDMETHOD(ValidateDevice)
STDMETHOD(SetPaletteEntries)
STDMETHOD(GetPaletteEntries)
STDMETHOD(SetCurrentTexturePalette)
STDMETHOD(GetCurrentTexturePalette)
STDMETHOD(SetScissorRect)
STDMETHOD(GetScissorRect)
STDMETHOD(SetSoftwareVertexProcessing)
STDMETHOD_(BOOL, GetSoftwareVertexProcessing)
STDMETHOD(SetNPatchMode)
STDMETHOD_(float, GetNPatchMode)
STDMETHOD(DrawPrimitive)
STDMETHOD(DrawIndexedPrimitive)
STDMETHOD(DrawPrimitiveUP)
STDMETHOD(DrawIndexedPrimitiveUP)
STDMETHOD(ProcessVertices)
STDMETHOD(CreateVertexDeclaration)
STDMETHOD(SetVertexDeclaration)
STDMETHOD(GetVertexDeclaration)
STDMETHOD(SetFVF)
STDMETHOD(GetFVF)
STDMETHOD(CreateVertexShader)
STDMETHOD(SetVertexShader)
STDMETHOD(GetVertexShader)
STDMETHOD(SetVertexShaderConstantF)
STDMETHOD(GetVertexShaderConstantF)
STDMETHOD(SetVertexShaderConstantI)
STDMETHOD(GetVertexShaderConstantI)
STDMETHOD(SetVertexShaderConstantB)
STDMETHOD(GetVertexShaderConstantB)
STDMETHOD(SetStreamSource)
STDMETHOD(GetStreamSource)
STDMETHOD(SetStreamSourceFreq)
STDMETHOD(GetStreamSourceFreq)
STDMETHOD(SetIndices)
STDMETHOD(GetIndices)
STDMETHOD(CreatePixelShader)
STDMETHOD(SetPixelShader)
STDMETHOD(GetPixelShader)
STDMETHOD(SetPixelShaderConstantF)
STDMETHOD(GetPixelShaderConstantF)
STDMETHOD(SetPixelShaderConstantI)
STDMETHOD(GetPixelShaderConstantI)
STDMETHOD(SetPixelShaderConstantB)
STDMETHOD(GetPixelShaderConstantB)
STDMETHOD(DrawRectPatch)
STDMETHOD(DrawTriPatch)
STDMETHOD(DeletePatch)
STDMETHOD(CreateQuery)
};
关于c++ - Direct3D9 EndScene 钩子(Hook)渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8737129/
在JSON输出中,“步骤”中有一个字段“maneuver”。在此“向左转”,“向右转”,“向左转轻微”等。示例为here 在哪里可以找到“操纵”字段的定义以及可能的值列表?没有相关描述here 提前致
默认情况下,我们如何从Google Direction API建议的替代 route 获得从A点到B点的最短距离路线?默认情况下,它会根据当前交通状况为我们提供最短持续时间的路线。我已经注意到,如果您
我想知道“precompile(r) directive”和“preprocessor directive”是一回事吗?我对前者不熟悉,但只是听说过,并通过这个Google在互联网上找到了一些关于它的
对于我的项目,我目前正在开发自定义表单/输入指令。 例如,我有以下指令: angular.module('myApp').directive("textField", function() {
我用谷歌搜索了一下,但找不到任何详细说明如何制作动态包装内容的 Angular 指令的内容(例如 http://demos.telerik.com/kendo-ui/panelbar/angular
我正在尝试在另一个指令中使用一个指令。具体来说,我有一个模态指令,我想传递一个表单指令,并将充当模态的主体。 我的模态指令: angular.module('Storyboard').dir
我构建了一个模块化形式的小型演示,其中包含单独的输入指令。它还可以预览绑定(bind)到相同 Controller 和范围的表单值。 导致问题的输入指令是嵌入到表单内的输入:
HTML 指令 .directive('authorname', function() { return { restrict: 'E', scope: {
我有可以编译的 Angular 指令 至和 至Hello World! 我怎样才能把greeting在我的 HTML 中标记并将其编译为 print-greeting然后最后显示Hello World
标题中引用的脚注是什么意思?这是 6.10.3p11 的脚注 If there are sequences of preprocessing tokens within the list of arg
因此,电话号码始终是 ltr(从左到右)。 在多语言网站上工作,我需要在方向为 rtl 的文本段落中插入一个电话号码(带有“+”前缀和由“-”分隔的数字)(当然是针对相关语言) 所以我有这样的东西:
我有一个标题元素,我想显示 flex 列,这样我就可以将 .container div 垂直居中。这工作正常。然后我需要 .container 中的元素在 1200px 之间以均匀的间距连续 flex
如何将整个ng-repeat对象传递给指令(或如何将指令的作用域设置为ng-repeat项)? 我是新来的有角度的人,很难解决这个问题。 我有一个 Controller ,可以很好地呈现以下内容:
我需要将“...”放在文本前面,并在填充 div 时仅显示文本的最后一部分。 正常时不执行任何操作 C:\fakepath\996571_1398802860346752_209456547
我需要将“...”放在文本的前面,并且只显示它的最后一部分,当它填充 div 时。 正常的时候什么也不做 C:\fakepath\996571_1398802860346752_209456
我需要一个“粘性”指令,当它位于页面顶部时向元素添加一个 css 类,并且还指示其状态的变化。出于这个原因,我定义了一个范围,如 { onStickyChange: '&' }。现在我想在 angul
我对 ngSwitch 指令有点困惑——它是“属性指令”还是“结构指令”。 属性指令用“方括号”编写,如 [ngStyle]、[ngClass] 等(我们将其写为 [ngSwitch],将其称为“属性
Wi-Fi direct 的 Wiki 规范声称“只有一个 Wi-Fi 设备需要兼容 Wi-Fi Direct 才能建立点对点连接,在彼此之间直接传输数据,大大减少了设置”。但是从 android A
我有一个响应式模板,我正尝试将其与我的 Angularjs 应用程序一起使用。这也是我的第一个 Angular 应用程序,所以我知道我在未来有很多错误和重构。 我已经阅读了足够多的关于 Angular
首先,我这样做的方式可能不正确。但我会解释这个问题: 1) 我正在创建名为 的指令 2) 当点击第一个指令中的按钮时,我试图在运行时动态插入第二个指令 如下: var app = angu
我是一名优秀的程序员,十分优秀!