Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace WoWSharp.WoW.Impl
  8. {
  9.     public class GxDevice
  10.     {
  11.  
  12.         public static GxDevice Instance
  13.         {
  14.             get
  15.             {
  16.                 IntPtr l_Instance = Memory.MemoryContext.Read<IntPtr>(Patchables.Offsets.GxDevice.g_theGxDevicePtr, true);
  17.  
  18.                 return l_Instance != IntPtr.Zero ? new GxDevice(l_Instance) : null;
  19.             }
  20.         }
  21.  
  22.         public enum RendererType : int
  23.         {
  24.             OpenGL,
  25.             Direct3D9,
  26.             Direct3D11,
  27.             GLL,
  28.             MTL
  29.         }
  30.  
  31.         public IntPtr Pointer { get; }
  32.  
  33.         public GxDevice(IntPtr p_Pointer)
  34.         {
  35.             Pointer = p_Pointer;
  36.         }
  37.  
  38.         public RendererType Type => Memory.MemoryContext.Read<RendererType>(Pointer + Patchables.Offsets.GxDevice.m_DeviceType);
  39.     }
  40.  
  41.     public class GxDeviceDirect3D9 : GxDevice
  42.     {
  43.  
  44.         public GxDeviceDirect3D9(IntPtr p_Pointer)
  45.             : base(p_Pointer)
  46.         {
  47.  
  48.         }
  49.  
  50.         public IntPtr DevicePointer => Memory.MemoryContext.Read<IntPtr>(Pointer + Patchables.Offsets.GxDeviceDirect3D9.m_pDevice);
  51.     }
  52.  
  53.     public class GxDeviceDirect3D11 : GxDevice
  54.     {
  55.  
  56.         public GxDeviceDirect3D11(IntPtr p_Pointer)
  57.             : base(p_Pointer)
  58.         {
  59.  
  60.         }
  61.  
  62.         public IntPtr SwapChainPointer => Memory.MemoryContext.Read<IntPtr>(Pointer + Patchables.Offsets.GxDeviceDirect3D11.m_pSwapChain);
  63.  
  64.         public IntPtr DevicePointer => Memory.MemoryContext.Read<IntPtr>(Pointer + Patchables.Offsets.GxDeviceDirect3D11.m_pDevice);
  65.  
  66.         public IntPtr DeviceContextPointer => Memory.MemoryContext.Read<IntPtr>(Pointer + Patchables.Offsets.GxDeviceDirect3D11.m_pDeviceContext);
  67.  
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement