Exemple #1
0
        public override void Run()
        {
            if (nop)
            {
                return;
            }

            GL.SetClearColor(Color.FromArgb(BackgroundColor));
            GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit);

            GuiRenderer.Begin(OutputSize.Width, OutputSize.Height);
            GuiRenderer.SetBlendState(GL.BlendNoneCopy);

            if (FilterOption != eFilterOption.None)
            {
                InputTexture.SetFilterLinear();
            }
            else
            {
                InputTexture.SetFilterNearest();
            }

            if (FilterOption == eFilterOption.Bicubic)
            {
            }


            GuiRenderer.Draw(InputTexture, LL.vx, LL.vy, LL.vw, LL.vh);

            GuiRenderer.End();
        }
Exemple #2
0
        public override void Run()
        {
            if (nop)
            {
                return;
            }

            //TODO: this could be more efficient (draw only in gap)
            GL.SetClearColor(Color.Black);
            GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit);

            FilterProgram.GuiRenderer.Begin(outputSize);
            GuiRenderer.SetBlendState(GL.BlendNoneCopy);

            //TODO: may depend on input, or other factors, not sure yet
            //watch out though... if we filter linear, then screens will bleed into each other.
            //so we will have to break them into render targets first.
            InputTexture.SetFilterNearest();

            //draw screens
            bool renderTop    = false;
            bool renderBottom = false;
            var  settings     = nds.GetSettings();

            if (settings.ScreenLayout == MelonDS.ScreenLayoutKind.Bottom)
            {
                renderBottom = true;
            }
            if (settings.ScreenLayout == MelonDS.ScreenLayoutKind.Top)
            {
                renderTop = true;
            }
            if (settings.ScreenLayout == MelonDS.ScreenLayoutKind.Vertical)
            {
                renderTop = renderBottom = true;
            }
            if (settings.ScreenLayout == MelonDS.ScreenLayoutKind.Horizontal)
            {
                renderTop = renderBottom = true;
            }

            if (renderTop)
            {
                GuiRenderer.Modelview.Push();
                GuiRenderer.Modelview.PreMultiplyMatrix(matTop);
                GuiRenderer.DrawSubrect(InputTexture, 0, 0, 256, 192, 0.0f, 0.0f, 1.0f, 0.5f);
                GuiRenderer.Modelview.Pop();
            }

            if (renderBottom)
            {
                GuiRenderer.Modelview.Push();
                GuiRenderer.Modelview.PreMultiplyMatrix(matBot);
                GuiRenderer.DrawSubrect(InputTexture, 0, 0, 256, 192, 0.0f, 0.5f, 1.0f, 1.0f);
                GuiRenderer.Modelview.Pop();
            }

            GuiRenderer.End();
        }
 public static void Clear(this IGL gl, System.Windows.Media.Color color, float depth)
 {
     gl.ClearColor(
         ((float)color.R) / 255,
         ((float)color.G) / 255,
         ((float)color.B) / 255,
         ((float)color.A) / 255);
     gl.ClearDepth(depth);
     gl.Clear(GLClearBufferMask.ColorBufferBit | GLClearBufferMask.DepthBufferBit);
 }
Exemple #4
0
        public override void Run()
        {
            if (nop)
            {
                return;
            }

            GL.SetClearColor(Color.FromArgb(BackgroundColor));
            GL.Clear(OpenTK.Graphics.OpenGL.ClearBufferMask.ColorBufferBit);

            GuiRenderer.Begin(OutputSize.Width, OutputSize.Height);
            GuiRenderer.SetBlendState(GL.BlendNoneCopy);

            if (FilterOption != eFilterOption.None)
            {
                InputTexture.SetFilterLinear();
            }
            else
            {
                InputTexture.SetFilterNearest();
            }

            if (FilterOption == eFilterOption.Bicubic)
            {
                //this was handled earlier by another filter
            }

            GuiRenderer.Modelview.Translate(LL.vx, LL.vy);
            if (Flip)
            {
                GuiRenderer.Modelview.Scale(1, -1);
                GuiRenderer.Modelview.Translate(0, -LL.vh);
            }
            GuiRenderer.Draw(InputTexture, 0, 0, LL.vw, LL.vh);

            GuiRenderer.End();
        }
Exemple #5
0
 public override void Redraw(IGL gl)
 {
     gl.ClearColor(0, 0, 0, 0);
     gl.Clear(GL.COLOR_BUFFER_BIT);
     gl.Finish();
 }