#include "DesktopManager.h"
#include "XcbInterface.h"

#include "TestCase.h"
#include "TestCaseRunner.h"

#include <memory>
#include <string>
#include <iostream>

class TestOpenGlRendering : public TestCase
{
public:
    bool Run() override
    {
        auto desktopManager = DesktopManager::Create();

        auto mainWindow = desktopManager->GetWindowManager()->GetMainWindow();
        mainWindow->SetSize(800, 600);

        XcbInterface window_interface(desktopManager.get());
        window_interface.setUseHardwareRendering(true);
        window_interface.initialize();
        window_interface.addWindow(mainWindow);
        window_interface.showWindow(mainWindow);
        window_interface.loop();
        window_interface.shutDown();

        return true;
    }
};

int main()
{
    TestCaseRunner runner;
    runner.AddTestCase("TestOpenGlRendering", std::make_unique<TestOpenGlRendering>());

    const auto testsPassed = runner.Run();
    return testsPassed ? 0 : -1;
}
