コード例 #1
0
ファイル: Renderer.cs プロジェクト: lodossDev/xnamugen
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null) throw new ArgumentNullException("videosystem");

            m_videosystem = videosystem;

            using (IO.File effectfile = m_videosystem.GetSubSystem<IO.FileSystem>().OpenFile("xnaMugen.data.Shader.fx"))
            {
                CompiledEffect compiled = Effect.CompileEffectFromSource(effectfile.ReadToEnd(), null, null, CompilerOptions.None, TargetPlatform.Windows);
                if (compiled.Success == false)
                {
                    throw new InvalidOperationException("Cannot successfully create shader.");
                }

                m_effect = new Effect(Device, compiled.GetEffectCode(), CompilerOptions.NotCloneable, null);
            }

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection<String, EffectParameter>(x => x.Name);

            m_nullpixels = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            Byte[] pixels = new Byte[] { 1, 2, 1, 2 };
            m_nullpixels.SetData<Byte>(pixels);

            Color[] paldata = new Color[256];
            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData<Color>(paldata);
        }
コード例 #2
0
ファイル: Renderer.cs プロジェクト: nykevinwong/xnamugen-1
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException("videosystem");
            }

            m_videosystem = videosystem;

            using (IO.File effectfile = m_videosystem.GetSubSystem <IO.FileSystem>().OpenFile("xnaMugen.data.Shader.fx"))
            {
                CompiledEffect compiled = Effect.CompileEffectFromSource(effectfile.ReadToEnd(), null, null, CompilerOptions.None, TargetPlatform.Windows);
                if (compiled.Success == false)
                {
                    throw new InvalidOperationException("Cannot successfully create shader.");
                }

                m_effect = new Effect(Device, compiled.GetEffectCode(), CompilerOptions.NotCloneable, null);
            }

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection <String, EffectParameter>(x => x.Name);

            m_nullpixels  = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            Byte[] pixels = new Byte[] { 1, 2, 1, 2 };
            m_nullpixels.SetData <Byte>(pixels);

            Color[] paldata = new Color[256];
            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData <Color>(paldata);
        }
コード例 #3
0
ファイル: Renderer.cs プロジェクト: terrynoya/xnamugen-1
        public Renderer(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException(nameof(videosystem));
            }

            m_videosystem = videosystem;

            m_videosystem.SubSystems.Game.Content.RootDirectory = "data";
            m_effect = m_videosystem.SubSystems.Game.Content.Load <Effect>("bin/shader");

            m_drawbuffer = new Vertex[500];
            m_parameters = new KeyedCollection <string, EffectParameter>(x => x.Name);

            m_nullpixels  = m_videosystem.CreatePixelTexture(new Point(2, 2));
            m_nullpalette = m_videosystem.CreatePaletteTexture();

            var pixels = new byte[] { 1, 2, 1, 2 };

            m_nullpixels.SetData(pixels);

            var paldata = new Color[256];

            paldata[1] = Color.White;
            paldata[2] = Color.Red;
            m_nullpalette.SetData(paldata);
        }
コード例 #4
0
ファイル: DrawState.cs プロジェクト: lodossDev/xnamugen
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null) throw new ArgumentNullException("videosystem");

            m_videosystem = videosystem;
            m_mode = DrawMode.Normal;
            m_pixels = null;
            m_palette = null;
            m_scissorrect = Rectangle.Empty;
            m_blending = new Blending();
            m_drawdata = new List<DrawData>();
            m_scale = Vector2.One;
            m_axis = Vector2.Zero;
            m_flip = SpriteEffects.None;
            m_rotation = 0;
            m_offset = Vector2.Zero;
            m_stretch = Vector2.One;
            m_parameters = new ShaderParameters();
        }
コード例 #5
0
ファイル: DrawState.cs プロジェクト: xubingyue/xnamugen
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException("videosystem");
            }

            m_videosystem = videosystem;
            m_mode        = DrawMode.Normal;
            m_pixels      = null;
            m_palette     = null;
            m_scissorrect = Rectangle.Empty;
            m_blending    = new Blending();
            m_drawdata    = new List <DrawData>();
            m_scale       = Vector2.One;
            m_axis        = Vector2.Zero;
            m_flip        = SpriteEffects.None;
            m_rotation    = 0;
            m_offset      = Vector2.Zero;
            m_stretch     = Vector2.One;
            m_parameters  = new ShaderParameters();
        }
コード例 #6
0
        public DrawState(VideoSystem videosystem)
        {
            if (videosystem == null)
            {
                throw new ArgumentNullException(nameof(videosystem));
            }

            m_videosystem    = videosystem;
            Mode             = DrawMode.Normal;
            Pixels           = null;
            Palette          = null;
            ScissorRectangle = Rectangle.Empty;
            Blending         = new Blending();
            m_drawdata       = new List <DrawData>();
            Scale            = Vector2.One;
            Axis             = Vector2.Zero;
            Flip             = SpriteEffects.None;
            Rotation         = 0;
            Offset           = Vector2.Zero;
            Stretch          = Vector2.One;
            m_parameters     = new ShaderParameters();
        }