From 34bf7e741bd9bed5ef0980c1a86a36652b6f8a8b Mon Sep 17 00:00:00 2001 From: Gordon McCann Date: Sat, 8 Jan 2022 22:36:16 -0500 Subject: [PATCH] Re-enabled windows support. Event builder now instanced outside application. Some premake cleanup. --- NavProject/main.cpp | 2 +- Navigator/src/Navigator.h | 1 + Navigator/src/Navigator/Application.cpp | 5 ++--- Navigator/src/Navigator/Application.h | 4 ++-- Navigator/src/Navigator/Events/AppEvent.h | 7 ++++--- Navigator/src/Navigator/Events/Event.h | 10 +++++----- Navigator/src/Navigator/Events/KeyEvent.h | 9 +++++---- Navigator/src/Navigator/Events/MouseEvent.h | 10 +++++----- Navigator/src/Navigator/Events/PhysicsEvent.h | 5 +++-- Navigator/src/Navigator/GraphicsContext.h | 2 +- Navigator/src/Navigator/Histogram.h | 8 +++++--- Navigator/src/Navigator/ImGui/ImGuiLayer.h | 3 ++- Navigator/src/Navigator/Layer.h | 3 ++- Navigator/src/Navigator/LayerStack.h | 2 +- Navigator/src/Navigator/Logger.h | 3 ++- Navigator/src/Navigator/NavCore.h | 9 ++++++++- Navigator/src/Navigator/ParameterMap.h | 9 +++++---- Navigator/src/Navigator/Physics/AnalysisStack.h | 2 +- Navigator/src/Navigator/Physics/AnalysisStage.h | 3 ++- Navigator/src/Navigator/Physics/CompassFile.h | 3 ++- Navigator/src/Navigator/Physics/CompassHit.h | 4 +++- Navigator/src/Navigator/Physics/CompassRun.h | 3 ++- Navigator/src/Navigator/Physics/DataSource.h | 7 ++++--- .../src/Navigator/Physics/PhysicsEventBuilder.h | 6 +++--- Navigator/src/Navigator/Physics/PhysicsHitSort.h | 3 ++- Navigator/src/Navigator/Physics/ShiftMap.h | 4 +++- Navigator/src/Navigator/Renderer/RenderCommand.h | 3 ++- Navigator/src/Navigator/Renderer/Renderer.h | 3 ++- Navigator/src/Navigator/Renderer/RendererAPI.h | 4 +++- Navigator/src/Navigator/Window.h | 4 ++-- Navigator/src/Platform/OpenGL/OpenGLContext.h | 3 ++- .../src/Platform/OpenGL/OpenGLRendererAPI.h | 3 ++- Navigator/src/Platform/OpenGL/OpenGLWindow.h | 3 ++- premake5.lua | 16 +++++++++++++--- 34 files changed, 104 insertions(+), 62 deletions(-) diff --git a/NavProject/main.cpp b/NavProject/main.cpp index 0f6d89f..1b15d09 100644 --- a/NavProject/main.cpp +++ b/NavProject/main.cpp @@ -9,7 +9,7 @@ int main(int argc, const char** argv) NAV_TRACE("Logger Initialized!"); auto app = Navigator::CreateApplication(); - + auto evb = Navigator::CreatePhysicsEventBuilder(); app->Run(); delete app; diff --git a/Navigator/src/Navigator.h b/Navigator/src/Navigator.h index 377bc78..b91ae5e 100644 --- a/Navigator/src/Navigator.h +++ b/Navigator/src/Navigator.h @@ -1,6 +1,7 @@ #ifndef NAVIGATOR_H #define NAVIGATOR_H + #include #include #include diff --git a/Navigator/src/Navigator/Application.cpp b/Navigator/src/Navigator/Application.cpp index 7e7440d..45912fa 100644 --- a/Navigator/src/Navigator/Application.cpp +++ b/Navigator/src/Navigator/Application.cpp @@ -17,7 +17,6 @@ namespace Navigator { /*order is important, must be pMap then evb*/ CreateParameterMap(); - CreatePhysicsEventBuilder(); NavParameter par("joseph","mama"); par.SetValue(8); @@ -110,8 +109,8 @@ namespace Navigator { void Application::Run() { - PhysicsStartEvent junk("/media/gordon/GordonData/gwm17/NavTests/data/", DataSource::SourceType::CompassOffline, 2000000); - OnEvent(junk); + //PhysicsStartEvent junk("/media/gordon/GordonData/gwm17/NavTests/data/", DataSource::SourceType::CompassOffline, 2000000); + //OnEvent(junk); while(m_runFlag) { diff --git a/Navigator/src/Navigator/Application.h b/Navigator/src/Navigator/Application.h index 4f507c7..6807464 100644 --- a/Navigator/src/Navigator/Application.h +++ b/Navigator/src/Navigator/Application.h @@ -14,7 +14,7 @@ namespace Navigator { - class Application + class NAV_API Application { public: Application(); @@ -49,7 +49,7 @@ namespace Navigator { static Application* s_instance; }; - Application* CreateApplication(); + NAV_API Application* CreateApplication(); } #endif \ No newline at end of file diff --git a/Navigator/src/Navigator/Events/AppEvent.h b/Navigator/src/Navigator/Events/AppEvent.h index 443e600..7f4b8af 100644 --- a/Navigator/src/Navigator/Events/AppEvent.h +++ b/Navigator/src/Navigator/Events/AppEvent.h @@ -1,11 +1,12 @@ #ifndef APP_EVENT_H #define APP_EVENT_H +#include "Navigator/NavCore.h" #include "Event.h" namespace Navigator { - class WindowCloseEvent : public Event + class NAV_API WindowCloseEvent : public Event { public: WindowCloseEvent() {}; @@ -14,7 +15,7 @@ namespace Navigator { EVENT_TYPE_SETUP(WindowClose) }; - class WindowResizeEvent : public Event + class NAV_API WindowResizeEvent : public Event { public: WindowResizeEvent(float x, float y) : @@ -38,7 +39,7 @@ namespace Navigator { float m_xSize, m_ySize; }; - class AppUpdateEvent : public Event + class NAV_API AppUpdateEvent : public Event { public: AppUpdateEvent() = default; diff --git a/Navigator/src/Navigator/Events/Event.h b/Navigator/src/Navigator/Events/Event.h index 3e0a342..7e7b303 100644 --- a/Navigator/src/Navigator/Events/Event.h +++ b/Navigator/src/Navigator/Events/Event.h @@ -5,7 +5,7 @@ namespace Navigator { - enum class EventType + enum class NAV_API EventType { None=0, WindowClose, WindowResize, WindowFocus, WindowLostFocus, WindowMoved, @@ -15,7 +15,7 @@ namespace Navigator { PhysicsStart, PhysicsStop }; - enum EventCategory + enum NAV_API EventCategory { EventCategoryNone=0, EventCategoryApp=BIT(0), @@ -33,7 +33,7 @@ namespace Navigator { virtual EventType GetEventType() const override { return GetStaticType(); } \ virtual const char* GetName() const override { return #type; } - class Event + class NAV_API Event { friend class EventDispatcher; public: @@ -45,7 +45,7 @@ namespace Navigator { bool handledFlag = false; }; - class EventDispatcher + class NAV_API EventDispatcher { template using EventFunc = std::function; @@ -74,7 +74,7 @@ namespace Navigator { Event& m_event; }; - inline std::ostream& operator<<(std::ostream& os, const Event& e) + NAV_API inline std::ostream& operator<<(std::ostream& os, const Event& e) { return os << e.ToString(); } diff --git a/Navigator/src/Navigator/Events/KeyEvent.h b/Navigator/src/Navigator/Events/KeyEvent.h index 921b53f..d028199 100644 --- a/Navigator/src/Navigator/Events/KeyEvent.h +++ b/Navigator/src/Navigator/Events/KeyEvent.h @@ -1,11 +1,12 @@ #ifndef KEY_EVENT_H #define KEY_EVENT_H +#include "Navigator/NavCore.h" #include "Event.h" namespace Navigator { - class KeyEvent : public Event + class NAV_API KeyEvent : public Event { public: inline int GetKeycode() const { return m_keycode; } @@ -20,7 +21,7 @@ namespace Navigator { }; - class KeyPressedEvent : public KeyEvent + class NAV_API KeyPressedEvent : public KeyEvent { public: KeyPressedEvent(int code, int count) : @@ -44,7 +45,7 @@ namespace Navigator { int m_repeatCount; }; - class KeyReleasedEvent : public KeyEvent + class NAV_API KeyReleasedEvent : public KeyEvent { public: KeyReleasedEvent(int code) : @@ -63,7 +64,7 @@ namespace Navigator { }; - class KeyTypedEvent : public KeyEvent + class NAV_API KeyTypedEvent : public KeyEvent { public: KeyTypedEvent(int code) : diff --git a/Navigator/src/Navigator/Events/MouseEvent.h b/Navigator/src/Navigator/Events/MouseEvent.h index 8ded644..ee86694 100644 --- a/Navigator/src/Navigator/Events/MouseEvent.h +++ b/Navigator/src/Navigator/Events/MouseEvent.h @@ -1,12 +1,12 @@ #ifndef MOUSE_EVENT_H #define MOUSE_EVENT_H - +#include "Navigator/NavCore.h" #include "Event.h" namespace Navigator { - class MouseMovedEvent : public Event + class NAV_API MouseMovedEvent : public Event { public: MouseMovedEvent(float x, float y) : @@ -30,7 +30,7 @@ namespace Navigator { float m_xPos, m_yPos; }; - class MouseScrolledEvent : public Event + class NAV_API MouseScrolledEvent : public Event { public: MouseScrolledEvent(float x, float y) : @@ -54,7 +54,7 @@ namespace Navigator { float m_xOffset, m_yOffset; }; - class MouseButtonPressedEvent : public Event + class NAV_API MouseButtonPressedEvent : public Event { public: MouseButtonPressedEvent(int code) : @@ -77,7 +77,7 @@ namespace Navigator { int m_buttonCode; }; - class MouseButtonReleasedEvent : public Event + class NAV_API MouseButtonReleasedEvent : public Event { public: MouseButtonReleasedEvent(int code) : diff --git a/Navigator/src/Navigator/Events/PhysicsEvent.h b/Navigator/src/Navigator/Events/PhysicsEvent.h index cb58512..d50598d 100644 --- a/Navigator/src/Navigator/Events/PhysicsEvent.h +++ b/Navigator/src/Navigator/Events/PhysicsEvent.h @@ -1,12 +1,13 @@ #ifndef PHYSICS_EVENT_H #define PHYSICS_EVENT_H +#include "Navigator/NavCore.h" #include "Event.h" #include "Navigator/Physics/DataSource.h" namespace Navigator { - class PhysicsStartEvent : public Event + class NAV_API PhysicsStartEvent : public Event { public: PhysicsStartEvent(const std::string& loc, DataSource::SourceType type, uint64_t window) : @@ -31,7 +32,7 @@ namespace Navigator { uint64_t m_coincidenceWindow; }; - class PhysicsStopEvent : public Event + class NAV_API PhysicsStopEvent : public Event { public: PhysicsStopEvent() {} diff --git a/Navigator/src/Navigator/GraphicsContext.h b/Navigator/src/Navigator/GraphicsContext.h index db90495..81618f2 100644 --- a/Navigator/src/Navigator/GraphicsContext.h +++ b/Navigator/src/Navigator/GraphicsContext.h @@ -3,7 +3,7 @@ namespace Navigator { - class GraphicsContext + class NAV_API GraphicsContext { public: virtual void Init() = 0; diff --git a/Navigator/src/Navigator/Histogram.h b/Navigator/src/Navigator/Histogram.h index 47a5103..8e55d93 100644 --- a/Navigator/src/Navigator/Histogram.h +++ b/Navigator/src/Navigator/Histogram.h @@ -1,9 +1,11 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H +#include "NavCore.h" + namespace Navigator { - class Histogram + class NAV_API Histogram { public: Histogram(const std::string& name, const std::string& param_x, const std::string& param_y="None") : @@ -26,7 +28,7 @@ namespace Navigator { bool m_initFlag; }; - class Histogram1D : public Histogram + class NAV_API Histogram1D : public Histogram { public: Histogram1D(const std::string& name, const std::string& param, int bins, double min, double max); @@ -47,7 +49,7 @@ namespace Navigator { double m_xMax; }; - class Histogram2D : public Histogram + class NAV_API Histogram2D : public Histogram { public: Histogram2D(const std::string& name, const std::string& param_x, const std::string& param_y, int bins_x, double min_x, double max_x, diff --git a/Navigator/src/Navigator/ImGui/ImGuiLayer.h b/Navigator/src/Navigator/ImGui/ImGuiLayer.h index ce52bbc..9f1d05d 100644 --- a/Navigator/src/Navigator/ImGui/ImGuiLayer.h +++ b/Navigator/src/Navigator/ImGui/ImGuiLayer.h @@ -1,11 +1,12 @@ #ifndef IMGUI_LAYER_H #define IMGUI_LAYER_H +#include "Navigator/NavCore.h" #include "Navigator/Layer.h" namespace Navigator { - class ImGuiLayer : public Layer + class NAV_API ImGuiLayer : public Layer { public: ImGuiLayer(); diff --git a/Navigator/src/Navigator/Layer.h b/Navigator/src/Navigator/Layer.h index f6cb7d0..1934269 100644 --- a/Navigator/src/Navigator/Layer.h +++ b/Navigator/src/Navigator/Layer.h @@ -1,11 +1,12 @@ #ifndef LAYER_H #define LAYER_H +#include "NavCore.h" #include "Events/Event.h" namespace Navigator { - class Layer + class NAV_API Layer { public: Layer(const std::string& name="Layer"); diff --git a/Navigator/src/Navigator/LayerStack.h b/Navigator/src/Navigator/LayerStack.h index 84928e6..084c9dd 100644 --- a/Navigator/src/Navigator/LayerStack.h +++ b/Navigator/src/Navigator/LayerStack.h @@ -6,7 +6,7 @@ namespace Navigator { - class LayerStack + class NAV_API LayerStack { public: LayerStack(); diff --git a/Navigator/src/Navigator/Logger.h b/Navigator/src/Navigator/Logger.h index b3fa28c..b47c26b 100644 --- a/Navigator/src/Navigator/Logger.h +++ b/Navigator/src/Navigator/Logger.h @@ -1,12 +1,13 @@ #ifndef LOGGER_H #define LOGGER_H +#include "NavCore.h" #include "spdlog/spdlog.h" #include "spdlog/fmt/ostr.h" namespace Navigator { - class Logger + class NAV_API Logger { public: diff --git a/Navigator/src/Navigator/NavCore.h b/Navigator/src/Navigator/NavCore.h index 30bc817..7a7ea64 100644 --- a/Navigator/src/Navigator/NavCore.h +++ b/Navigator/src/Navigator/NavCore.h @@ -1,8 +1,15 @@ #ifndef NAVCORE_H #define NAVCORE_H + #ifdef NAV_WINDOWS - #error "Navigator is not compatible with Windows!" + #ifdef NAV_EXPORT + #define NAV_API __declspec(dllexport) + #else + #define NAV_API __declspec(dllimport) + #endif +#else + #define NAV_API #endif diff --git a/Navigator/src/Navigator/ParameterMap.h b/Navigator/src/Navigator/ParameterMap.h index 49ce4a7..c31c437 100644 --- a/Navigator/src/Navigator/ParameterMap.h +++ b/Navigator/src/Navigator/ParameterMap.h @@ -1,11 +1,12 @@ #ifndef PARAMETER_MAP_H #define PARAMETER_MAP_H +#include "NavCore.h" #include namespace Navigator { - struct ParameterData + struct NAV_API ParameterData { std::atomic value=0.0; std::atomic validFlag=false; @@ -15,7 +16,7 @@ namespace Navigator { For use inside of the physics thread only!!!!!! Do not use elsewhere as complex operations on parameter values are !not! guaranteed to be thread-safe, only the accesing is! */ - class NavParameter + class NAV_API NavParameter { public: @@ -36,7 +37,7 @@ namespace Navigator { /* Global parameter accesing, storage */ - class ParameterMap + class NAV_API ParameterMap { public: @@ -62,7 +63,7 @@ namespace Navigator { }; - ParameterMap* CreateParameterMap(); + NAV_API ParameterMap* CreateParameterMap(); } #endif diff --git a/Navigator/src/Navigator/Physics/AnalysisStack.h b/Navigator/src/Navigator/Physics/AnalysisStack.h index 344e29f..a471ff1 100644 --- a/Navigator/src/Navigator/Physics/AnalysisStack.h +++ b/Navigator/src/Navigator/Physics/AnalysisStack.h @@ -13,7 +13,7 @@ namespace Navigator { - class AnalysisStack + class NAV_API AnalysisStack { public: AnalysisStack(); diff --git a/Navigator/src/Navigator/Physics/AnalysisStage.h b/Navigator/src/Navigator/Physics/AnalysisStage.h index a0be8fb..7c626cd 100644 --- a/Navigator/src/Navigator/Physics/AnalysisStage.h +++ b/Navigator/src/Navigator/Physics/AnalysisStage.h @@ -1,11 +1,12 @@ #ifndef ANALYSIS_STAGE_H #define ANALYSIS_STAGE_H +#include "Navigator/NavCore.h" #include "CompassHit.h" namespace Navigator { - class AnalysisStage + class NAV_API AnalysisStage { public: using RawPhysicsEvent = std::vector; diff --git a/Navigator/src/Navigator/Physics/CompassFile.h b/Navigator/src/Navigator/Physics/CompassFile.h index b0b31d7..34484d3 100644 --- a/Navigator/src/Navigator/Physics/CompassFile.h +++ b/Navigator/src/Navigator/Physics/CompassFile.h @@ -11,12 +11,13 @@ #ifndef COMPASSFILE_H #define COMPASSFILE_H +#include "Navigator/NavCore.h" #include "CompassHit.h" #include "ShiftMap.h" namespace Navigator { - class CompassFile + class NAV_API CompassFile { public: diff --git a/Navigator/src/Navigator/Physics/CompassHit.h b/Navigator/src/Navigator/Physics/CompassHit.h index 85daeee..5d67fe6 100644 --- a/Navigator/src/Navigator/Physics/CompassHit.h +++ b/Navigator/src/Navigator/Physics/CompassHit.h @@ -1,9 +1,11 @@ #ifndef COMPASS_HIT_H #define COMPASS_HIT_H +#include "Navigator/NavCore.h" + namespace Navigator { - struct CompassHit + struct NAV_API CompassHit { uint16_t board = 0; uint16_t channel = 0; diff --git a/Navigator/src/Navigator/Physics/CompassRun.h b/Navigator/src/Navigator/Physics/CompassRun.h index 71a349b..b2fec0f 100644 --- a/Navigator/src/Navigator/Physics/CompassRun.h +++ b/Navigator/src/Navigator/Physics/CompassRun.h @@ -10,6 +10,7 @@ #ifndef COMPASSRUN_H #define COMPASSRUN_H +#include "Navigator/NavCore.h" #include "DataSource.h" #include "CompassFile.h" #include "ShiftMap.h" @@ -17,7 +18,7 @@ namespace Navigator { - class CompassRun : public DataSource + class NAV_API CompassRun : public DataSource { public: diff --git a/Navigator/src/Navigator/Physics/DataSource.h b/Navigator/src/Navigator/Physics/DataSource.h index 084aac8..2fc9180 100644 --- a/Navigator/src/Navigator/Physics/DataSource.h +++ b/Navigator/src/Navigator/Physics/DataSource.h @@ -1,11 +1,12 @@ #ifndef DATA_SOURCE_H #define DATA_SOURCE_H +#include "Navigator/NavCore.h" #include "CompassHit.h" namespace Navigator { - class DataSource + class NAV_API DataSource { public: enum class SourceType @@ -28,9 +29,9 @@ namespace Navigator { bool m_validFlag; }; - DataSource* CreateDataSource(const std::string& loc, DataSource::SourceType type); + NAV_API DataSource* CreateDataSource(const std::string& loc, DataSource::SourceType type); - std::string ConvertDataSourceTypeToString(DataSource::SourceType type); + NAV_API std::string ConvertDataSourceTypeToString(DataSource::SourceType type); } #endif \ No newline at end of file diff --git a/Navigator/src/Navigator/Physics/PhysicsEventBuilder.h b/Navigator/src/Navigator/Physics/PhysicsEventBuilder.h index 63c5065..d15f426 100644 --- a/Navigator/src/Navigator/Physics/PhysicsEventBuilder.h +++ b/Navigator/src/Navigator/Physics/PhysicsEventBuilder.h @@ -11,7 +11,7 @@ namespace Navigator { - class PhysicsEventBuilder + class NAV_API PhysicsEventBuilder { public: PhysicsEventBuilder(); @@ -26,7 +26,7 @@ namespace Navigator { void PushStage(AnalysisStage* stage); bool IsRunning() { return m_runFlag; } - inline static PhysicsEventBuilder& Get() { return *s_instance; } + static PhysicsEventBuilder& Get() { return *s_instance; } private: AnalysisStack m_physStack; @@ -40,7 +40,7 @@ namespace Navigator { }; - PhysicsEventBuilder* CreatePhysicsEventBuilder(); + NAV_API PhysicsEventBuilder* CreatePhysicsEventBuilder(); } diff --git a/Navigator/src/Navigator/Physics/PhysicsHitSort.h b/Navigator/src/Navigator/Physics/PhysicsHitSort.h index 6ae42b5..d50f872 100644 --- a/Navigator/src/Navigator/Physics/PhysicsHitSort.h +++ b/Navigator/src/Navigator/Physics/PhysicsHitSort.h @@ -1,11 +1,12 @@ #ifndef PHYSICS_HIT_SORT_H #define PHYSICS_HIT_SORT_H +#include "Navigator/NavCore.h" #include "CompassHit.h" namespace Navigator { - class PhysicsHitSort + class NAV_API PhysicsHitSort { public: using RawPhysicsEvent = std::vector; diff --git a/Navigator/src/Navigator/Physics/ShiftMap.h b/Navigator/src/Navigator/Physics/ShiftMap.h index 08751a0..e7b6ad0 100644 --- a/Navigator/src/Navigator/Physics/ShiftMap.h +++ b/Navigator/src/Navigator/Physics/ShiftMap.h @@ -12,9 +12,11 @@ #ifndef SHIFTMAP_H #define SHIFTMAP_H +#include "Navigator/NavCore.h" + namespace Navigator { - class ShiftMap + class NAV_API ShiftMap { public: ShiftMap(); diff --git a/Navigator/src/Navigator/Renderer/RenderCommand.h b/Navigator/src/Navigator/Renderer/RenderCommand.h index 4d41acf..3788ee8 100644 --- a/Navigator/src/Navigator/Renderer/RenderCommand.h +++ b/Navigator/src/Navigator/Renderer/RenderCommand.h @@ -1,11 +1,12 @@ #ifndef RENDER_COMMAND_H #define RENDER_COMMAND_H +#include "Navigator/NavCore.h" #include "RendererAPI.h" namespace Navigator { - class RenderCommand + class NAV_API RenderCommand { public: inline static void SetClearColor(const float* color_array) { s_api->SetClearColor(color_array); } diff --git a/Navigator/src/Navigator/Renderer/Renderer.h b/Navigator/src/Navigator/Renderer/Renderer.h index 9dbbcf8..7515e14 100644 --- a/Navigator/src/Navigator/Renderer/Renderer.h +++ b/Navigator/src/Navigator/Renderer/Renderer.h @@ -1,12 +1,13 @@ #ifndef RENDERER_H #define RENDERER_H +#include "Navigator/NavCore.h" #include "RendererAPI.h" #include "RenderCommand.h" namespace Navigator { - class Renderer + class NAV_API Renderer { public: diff --git a/Navigator/src/Navigator/Renderer/RendererAPI.h b/Navigator/src/Navigator/Renderer/RendererAPI.h index 38a9fdc..2feb9fc 100644 --- a/Navigator/src/Navigator/Renderer/RendererAPI.h +++ b/Navigator/src/Navigator/Renderer/RendererAPI.h @@ -1,9 +1,11 @@ #ifndef RENDERER_API_H #define RENDERER_API_H +#include "Navigator/NavCore.h" + namespace Navigator { - class RendererAPI + class NAV_API RendererAPI { public: enum class API diff --git a/Navigator/src/Navigator/Window.h b/Navigator/src/Navigator/Window.h index ace47f2..bd06625 100644 --- a/Navigator/src/Navigator/Window.h +++ b/Navigator/src/Navigator/Window.h @@ -6,7 +6,7 @@ namespace Navigator { - class WindowProperties + class NAV_API WindowProperties { public: unsigned int width, height; @@ -19,7 +19,7 @@ namespace Navigator { }; - class Window + class NAV_API Window { public: diff --git a/Navigator/src/Platform/OpenGL/OpenGLContext.h b/Navigator/src/Platform/OpenGL/OpenGLContext.h index fbaca18..687432c 100644 --- a/Navigator/src/Platform/OpenGL/OpenGLContext.h +++ b/Navigator/src/Platform/OpenGL/OpenGLContext.h @@ -1,13 +1,14 @@ #ifndef OPEGL_CONTEXT_H #define OPEGL_CONTEXT_H +#include "Navigator/NavCore.h" #include "Navigator/GraphicsContext.h" struct GLFWwindow; namespace Navigator { - class OpenGLContext : public GraphicsContext + class NAV_API OpenGLContext : public GraphicsContext { public: OpenGLContext(GLFWwindow* window); diff --git a/Navigator/src/Platform/OpenGL/OpenGLRendererAPI.h b/Navigator/src/Platform/OpenGL/OpenGLRendererAPI.h index f712b36..55c974a 100644 --- a/Navigator/src/Platform/OpenGL/OpenGLRendererAPI.h +++ b/Navigator/src/Platform/OpenGL/OpenGLRendererAPI.h @@ -1,11 +1,12 @@ #ifndef OPENGL_RENDERER_API_H #define OPENGL_RENDERER_API_H +#include "Navigator/NavCore.h" #include "Navigator/Renderer/RendererAPI.h" namespace Navigator { - class OpenGLRendererAPI : public RendererAPI + class NAV_API OpenGLRendererAPI : public RendererAPI { public: virtual void Clear() override; diff --git a/Navigator/src/Platform/OpenGL/OpenGLWindow.h b/Navigator/src/Platform/OpenGL/OpenGLWindow.h index 6fa9c71..a1a6853 100644 --- a/Navigator/src/Platform/OpenGL/OpenGLWindow.h +++ b/Navigator/src/Platform/OpenGL/OpenGLWindow.h @@ -1,13 +1,14 @@ #ifndef OPENGL_WINDOW_H #define OPENGL_WINDOW_H +#include "Navigator/NavCore.h" #include "Navigator/Window.h" #include "Navigator/GraphicsContext.h" #include "GLFW/glfw3.h" namespace Navigator { - class OpenGLWindow : public Window + class NAV_API OpenGLWindow : public Window { public: diff --git a/premake5.lua b/premake5.lua index 0ed77be..5dedd8b 100644 --- a/premake5.lua +++ b/premake5.lua @@ -24,7 +24,6 @@ project "Navigator" kind "SharedLib" language "C++" cppdialect "C++17" - staticruntime "on" targetdir ("lib/" .. outputdir .. "/%{prj.name}") objdir ("bin-int/" .. outputdir .. "/%{prj.name}") @@ -84,8 +83,6 @@ project "Navigator" defines "NAV_LINUX" links { "GL", - "GLU", - "glut", "X11", "dl" } @@ -106,6 +103,14 @@ project "Navigator" "-pthread", "-undefined dynamic_lookup" } + filter "system:windows" + defines "NAV_EXPORT" + postbuildcommands { + ("{COPY} %{cfg.buildtarget.relpath} \"../bin/" .. outputdir .. "/NavProject/\"") + } + links { + "opengl32.lib" + } filter "configurations:Debug" defines "NAV_DEBUG" @@ -147,6 +152,7 @@ project "NavProject" systemversion "latest" filter "system:macosx" + defines "NAV_APPLE" sysincludedirs { "Navigator/vendor/spdlog/include/", "%{IncludeDirs.glfw}", @@ -154,6 +160,10 @@ project "NavProject" "%{IncludeDirs.glad}", "%{IncludeDirs.ImPlot}" } + filter "system:windows" + defines "NAV_WINDOWS" + filter "system:linux" + defines "NAV_LINUX"