public void DrawVram(bool EnableSmaa)
{
if (Shader == null) Initialize();
//int RectWidth = 512;
//int RectHeight = 272;
var Rectangle = IGuiWindowInfo.ClientRectangle;
GL.glClearColor(0, 0, 0, 1);
GL.glClear(GL.GL_COLOR_BUFFER_BIT);
//IGuiWindowInfo.SwapBuffers();
//return;
if (
(PspDisplay.CurrentInfo.Enabled || PspDisplay.CurrentInfo.PlayingVideo)
)
{
GetTex((Tex) =>
{
//Console.Out.WriteLineColored(ConsoleColor.Red, "{0}", Tex.Texture);
if (Tex != null && Tex.Color.Texture != 0)
{
var TexColor = Tex.Color;
var TexDepth = Tex.Depth;
if (EnableSmaa)
{
if (TexDepth.Texture != 0)
{
TexColor = Smaa.Process(TexColor, TexDepth);
}
}
GL.glViewport(Rectangle.X, Rectangle.Y, Rectangle.Width, Rectangle.Height);
Shader.Draw(GLGeometry.GL_TRIANGLE_STRIP, 4, () =>
{
var TextureRect = CSharpPlatform.RectangleF.FromCoords(0, 0, (float)PspDisplay.CurrentInfo.Width / 512f, (float)PspDisplay.CurrentInfo.Height / 272f);
if (TextureVerticalFlip) TextureRect = TextureRect.VFlip();
TexCoordsBuffer = GLBuffer.Create().SetData(TextureRect.GetFloat2TriangleStripCoords());
ShaderInfo.texture.Set(GLTextureUnit.CreateAtIndex(0).SetFiltering(GLScaleFilter.Nearest).SetWrap(GLWrap.ClampToEdge).SetTexture(TexColor));
//ShaderInfo.texture.Set(GLTextureUnit.CreateAtIndex(0).SetFiltering(GLScaleFilter.Nearest).SetWrap(GLWrap.ClampToEdge).SetTexture(TexDepth));
ShaderInfo.position.SetData<float>(VertexBuffer, 2);
ShaderInfo.texCoords.SetData<float>(TexCoordsBuffer, 2);
});
}
});
}
IGuiWindowInfo.SwapBuffers();
}