From a080fc495c8924efd36cb52f8a9d9ba5d9f8d6dd Mon Sep 17 00:00:00 2001
From: Joseph Walton-Rivers <joseph@walton-rivers.uk>
Date: Fri, 22 Apr 2022 19:55:07 +0100
Subject: [PATCH] comments for OGL4 backend

---
 include/fggl/gfx/ogl/renderer.hpp | 37 +++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/include/fggl/gfx/ogl/renderer.hpp b/include/fggl/gfx/ogl/renderer.hpp
index 600969e..462b705 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();
 			}
-- 
GitLab