IGalRenderer.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. //Rasterizer
  33. void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);
  34. void SetVertexArray(int VbIndex, int Stride, byte[] Buffer, GalVertexAttrib[] Attribs);
  35. void SetIndexArray(byte[] Buffer, GalIndexFormat Format);
  36. void DrawArrays(int VbIndex, GalPrimitiveType PrimType);
  37. void DrawElements(int VbIndex, int First, GalPrimitiveType PrimType);
  38. //Shader
  39. void CreateShader(long Tag, GalShaderType Type, byte[] Data);
  40. IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);
  41. void SetConstBuffer(long Tag, int Cbuf, byte[] Data);
  42. void SetUniform1(string UniformName, int Value);
  43. void SetUniform2F(string UniformName, float X, float Y);
  44. void BindShader(long Tag);
  45. void BindProgram();
  46. //Texture
  47. void SetTextureAndSampler(int Index, GalTexture Texture, GalTextureSampler Sampler);
  48. void BindTexture(int Index);
  49. }
  50. }