diff --git a/App/QPongApp.cpp b/App/QPongApp.cpp index 1c6a6b70c6021564763b072a72aa860f07b5dc89..f2953e6a72cf2981edc27c8d79c67687194ba984 100644 --- a/App/QPongApp.cpp +++ b/App/QPongApp.cpp @@ -3,17 +3,15 @@ /// #include <memory> - #include <GuiCore/Application.hpp> - #include "MainMenuLayer.hpp" #include "GameLayer.hpp" #include "Log.hpp" + class App : public GuiCore::Application { public: - App() - : Application("QPong Application") + App() : Application("QPong Application") { QPong::Log::setup(); pushLayer(std::make_shared<QPong::MainMenuLayer>()); @@ -23,9 +21,6 @@ public: int main() { std::unique_ptr<App> app = std::make_unique<App>(); - - QPong::Log::get()->info("Have fun!"); - app->run(); return 0; } \ No newline at end of file diff --git a/App/Window.hpp b/App/Window.hpp index 8935dc4bf86327900adc4f535b39fdcc09c3afc8..2682da42e242508366195e31272b57530856af64 100644 --- a/App/Window.hpp +++ b/App/Window.hpp @@ -18,14 +18,11 @@ public: virtual ~Window(); void onUpdate() override; - uint32_t getWidth() const override; uint32_t getHeight() const override; - virtual void setEventCallback(const std::function<void(GuiCore::Event&)>) override; void setVSync(bool enabled) override; bool isVSyncEnabled() const override; - void* getNativeWindow() const override; private: @@ -40,7 +37,6 @@ private: uint32_t width; uint32_t height; bool vSyncEnabled; - std::function<void(GuiCore::Event&)> eventCallback; }; Data m_data; diff --git a/GuiCore/Application.cpp b/GuiCore/Application.cpp index 7d2e73782aef8b0afdfc8d30a329ad474ea139af..7df6bb292599aab6919627c46e76f0fc508d0dd2 100644 --- a/GuiCore/Application.cpp +++ b/GuiCore/Application.cpp @@ -19,8 +19,11 @@ namespace GuiCore Log::setup(); s_instance = this; m_window = std::unique_ptr<IWindow>(IWindow::create({name, width, height})); - m_window->setEventCallback([this](auto &&... args) -> decltype(auto) { - return this->onEvent(std::forward<decltype(args)>(args)...); }); + m_window->setEventCallback( + [this](auto &&... args) -> decltype(auto) + { + return this->onEvent(std::forward<decltype(args)>(args)...); + }); m_guiLayer = std::make_shared<ImGuiLayer>(); pushLayer(m_guiLayer); }