|
@@ -7,6 +7,22 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
{
|
|
{
|
|
|
class OGLFrameBuffer
|
|
class OGLFrameBuffer
|
|
|
{
|
|
{
|
|
|
|
|
+ private struct Rect
|
|
|
|
|
+ {
|
|
|
|
|
+ public int X { get; private set; }
|
|
|
|
|
+ public int Y { get; private set; }
|
|
|
|
|
+ public int Width { get; private set; }
|
|
|
|
|
+ public int Height { get; private set; }
|
|
|
|
|
+
|
|
|
|
|
+ public Rect(int X, int Y, int Width, int Height)
|
|
|
|
|
+ {
|
|
|
|
|
+ this.X = X;
|
|
|
|
|
+ this.Y = Y;
|
|
|
|
|
+ this.Width = Width;
|
|
|
|
|
+ this.Height = Height;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private class FrameBuffer
|
|
private class FrameBuffer
|
|
|
{
|
|
{
|
|
|
public int Width { get; set; }
|
|
public int Width { get; set; }
|
|
@@ -38,6 +54,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
|
|
|
|
private ShaderProgram Shader;
|
|
private ShaderProgram Shader;
|
|
|
|
|
|
|
|
|
|
+ private Rect Viewport;
|
|
|
|
|
+
|
|
|
private bool IsInitialized;
|
|
private bool IsInitialized;
|
|
|
|
|
|
|
|
private int RawFbTexWidth;
|
|
private int RawFbTexWidth;
|
|
@@ -178,6 +196,13 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
GL.UseProgram(CurrentProgram);
|
|
GL.UseProgram(CurrentProgram);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void SetViewport(int X, int Y, int Width, int Height)
|
|
|
|
|
+ {
|
|
|
|
|
+ Viewport = new Rect(X, Y, Width, Height);
|
|
|
|
|
+
|
|
|
|
|
+ //TODO
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public void Render()
|
|
public void Render()
|
|
|
{
|
|
{
|
|
|
if (CurrTexHandle != 0)
|
|
if (CurrTexHandle != 0)
|
|
@@ -196,6 +221,8 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
|
|
|
|
|
GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
|
|
GL.BindFramebuffer(FramebufferTarget.Framebuffer, 0);
|
|
|
|
|
|
|
|
|
|
+ GL.Viewport(0, 0, 1280, 720);
|
|
|
|
|
+
|
|
|
GL.Clear(
|
|
GL.Clear(
|
|
|
ClearBufferMask.ColorBufferBit |
|
|
ClearBufferMask.ColorBufferBit |
|
|
|
ClearBufferMask.DepthBufferBit);
|
|
ClearBufferMask.DepthBufferBit);
|
|
@@ -218,6 +245,15 @@ namespace Ryujinx.Graphics.Gal.OpenGL
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private void SetViewport()
|
|
|
|
|
+ {
|
|
|
|
|
+ GL.Viewport(
|
|
|
|
|
+ Viewport.X,
|
|
|
|
|
+ Viewport.Y,
|
|
|
|
|
+ Viewport.Width,
|
|
|
|
|
+ Viewport.Height);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
private void EnsureInitialized()
|
|
private void EnsureInitialized()
|
|
|
{
|
|
{
|
|
|
if (!IsInitialized)
|
|
if (!IsInitialized)
|