| 122 | }; |
| 123 | |
| 124 | struct FrameBufferData final |
| 125 | { |
| 126 | FrameBufferData(bgfx::FrameBufferHandle frameBuffer, uint16_t viewId, uint16_t width, uint16_t height) |
| 127 | : FrameBuffer{frameBuffer} |
| 128 | , ViewId{viewId} |
| 129 | , ViewClearState{ViewId} |
| 130 | , Width{width} |
| 131 | , Height{height} |
| 132 | { |
| 133 | assert(ViewId < bgfx::getCaps()->limits.maxViews); |
| 134 | } |
| 135 | |
| 136 | FrameBufferData(FrameBufferData&) = delete; |
| 137 | |
| 138 | ~FrameBufferData() |
| 139 | { |
| 140 | bgfx::destroy(FrameBuffer); |
| 141 | } |
| 142 | |
| 143 | void UseViewId(uint16_t viewId) |
| 144 | { |
| 145 | ViewId = viewId; |
| 146 | ViewClearState.UpdateViewId(ViewId); |
| 147 | } |
| 148 | |
| 149 | void SetUpView(uint16_t viewId) |
| 150 | { |
| 151 | UseViewId(viewId); |
| 152 | bgfx::setViewFrameBuffer(ViewId, FrameBuffer); |
| 153 | ViewClearState.Update(); |
| 154 | bgfx::setViewRect(ViewId, 0, 0, Width, Height); |
| 155 | } |
| 156 | |
| 157 | bgfx::FrameBufferHandle FrameBuffer{bgfx::kInvalidHandle}; |
| 158 | bgfx::ViewId ViewId{}; |
| 159 | Babylon::ViewClearState ViewClearState; |
| 160 | uint16_t Width{}; |
| 161 | uint16_t Height{}; |
| 162 | }; |
| 163 | |
| 164 | struct FrameBufferManager final |
| 165 | { |
nothing calls this directly
no outgoing calls
no test coverage detected