diff --git a/include/fggl/gfx/ogl/renderer.hpp b/include/fggl/gfx/ogl/renderer.hpp index 600969eda84dbf5b2d2adf11cec0c18e631d3ab0..462b7052b58b1aad6c81ddde967dd2f203d11045 100644 --- a/include/fggl/gfx/ogl/renderer.hpp +++ b/include/fggl/gfx/ogl/renderer.hpp @@ -43,6 +43,13 @@ namespace fggl::gfx { float total; }; + /** + * Class responsible for managing the OpenGL context. + * + * This class manages the OpenGL resources, all OpenGL resources are bound by its lifetime, and it is ultimately + * the class responsible for interacting with OpenGL. It is bound by the window it belongs to, and therefore if + * that window disappears so does this object. + */ class OpenGL4Backend : public Graphics { public: explicit OpenGL4Backend(const Window &owner); @@ -52,12 +59,42 @@ namespace fggl::gfx { OpenGL4Backend(const OpenGL4Backend&) = delete; OpenGL4Backend& operator=(const OpenGL4Backend&) = delete; + // move (probably) bad + OpenGL4Backend(OpenGL4Backend&&) = delete; + OpenGL4Backend&& operator=(OpenGL4Backend&&) = delete; + + /** + * Clear the backing buffer. + */ void clear() override; + + /** + * Notify the graphics system the framebuffer size has changed. + * + * @param width the new framebuffer width + * @param height the new framebuffer height + */ void resize(int width, int height) override; + /** + * Perform a 2D rendering pass. + * + * @param paint the objects to paint on screen + */ void draw2D(const Paint &paint) override; + + /** + * Perform a 3D rendering pass. + * + * @param world the world to render + */ void drawScene(ecs3::World& world) override; + /** + * Get the 2D canvas bounds. + * + * @return + */ inline Bounds canvasBounds() override { return m_canvasRenderer->bounds(); }