Abstract windowing/GL host. A backend owns the OS window, the GL context, input polling, and the per-frame boundaries. No Qt, no ImGui here.
| 36 | /// Abstract windowing/GL host. A backend owns the OS window, the GL context, |
| 37 | /// input polling, and the per-frame boundaries. No Qt, no ImGui here. |
| 38 | class HostBackend { |
| 39 | public: |
| 40 | virtual ~HostBackend() = default; |
| 41 | |
| 42 | /// Create the window + current GL context. Returns false on failure. |
| 43 | virtual bool initialize(const char* title, int width, int height) = 0; |
| 44 | |
| 45 | /// Pump OS/input events for one frame. |
| 46 | virtual void poll_events() = 0; |
| 47 | |
| 48 | /// True once the user/OS has requested the window close. |
| 49 | [[nodiscard]] virtual bool should_close() const = 0; |
| 50 | |
| 51 | [[nodiscard]] virtual FramebufferSize framebuffer_size() const = 0; |
| 52 | |
| 53 | /// Make context current, set viewport to the framebuffer size, clear. |
| 54 | virtual void begin_frame() = 0; |
| 55 | |
| 56 | /// Present the frame (swap buffers). |
| 57 | virtual void end_frame() = 0; |
| 58 | |
| 59 | virtual void shutdown() = 0; |
| 60 | }; |
| 61 | |
| 62 | } // namespace oid::host |
| 63 |
nothing calls this directly
no outgoing calls
no test coverage detected