Skip to content
Snippets Groups Projects
Commit f187f9fb authored by Armin Co's avatar Armin Co
Browse files

Refactoring

parent 270a0488
Branches
No related tags found
No related merge requests found
......@@ -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
......@@ -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;
......
......@@ -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);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment