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(); }
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(); }