コード例 #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();
        }
コード例 #2
0
        private void doTestTwo()
        {
            // Do the same as above, but show off alternative constructors
            CppObject    cpp = new CppObject(10);
            CSharpObject cs  = new CSharpObject(10000);

            cpp.increment(-5);
            cs.increment(-5000);

            // Also show off explicitly running destructor
            cpp.Dispose();
        }