aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics/Gal/IGalRenderer.cs
blob: 99534672d1769c3cf9626f8d17b16ba46cdf09e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System;
using System.Collections.Generic;

namespace Ryujinx.Graphics.Gal
{
    public unsafe interface IGalRenderer
    {
        void QueueAction(Action ActionMthd);
        void RunActions();

        void InitializeFrameBuffer();
        void ResetFrameBuffer();
        void Render();
        void SetWindowSize(int Width, int Height);
        void SetFrameBuffer(
            byte* Fb,
            int   Width,
            int   Height,
            float ScaleX,
            float ScaleY,
            float OffsX,
            float OffsY,
            float Rotate);

        //Blend
        void SetBlendEnable(bool Enable);

        void SetBlend(
            GalBlendEquation Equation,
            GalBlendFactor   FuncSrc,
            GalBlendFactor   FuncDst);

        void SetBlendSeparate(
            GalBlendEquation EquationRgb,
            GalBlendEquation EquationAlpha,
            GalBlendFactor   FuncSrcRgb,
            GalBlendFactor   FuncDstRgb,
            GalBlendFactor   FuncSrcAlpha,
            GalBlendFactor   FuncDstAlpha);

        //Frame Buffer
        void SetFb(int FbIndex, int Width, int Height);

        void BindFrameBuffer(int FbIndex);

        void DrawFrameBuffer(int FbIndex);

        //Rasterizer
        void ClearBuffers(int RtIndex, GalClearBufferFlags Flags);

        void SetVertexArray(int VbIndex, int Stride, byte[] Buffer, GalVertexAttrib[] Attribs);

        void SetIndexArray(byte[] Buffer, GalIndexFormat Format);

        void DrawArrays(int VbIndex, GalPrimitiveType PrimType);

        void DrawElements(int VbIndex, int First, GalPrimitiveType PrimType);

        //Shader
        void CreateShader(long Tag, GalShaderType Type, byte[] Data);

        IEnumerable<ShaderDeclInfo> GetTextureUsage(long Tag);

        void SetConstBuffer(long Tag, int Cbuf, byte[] Data);

        void SetUniform1(string UniformName, int Value);

        void BindShader(long Tag);

        void BindProgram();

        //Texture
        void SetTexture(int Index, GalTexture Tex);

        void SetSampler(int Index, GalTextureSampler Sampler);
    }
}