Beispiel #1
0
        public PresentHook(CppObject swapChain)
        {
            _presentHook = new FunctionHook <Present>(
                VirtualTableAddress.GetVtableAddress(swapChain.NativePointer, (int)VirtualTableIndices.DxgiSwapChain.Present),
                new Present(OnPresent),
                this);

            // This is not the SwapChain we're looking for...
            swapChain.Dispose();

            _presentHook.Activate();
        }
        public DrawIndexedHook(DeviceContext deviceContext, DepthStencilState depthDisabledState, Shaders shaders)
        {
            _deviceContext      = deviceContext;
            _depthDisabledState = depthDisabledState;
            _shaders            = shaders;
            _modelsInScene      = new List <ModelInfo>();
            SavedModels         = new List <ModelInfo>();

            _drawIndexedHook = new FunctionHook <DrawIndexed>(
                VirtualTableAddress.GetVtableAddress(_deviceContext.NativePointer, (int)VirtualTableIndices.D3D11DeviceContext.DrawIndexed),
                new DrawIndexed(OnDrawIndexed),
                this);

            _drawIndexedHook.Activate();
        }