コード例 #1
0
        public VertexDeclarationBase Create(PPDDevice device, Effect.EffectBase effect)
        {
            var elements = new VertexElement[] {
                new VertexElement(0, 0, DeclarationType.Float3, DeclarationMethod.Default, DeclarationUsage.Position, 0),
                new VertexElement(0, 12, DeclarationType.Color, DeclarationMethod.Default, DeclarationUsage.Color, 0),
                new VertexElement(0, 16, DeclarationType.Float2, DeclarationMethod.Default, DeclarationUsage.TextureCoordinate, 0),
                VertexElement.VertexDeclarationEnd
            };

            return(new VertexDeclaration(new SharpDX.Direct3D9.VertexDeclaration((SharpDX.Direct3D9.Device)((PPDFramework.DX9.PPDDevice)device).Device, elements)));
        }
コード例 #2
0
        public VertexDeclarationBase Create(PPDDevice device, Effect.EffectBase effect)
        {
            var layout = new InputLayout((SharpDX.Direct3D11.Device)((PPDFramework.DX11.PPDDevice)device).Device, ((PPDFramework.Effect.DX11.Effect)effect).ShaderBytecode, new[]
            {
                new InputElement("Position", 0, Format.R32G32B32A32_Float, 0, 0),
                new InputElement("Color", 0, Format.R8G8B8A8_UNorm, 12, 0),
                new InputElement("TexCoord", 0, Format.R32G32_Float, 16, 0)
            });

            return(new VertexDeclaration(layout));
        }
コード例 #3
0
ファイル: SpriteBatch.cs プロジェクト: KHCmaster/PPD
        public SpriteBatch(PPDDevice device)
        {
            this.device        = device;
            effect             = EffectFactoryManager.Factory.FromMemory(device, device.GetShaderBytecode("BasicEffect"));
            textureHandle      = effect.GetParameter("Texture");
            overlayColorHandle = effect.GetParameter("OverlayColor");
            projectionHandle   = effect.GetParameter("Projection");
            effect.SetValue(projectionHandle, device.Projection);

            vertices          = Vertex.VertexBufferFactoryManager.Factory.Create(device, _vertices.Length * ColoredTexturedVertex.Size);
            indices           = Vertex.IndexBufferFactoryManager.Factory.Create(device, _indices.Length * sizeof(int));
            spriteInfos       = new List <SpriteInfo>();
            scissorRectStates = new List <ScissorRectState>();
            techniques        = new Dictionary <bool, string>
            {
                { false, "BasicEffectPADisabled" },
                { true, "BasicEffectPAEnabled" }
            };
        }
コード例 #4
0
ファイル: SpriteBatch.cs プロジェクト: KHCmaster/PPD
 protected override void DisposeResource()
 {
     base.DisposeResource();
     if (textureHandle != null)
     {
         textureHandle.Dispose();
         textureHandle = null;
     }
     if (overlayColorHandle != null)
     {
         overlayColorHandle.Dispose();
         overlayColorHandle = null;
     }
     if (effect != null)
     {
         effect.Dispose();
         effect = null;
     }
 }
コード例 #5
0
 public virtual void DrawBuffer(Buffer.VertexBufferBase vb, Effect.EffectBase eb)
 {
 }