MCPcopy Create free account
hub / github.com/DavidColson/Polybox / RenderState

Class RenderState

source/graphics.cpp:23–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21};
22
23struct RenderState {
24 Arena* pArena;
25
26 Vec2f targetResolution;
27
28 // Drawing state
29 ERenderMode mode { ERenderMode::None };
30 EPrimitiveType typeState;
31 ResizableArray<VertexData> vertexState;
32 Vec4f vertexColorState { Vec4f(0.0f, 0.0f, 0.0f, 0.0f) };
33 Vec2f vertexTexCoordState { Vec2f(0.0f, 0.0f) };
34 Vec3f vertexNormalState { Vec3f(0.0f, 0.0f, 0.0f) };
35
36 EMatrixMode matrixModeState;
37 Stack<Matrixf> matrixStates[(u64)EMatrixMode::Count];
38
39 ENormalsMode normalsModeState;
40 bool lightingState { false };
41 Vec4f lightDirectionsStates[MAX_LIGHTS];
42 Vec4f lightColorStates[MAX_LIGHTS];
43 Vec3f lightAmbientState { Vec3f(0.0f, 0.0f, 0.0f) };
44
45 bool fogState { false };
46 Vec2f fogDepths { Vec2f(0.0f, 0.0f) };
47 Vec3f fogColor { Vec3f(0.f, 0.f, 0.f) };
48
49 sg_image textureState;
50
51 sg_cull_mode cullMode;
52
53 ResizableArray<DrawCommand> drawList3D;
54 ResizableArray<DrawCommand> drawList2D;
55 ResizableArray<VertexData> perFrameVertexBuffer;
56 ResizableArray<u16> perFrameIndexBuffer;
57
58 // Sokol rendering data
59
60 // pipelines
61 sg_pipeline pipeCompositor;
62 sg_pipeline pipeMain[2 * 2 * (i32)EPrimitiveType::Count];
63
64 // passes
65 sg_pass passCore3DScene;
66 sg_pass passCore2DScene;
67 sg_pass passCompositor;
68
69 // persistent Buffers
70 sg_buffer fullscreenTriangle;
71 sg_buffer transientVertexBuffer;
72 sg_buffer transientIndexBuffer;
73
74 // framebuffers
75 sg_image fbCore3DScene;
76 sg_image fbCore2DScene;
77
78 // samplers
79 sg_sampler samplerNearest;
80

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected