2016-11-01 88 views
0

コード全体が非常に長いです。 ここでは、関連する行だけをここに追加します。フォームの上部にMicrosoft.DirectX.Direct3D.Deviceでエラーが発生するのはなぜですか?

private Device D3Ddev = null; 

デバイスは次にMicrosoft.DirectX.Direct3D.Device

ある:

private Boolean InitializeDirectX() 
     { 

       DispMode = Manager.Adapters[Manager.Adapters.Default.Adapter].CurrentDisplayMode; 
       D3Dpp = new PresentParameters(); 
       D3Dpp.BackBufferFormat = DispMode.Format; 
       D3Dpp.PresentFlag = PresentFlag.LockableBackBuffer; 

       D3Dpp.SwapEffect = SwapEffect.Discard; 
       D3Dpp.PresentationInterval = PresentInterval.One; //wait for vertical sync. Synchronizes the painting with 
       //monitor refresh rate for smoooth animation 
       D3Dpp.Windowed = true; //the application has borders 

      try 
      { 
       D3Ddev = new Device(Manager.Adapters.Default.Adapter, DeviceType.Hardware, pictureBox1.Handle, 
                      CreateFlags.SoftwareVertexProcessing, D3Dpp); 
       D3Ddev.VertexFormat = CustomVertex.PositionColored.Format; 
       D3Ddev.RenderState.Lighting = false; 
       D3Ddev.RenderState.CullMode = Cull.CounterClockwise; 

       backTexture = TextureLoader.FromStream(D3Ddev, mymem); 
       scannedCloudsTexture = new Texture(D3Ddev, 512, 512, 1, Usage.Dynamic, Format.A8R8G8B8, Pool.Default); 

       //sprite is used to draw the texture 
       D3Dsprite = new Sprite(D3Ddev); 

       return true; 
      } 
      catch 
      { 
       Logger.Write("error"); 
       return false; 
      } 
     } 

エラーがライン上にある:

D3Ddev.VertexFormat = CustomVertex.PositionColored.Format; 

オンザフォーマット。

重大度コード説明プロジェクトファイルの行の抑制状態 エラーCS0012タイプは「IsConstModifier」参照されていないアセンブリで定義されています。アセンブリ 'Microsoft.VisualC、Version = 7.0.5000.0、Culture = neutral、PublicKeyToken = b03f5f7f11d50a3a'への参照を追加する必要があります。 DopplerEffect.cs 467 Active

+0

マネージドDirectXのライブラリは非常に、非常に古いですし、.NET 2.0が出荷直前に中止されました。 Microsoftはもはやそれをサポートしたがっていませんでした。それは素晴らしいライブラリだったからではありませんでした。あなたは依存関係がなくなり、Visual Studio 2002に戻ります。SharpDXやSlimDXのようなこのライブラリのオープンソースの代替案を手に入れましょう。 –

答えて

0

「Microsoft.VisualC」アセンブリへの参照を追加する必要があります。

どこかで検索 "C:\ WINDOWS \ Microsoft.NET \ Frameworkの\ v2.0.50727ののの\ Microsoft.VisualC.dll"

関連する問題