IGalRenderer.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. namespace Ryujinx.Graphics.Gal
  4. {
  5. public unsafe interface IGalRenderer
  6. {
  7. void QueueAction(Action ActionMthd);
  8. void RunActions();
  9. void Render();
  10. void SetWindowSize(int Width, int Height);
  11. //Blend
  12. void SetBlendEnable(bool Enable);
  13. void SetBlend(
  14. GalBlendEquation Equation,
  15. GalBlendFactor FuncSrc,
  16. GalBlendFactor FuncDst);
  17. void SetBlendSeparate(
  18. GalBlendEquation EquationRgb,
  19. GalBlendEquation EquationAlpha,
  20. GalBlendFactor FuncSrcRgb,
  21. GalBlendFactor FuncDstRgb,
  22. GalBlendFactor FuncSrcAlpha,
  23. GalBlendFactor FuncDstAlpha);
  24. //Frame Buffer
  25. void CreateFrameBuffer(long Tag, int Width, int Height);
  26. void BindFrameBuffer(long Tag);
  27. void BindFrameBufferTexture(long Tag, int Index, GalTextureSampler Sampler);
  28. void SetFrameBuffer(long Tag);
  29. void SetFrameBuffer(byte[] Data, int Width, int Height);
  30. void SetFrameBufferTransform(float SX, float SY, float Rotate, float TX, float TY);
  31. void SetViewport(int X, int Y, int Width, int Height);
  32. void GetFrameBufferData(long Tag, Action<byte[]> Callback);
  33. //Rasterizer
  34. void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);
  35. void SetVertexArray(int VbIndex, int Stride, byte[] Buffer, GalVertexAttrib[] Attribs);
  36. void SetIndexArray(byte[] Buffer, GalIndexFormat Format);
  37. void DrawArrays(int VbIndex, int First, int PrimCount, GalPrimitiveType PrimType);
  38. void DrawElements(int VbIndex, int First, GalPrimitiveType PrimType);
  39. //Shader
  40. void CreateShader(long Tag, GalShaderType Type, byte[] Data);
  41. IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);
  42. void SetConstBuffer(long Tag, int Cbuf, byte[] Data);
  43. void SetUniform1(string UniformName, int Value);
  44. void SetUniform2F(string UniformName, float X, float Y);
  45. void BindShader(long Tag);
  46. void BindProgram();
  47. //Texture
  48. void SetTextureAndSampler(int Index, GalTexture Texture, GalTextureSampler Sampler);
  49. void BindTexture(int Index);
  50. }
  51. }