コード例 #1
0
ファイル: GPT.cs プロジェクト: frank-weindel/Open3dmm
        public void RenderGPT(GPT gptSrc, RECTANGLE dest, RECTANGLE clip)
        {
            var _dest = new Rectangle(dest.X1, dest.Y1, dest.Width, dest.Height);
            var _clip = new Rectangle(clip.X1, clip.Y1, clip.Width, clip.Height);

            RenderTexture(tex, _dest, _clip);
        }
コード例 #2
0
ファイル: GPT.cs プロジェクト: frank-weindel/Open3dmm
        public void Blit(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch, GPT other, RECTANGLE src, RECTANGLE dest)
        {
            var otherTex = other.GetTexture(graphicsDevice);

            if (renderTarget == null)
            {
                renderTarget = new RenderTarget2D(graphicsDevice, 640, 480, true, SurfaceFormat.Bgra32SRgb, DepthFormat.None);
            }
            graphicsDevice.SetRenderTarget(renderTarget);
            unsafe
            {
                var _dest = *(Rectangle *)&dest;
                _dest.Width  -= _dest.X;
                _dest.Height -= _dest.Y;
                var _src = *(Rectangle *)&src;
                _src.Width  -= _src.X;
                _src.Height -= _src.Y;
                spriteBatch.Draw(otherTex, _dest, _src, Color.White);
            }
            graphicsDevice.SetRenderTarget(null);
        }