예제 #1
0
        public override void DrawLine(Point a, Point b, Color color)
        {
            mDevice.DrawBuffer.Flush();

            mLines[0] = new PositionColor(a.X, a.Y, 0, color.ToArgb());
            mLines[1] = new PositionColor(b.X, b.Y, 0, color.ToArgb());

            mDevice.SetDeviceStateTexture(null);
            mDevice.AlphaArgument1 = TextureArgument.Diffuse;

            mDevice.Device.VertexDeclaration = mPosColorDecl;
            mDevice.Device.DrawUserPrimitives(SlimDX.Direct3D9.PrimitiveType.LineList, 1, mLines);

            mDevice.AlphaArgument1 = TextureArgument.Texture;
        }
예제 #2
0
        public void Flush()
        {
            if (mVertPointer == 0)
            {
                return;
            }

            mDevice.SetDeviceStateTexture(mTexture);
            mDevice.AlphaBlend     = mAlphaBlend;
            mDevice.AlphaArgument1 = TextureArgument.Texture;
            mDevice.AlphaArgument2 = TextureArgument.Diffuse;
            mDevice.AlphaOperation = TextureOperation.Modulate;

            mDevice.SetVertexDeclarationForSurfaces();

            SDX_Display display = (SDX_Display)Display.Impl;

            DoDraw(null);

            mVertPointer  = 0;
            mIndexPointer = 0;
        }