Пример #1
0
        public static void Decompile(string sFileName)
        {
            Initialize();

            ID3DXEffect *pD3DEffect    = null;
            ID3DXBuffer *pD3DError     = null;
            ID3DXBuffer *pDisassembler = null;

            D3DXCreateEffectFromFile(g_D3DDevice, sFileName, IntPtr.Zero, IntPtr.Zero, 0, IntPtr.Zero, &pD3DEffect, &pD3DError);
            D3DXDisassembleEffect(pD3DEffect, false, &pDisassembler);

            var sShaderSource = Marshal.PtrToStringAnsi(ID3DXBuffer_GetBufferPointer(pDisassembler));

            var sOutFile = Common.OutputPath + "/Shaders/mb.fx";

            if (!Directory.Exists(Common.OutputPath + "/Shaders"))
            {
                Directory.CreateDirectory(Common.OutputPath + "/Shaders");
            }
            Win32FileWriter.WriteAllText(sOutFile, Header.Shaders + sShaderSource);

            Release();
        }
Пример #2
0
 private static extern int D3DXDisassembleEffect(
     ID3DXEffect *pEffect,
     [MarshalAs(UnmanagedType.Bool)] bool EnableColorCode,
     ID3DXBuffer **ppDisassembly
     );
Пример #3
0
 public unsafe Effect(ID3DXEffect *pData, Device device) : base((ID3DXBaseEffect *)pData)
 {
     throw new NotImplementedException();
 }
Пример #4
0
 public unsafe void UpdateUnmanagedPointer(ID3DXEffect *pInterface)
 {
     throw new NotImplementedException();
 }
Пример #5
0
 public unsafe Effect(ID3DXEffect *pInterop) : base(null)
 {
     throw new NotImplementedException();
 }