diff --git a/fggl/gfx/ogl/renderer.cpp b/fggl/gfx/ogl/renderer.cpp index ff9be3d702c30c97c3e5a1723b0d2a4a39690ee5..2f0de497c9290b3976577622258fcd4c36ee6307 100644 --- a/fggl/gfx/ogl/renderer.cpp +++ b/fggl/gfx/ogl/renderer.cpp @@ -189,7 +189,7 @@ namespace fggl::gfx { // TODO(webpigeon): this shouldn't be hard-coded constexpr glm::vec3 DEFAULT_LIGHTPOS = glm::vec3(20.0F, 20.0F, 15.0F); - void MeshRenderer::render(fggl::ecs3::World &ecs, ecs3::entity_t camera, float dt) { + void GlMeshRenderer::render(fggl::ecs3::World &ecs, ecs3::entity_t camera, float dt) { if (camera == ecs::NULL_ENTITY) { spdlog::warn("tried to render a scene, but no camera exists!"); return; diff --git a/include/fggl/data/heightmap.h b/include/fggl/data/heightmap.h index 5043b2490839a285e5ee550abda9b6c7b0f3be21..bcf1a5737abc251189d8faa9866176bfc4e8bc0c 100644 --- a/include/fggl/data/heightmap.h +++ b/include/fggl/data/heightmap.h @@ -6,6 +6,7 @@ #define FGGL_HEIGHTMAP_H #include <cstdint> +#include "fggl/data/model.hpp" namespace fggl::data { diff --git a/include/fggl/gfx/common.hpp b/include/fggl/gfx/common.hpp index 302a195589a6174d9239bd6e2b91d2fa6abf5a69..02b8c0ec4a0ab7a4980125ed0067667816d5191f 100644 --- a/include/fggl/gfx/common.hpp +++ b/include/fggl/gfx/common.hpp @@ -1,19 +1,15 @@ #ifndef FGGL_GFX_COMMON_H #define FGGL_GFX_COMMON_H +// +// This file exists to ensure that dependencies are loaded in the correct order. +// Code should NOT directly include things in this file (glfw, opengl) as the order MUST be correct or things go boom. +// + // load the correct rendering backend (only opengl for now) #include <fggl/gfx/ogl/common.hpp> // now it's safe to load the windowing system #include <GLFW/glfw3.h> -#include <fggl/data/model.hpp> -#include <string> -#include <utility> - -namespace fggl::gfx { - - -} - #endif diff --git a/include/fggl/gfx/ogl/backend.hpp b/include/fggl/gfx/ogl/backend.hpp index 8250f5f0e08ae1c24a0b04a2d8587e253e028336..7b0225fd1c615675501b8dba79848770ca7b9485 100644 --- a/include/fggl/gfx/ogl/backend.hpp +++ b/include/fggl/gfx/ogl/backend.hpp @@ -1,5 +1,5 @@ -#ifndef FGGL_GFX_OGL_BACKEND_H -#define FGGL_GFX_OGL_BACKEND_H +#ifndef FGGL_GFX_OGL_BACKEND_HPP +#define FGGL_GFX_OGL_BACKEND_HPP #include <fggl/gfx/ogl/common.hpp> #include <fggl/gfx/window.hpp> diff --git a/include/fggl/gfx/ogl/common.hpp b/include/fggl/gfx/ogl/common.hpp index 855ac7d5683b1aef24473de4bb58639bee335dd4..aa98486dddbfdd4d6f45054a835ceb4687c9b8ee 100644 --- a/include/fggl/gfx/ogl/common.hpp +++ b/include/fggl/gfx/ogl/common.hpp @@ -1,5 +1,5 @@ -#ifndef FGGL_GFX_OGL_COMMON_H -#define FGGL_GFX_OGL_COMMON_H +#ifndef FGGL_GFX_OGL_COMMON_HPP +#define FGGL_GFX_OGL_COMMON_HPP /** * Ensure Graphics libraries are in the right order. diff --git a/include/fggl/gfx/ogl/compat.hpp b/include/fggl/gfx/ogl/compat.hpp index 2b51ecd93bff629a33e20bd161c9c65690970f5d..d00abfc778d613da2eb3a2c613e23681bf20e03e 100644 --- a/include/fggl/gfx/ogl/compat.hpp +++ b/include/fggl/gfx/ogl/compat.hpp @@ -1,5 +1,5 @@ -#ifndef FGGL_GFX_OGL_COMPAT_H -#define FGGL_GFX_OGL_COMPAT_H +#ifndef FGGL_GFX_OGL_COMPAT_HPP +#define FGGL_GFX_OGL_COMPAT_HPP /** * Legacy/Direct OpenGL calls. * diff --git a/include/fggl/gfx/ogl/renderer.hpp b/include/fggl/gfx/ogl/renderer.hpp index 97f621f0d3a05371ac92a471b3dce84acbaf0eec..600969eda84dbf5b2d2adf11cec0c18e631d3ab0 100644 --- a/include/fggl/gfx/ogl/renderer.hpp +++ b/include/fggl/gfx/ogl/renderer.hpp @@ -10,7 +10,6 @@ #include "fggl/gfx/ogl4/canvas.hpp" #include <fggl/gfx/paint.hpp> -#include <fggl/gfx/renderer.hpp> #include <memory> #include <vector> @@ -71,10 +70,6 @@ namespace fggl::gfx { using OpenGL4 = OpenGL4Backend; -// specialisation hooks - using MeshRenderer = GlMeshRenderer; - using MeshToken = GlRenderToken; - }; // namespace fggl::gfx #endif diff --git a/include/fggl/gfx/renderer.hpp b/include/fggl/gfx/renderer.hpp deleted file mode 100644 index 5fe42c6b052d2c97f00e772e3a423b129e5a796c..0000000000000000000000000000000000000000 --- a/include/fggl/gfx/renderer.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#include <functional> -#include <memory> - -namespace fggl::gfx { - - class RenderBackend { - public: - RenderBackend(); - virtual ~RenderBackend() = default; - - virtual void clear() = 0; - virtual void swap() = 0; - - }; - - using RenderBackendPtr = std::unique_ptr<RenderBackend>; - using RenderBackendFactory = std::function<fggl::gfx::RenderBackendPtr &&()>; - -}; diff --git a/include/fggl/gfx/vector.hpp b/include/fggl/gfx/vector.hpp deleted file mode 100644 index 72d764911f7c359799dca5398cc8f3acd0d14127..0000000000000000000000000000000000000000 --- a/include/fggl/gfx/vector.hpp +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef FGGL_GFX_VECTOR_H -#define FGGL_GFX_VECTOR_H - -#include <fggl/math/types.hpp> -#include <vector> - -namespace fggl::gfx { - - struct Rectangle { - math::vec2 topLeft; - math::vec2 size; - }; - - struct Polygon { - std::vector<math::vec2> points; - }; - -} - -#endif diff --git a/include/fggl/gfx/window.hpp b/include/fggl/gfx/window.hpp index 36327b72a374b0191ea082150f01abbab2c31c19..b3d50467f951460d735aa0dccf71d38969602e8d 100644 --- a/include/fggl/gfx/window.hpp +++ b/include/fggl/gfx/window.hpp @@ -8,7 +8,6 @@ #include <fggl/input/input.hpp> #include <fggl/gfx/common.hpp> #include <fggl/math/types.hpp> -#include <fggl/gfx/input.hpp> #include <fggl/gfx/windowing.hpp> namespace fggl::gfx {