From 160b74618226c29981d585abd9fc000b2dcb84f2 Mon Sep 17 00:00:00 2001 From: jmsgrogan Date: Sun, 15 May 2022 16:14:04 +0100 Subject: [PATCH] Fix build --- .gitignore | 1 + src/console/MainApplication.cpp | 5 +++++ src/geometry/AbstractGeometricItem.h | 6 ++++-- src/geometry/Rectangle.h | 2 +- src/graphics/CMakeLists.txt | 3 ++- src/graphics/DrawingManager.cpp | 3 +++ src/graphics/DrawingSurface.cpp | 3 ++- test/graphics/TestRasterizer.cpp | 4 ++++ 8 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index be28466..ba58399 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .project .settings/ /Debug/ +/build/ diff --git a/src/console/MainApplication.cpp b/src/console/MainApplication.cpp index 12714a9..f95aea1 100644 --- a/src/console/MainApplication.cpp +++ b/src/console/MainApplication.cpp @@ -6,9 +6,14 @@ #include "DrawingManager.h" #include "DrawingSurface.h" #include "DrawingContext.h" +#include "Rasterizer.h" +#include "Grid.h" +#include "Image.h" #include "TextElement.h" #include "DiscretePoint.h" + + #include MainApplication::MainApplication() diff --git a/src/geometry/AbstractGeometricItem.h b/src/geometry/AbstractGeometricItem.h index 3178acb..041310f 100644 --- a/src/geometry/AbstractGeometricItem.h +++ b/src/geometry/AbstractGeometricItem.h @@ -7,7 +7,9 @@ class AbstractGeometricItem { public: - Rectangle GetBounds() const = 0; + virtual ~AbstractGeometricItem() = default; - void Sample(Grid* grid) const = 0; + //Rectangle GetBounds() const = 0; + + virtual void Sample(Grid* grid) const = 0; }; diff --git a/src/geometry/Rectangle.h b/src/geometry/Rectangle.h index b204361..ae7fee4 100644 --- a/src/geometry/Rectangle.h +++ b/src/geometry/Rectangle.h @@ -14,7 +14,7 @@ public: } - Rectangle GetBounds() const override + Rectangle GetBounds() const { return Rectangle(mBottomLeft, mTopRight); } diff --git a/src/graphics/CMakeLists.txt b/src/graphics/CMakeLists.txt index 732061c..0afb8d4 100644 --- a/src/graphics/CMakeLists.txt +++ b/src/graphics/CMakeLists.txt @@ -40,10 +40,11 @@ target_include_directories(graphics PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/cairo" "${CMAKE_CURRENT_SOURCE_DIR}/opengl" "${PROJECT_SOURCE_DIR}/src/geometry/" + "${PROJECT_SOURCE_DIR}/src/image/" "${PROJECT_SOURCE_DIR}/src/visual_elements/" ) -target_link_libraries(graphics PUBLIC visual_elements ${platform_LIBS}) +target_link_libraries(graphics PUBLIC visual_elements image GL ${platform_LIBS}) set_property(TARGET graphics PROPERTY FOLDER src) set_target_properties( graphics PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON ) \ No newline at end of file diff --git a/src/graphics/DrawingManager.cpp b/src/graphics/DrawingManager.cpp index 604b79f..65d55db 100644 --- a/src/graphics/DrawingManager.cpp +++ b/src/graphics/DrawingManager.cpp @@ -5,6 +5,9 @@ #include "DrawingContext.h" #include "Rasterizer.h" +#include "Grid.h" +#include "Image.h" + DrawingManager::DrawingManager() : mRasterizer(std::make_unique()) { diff --git a/src/graphics/DrawingSurface.cpp b/src/graphics/DrawingSurface.cpp index 128595b..401b23e 100644 --- a/src/graphics/DrawingSurface.cpp +++ b/src/graphics/DrawingSurface.cpp @@ -1,5 +1,6 @@ #include "DrawingSurface.h" +#include "Image.h" std::unique_ptr DrawingSurface::Create() { @@ -41,5 +42,5 @@ unsigned DrawingSurface::GetHeight() const void DrawingSurface::Paint(Grid* grid) { - mImageBuffer = std::make_unique(); + //mImageBuffer = std::make_unique(); } diff --git a/test/graphics/TestRasterizer.cpp b/test/graphics/TestRasterizer.cpp index 47fd776..0f33f99 100644 --- a/test/graphics/TestRasterizer.cpp +++ b/test/graphics/TestRasterizer.cpp @@ -1,6 +1,10 @@ #include "Image.h" #include "PngWriter.h" #include "DrawingManager.h" +#include "DrawingSurface.h" +#include "DrawingContext.h" +#include "Grid.h" +#include "Rasterizer.h" int main() {