IGalRenderer.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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 InitializeFrameBuffer();
  10. void ResetFrameBuffer();
  11. void Render();
  12. void SetWindowSize(int Width, int Height);
  13. void SetFrameBuffer(
  14. byte* Fb,
  15. int Width,
  16. int Height,
  17. float ScaleX,
  18. float ScaleY,
  19. float OffsX,
  20. float OffsY,
  21. float Rotate);
  22. //Blend
  23. void SetBlendEnable(bool Enable);
  24. void SetBlend(
  25. GalBlendEquation Equation,
  26. GalBlendFactor FuncSrc,
  27. GalBlendFactor FuncDst);
  28. void SetBlendSeparate(
  29. GalBlendEquation EquationRgb,
  30. GalBlendEquation EquationAlpha,
  31. GalBlendFactor FuncSrcRgb,
  32. GalBlendFactor FuncDstRgb,
  33. GalBlendFactor FuncSrcAlpha,
  34. GalBlendFactor FuncDstAlpha);
  35. //Frame Buffer
  36. void SetFb(int FbIndex, int Width, int Height);
  37. void BindFrameBuffer(int FbIndex);
  38. void DrawFrameBuffer(int FbIndex);
  39. //Rasterizer
  40. void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);
  41. void SetVertexArray(int VbIndex, int Stride, byte[] Buffer, GalVertexAttrib[] Attribs);
  42. void SetIndexArray(byte[] Buffer, GalIndexFormat Format);
  43. void DrawArrays(int VbIndex, GalPrimitiveType PrimType);
  44. void DrawElements(int VbIndex, int First, GalPrimitiveType PrimType);
  45. //Shader
  46. void CreateShader(long Tag, GalShaderType Type, byte[] Data);
  47. IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);
  48. void SetConstBuffer(long Tag, int Cbuf, byte[] Data);
  49. void SetUniform1(string UniformName, int Value);
  50. void BindShader(long Tag);
  51. void BindProgram();
  52. //Texture
  53. void SetTexture(int Index, GalTexture Tex);
  54. void SetSampler(int Index, GalTextureSampler Sampler);
  55. }
  56. }