Ejemplo n.º 1
0
        FilterProgram BuildDefaultChain(Size chain_insize, Size chain_outsize, bool includeOSD)
        {
            //select user special FX shader chain
            Dictionary <string, object> selectedChainProperties = new Dictionary <string, object>();

            BizHawk.Client.EmuHawk.Filters.RetroShaderChain selectedChain = null;

            if (Global.Config.TargetDisplayFilter == 3 && ShaderChain_user != null && ShaderChain_user.Available)
            {
                selectedChain = ShaderChain_user;
            }

            BizHawk.Client.EmuHawk.Filters.FinalPresentation fPresent = new BizHawk.Client.EmuHawk.Filters.FinalPresentation(chain_outsize);
            BizHawk.Client.EmuHawk.Filters.SourceImage       fInput   = new BizHawk.Client.EmuHawk.Filters.SourceImage(chain_insize);
            BizHawk.Client.EmuHawk.Filters.OSD fOSD = new BizHawk.Client.EmuHawk.Filters.OSD();
            fOSD.RenderCallback = () =>
            {
                if (!includeOSD)
                {
                    return;
                }
                var size = fOSD.FindInput().SurfaceFormat.Size;
                Renderer.Begin(size.Width, size.Height);
                Renderer.SetBlendState(GL.BlendNormal);
                Renderer.End();
            };

            var chain = new FilterProgram();

            //add the first filter, encompassing output from the emulator core
            chain.AddFilter(fInput, "input");

            //choose final filter
            BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.None;
            if (Global.Config.DispFinalFilter == 1)
            {
                finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.Bilinear;
            }
            if (Global.Config.DispFinalFilter == 2)
            {
                finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.Bicubic;
            }

            finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.None;

            fPresent.FilterOption = finalFilter;

            //add final presentation
            chain.AddFilter(fPresent, "presentation");

            return(chain);
        }
Ejemplo n.º 2
0
		FilterProgram BuildDefaultChain(Size chain_insize, Size chain_outsize, bool includeOSD)
		{
			//select user special FX shader chain
			Dictionary<string, object> selectedChainProperties = new Dictionary<string, object>();
			BizHawk.Client.EmuHawk.Filters.RetroShaderChain selectedChain = null;

			if (Global.Config.TargetDisplayFilter == 3 && ShaderChain_user != null && ShaderChain_user.Available)
				selectedChain = ShaderChain_user;

			BizHawk.Client.EmuHawk.Filters.FinalPresentation fPresent = new BizHawk.Client.EmuHawk.Filters.FinalPresentation(chain_outsize);
			BizHawk.Client.EmuHawk.Filters.SourceImage fInput = new BizHawk.Client.EmuHawk.Filters.SourceImage(chain_insize);
			BizHawk.Client.EmuHawk.Filters.OSD fOSD = new BizHawk.Client.EmuHawk.Filters.OSD();
			fOSD.RenderCallback = () =>
			{
				if (!includeOSD)
					return;
				var size = fOSD.FindInput().SurfaceFormat.Size;
				Renderer.Begin(size.Width, size.Height);
				Renderer.SetBlendState(GL.BlendNormal);
				Renderer.End();
			};

			var chain = new FilterProgram();

			//add the first filter, encompassing output from the emulator core
			chain.AddFilter(fInput, "input");

			//choose final filter
			BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.None;
			if (Global.Config.DispFinalFilter == 1) finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.Bilinear;
			if (Global.Config.DispFinalFilter == 2) finalFilter = BizHawk.Client.EmuHawk.Filters.FinalPresentation.eFilterOption.Bicubic;

			fPresent.FilterOption = finalFilter;

			//add final presentation 
			chain.AddFilter(fPresent, "presentation");

			return chain;
		}