/*
 * DISTRHO Plugin Framework (DPF)
 * Copyright (C) 2012-2022 Filipe Coelho <falktx@falktx.com>
 *
 * Permission to use, copy, modify, and/or distribute this software for any purpose with
 * or without fee is hereby granted, provided that the above copyright notice and this
 * permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
 * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
 * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

// ImGui is quite large, build it separately
#define IMGUI_SKIP_IMPLEMENTATION

#include "Application.hpp"
#include "../opengl/DearImGui.cpp"
#include "../opengl/DearImGuiColorTextEditor.cpp"

START_NAMESPACE_DGL

class DearImGuiDemo : public ImGuiStandaloneWindow
{
public:
    DearImGuiDemo(Application& app)
        : ImGuiStandaloneWindow(app) {}

protected:
    void onImGuiDisplay()
    {
        ImGui::SetNextWindowPos(ImVec2(0, 0));
        ImGui::SetNextWindowSize(ImVec2(getWidth(), getHeight()));
        ImGui::ShowDemoWindow();
    }
};

END_NAMESPACE_DGL

int main(int, char**)
{
    USE_NAMESPACE_DGL;

    Application app;
    DearImGuiDemo win(app);
    win.setGeometryConstraints(640*win.getScaleFactor(), 480*win.getScaleFactor(), false);
    win.setSize(1280*win.getScaleFactor(), 480*win.getScaleFactor());
    win.setResizable(true);
    win.setTitle("ImGui");
    win.show();
    app.exec();

    return 0;
}
