Пример #1
0
 private void BuildCCallbackBase()
 {
     this.VTable = new CCallbackBaseVTable
     {
         m_RunCallResult        = new CCallbackBaseVTable.RunCRDel(this.OnRunCallResult),
         m_RunCallback          = new CCallbackBaseVTable.RunCBDel(this.OnRunCallback),
         m_GetCallbackSizeBytes = new CCallbackBaseVTable.GetCallbackSizeBytesDel(this.OnGetCallbackSizeBytes)
     };
     this.m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable)));
     Marshal.StructureToPtr(this.VTable, this.m_pVTable, false);
     this.m_CCallbackBase = new CCallbackBase
     {
         m_vfptr          = this.m_pVTable,
         m_nCallbackFlags = 0,
         m_iCallback      = CallbackIdentities.GetCallbackIdentity(typeof(T))
     };
     this.m_pCCallbackBase = GCHandle.Alloc(this.m_CCallbackBase, GCHandleType.Pinned);
 }
        // Steamworks.NET Specific
        private void BuildCCallbackBase()
        {
            VTable = new CCallbackBaseVTable()
            {
                m_RunCallback          = OnRunCallback,
                m_RunCallResult        = OnRunCallResult,
                m_GetCallbackSizeBytes = OnGetCallbackSizeBytes
            };
            m_pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable)));
            Marshal.StructureToPtr(VTable, m_pVTable, false);

            m_CCallbackBase = new CCallbackBase()
            {
                m_vfptr          = m_pVTable,
                m_nCallbackFlags = 0,
                m_iCallback      = CallbackIdentities.GetCallbackIdentity(typeof(T))
            };
            m_pCCallbackBase = GCHandle.Alloc(m_CCallbackBase, GCHandleType.Pinned);
        }
Пример #3
0
        // Steamworks.NET Specific
        private void BuildCCallbackBase()
        {
            _vTable = new CCallbackBaseVTable
            {
                RunCallback          = OnRunCallback,
                RunCallResult        = OnRunCallResult,
                GetCallbackSizeBytes = OnGetCallbackSizeBytes
            };
            _pVTable = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(CCallbackBaseVTable)));
            Marshal.StructureToPtr(_vTable, _pVTable, false);

            _callbackBase = new CallbackBase
            {
                VFPtr         = _pVTable,
                CallbackFlags = 0,
                Callback      = CallbackIdentities.GetCallbackIdentity(typeof(T))
            };
            _pCCallbackBase = GCHandle.Alloc(_callbackBase, GCHandleType.Pinned);
        }