<commit_before>#include <Dusk/Dusk.hpp>

#include <Dusk/Log.hpp>
#include <Dusk/Module.hpp>
#include <Dusk/ScriptConsole.hpp>
#include <Dusk/Graphics/GraphicsDriver.hpp>
#include <Dusk/Graphics/TransformData.hpp>
#include <Dusk/Scene/AxisComponent.hpp>
#include <Dusk/Scene/MeshComponent.hpp>
#include <Dusk/Scene/Entity.hpp>
#include <Dusk/Scene/Scene.hpp>
#include <Dusk/Scene/Camera.hpp>

#include <Dusk/Event.hpp>

#include <thread>

void testFunc(const Dusk::WindowResizedEventData * data)
{
    DuskLogInfo("testFunc %s %s", 
        glm::to_string(data->Delta), 
        glm::to_string(data->Size));
}

int main(int argc, char** argv)
{
    Dusk::SetApplicationName("HelloWorld");
    Dusk::SetApplicationVersion({ 1, 0, 0 });

    Dusk::Initialize(argc, argv);
    if (!Dusk::RunScriptFile("Assets/Scripts/Main.py")) {
        DuskLogError("Failed to load Main.py");
        return 1;
    }

    Dusk::ScriptConsole::Initialize();

    Dusk::UpdateContext updateContext;
    Dusk::RenderContext renderContext;

    {
        Dusk::Scene scene;
        Dusk::Camera camera;
        camera.SetPosition({ 10, 10, 10 });
        camera.SetLookAt({ 0, 0, 0 });

        // scene.AddComponent(std::make_unique<Dusk::AxisComponent>());

        auto transformData = renderContext.GetTransformData();
        transformData->View = camera.GetView();
        transformData->Projection = camera.GetProjection();

        // if (!scene.LoadFromFile("Models/cube.obj")) {
        //     DuskLogError("Failed to load Models/cube.obj");
        // }

        auto actor = scene.AddChild(std::make_unique<Dusk::Entity>());
        auto mesh = std::make_unique<Dusk::MeshComponent>();
        mesh->LoadFromFile("Assets/Models/crate/crate.obj");
        actor->AddComponent(std::move(mesh));

        auto gfx = Dusk::GetGraphicsDriver();

        Dusk::WindowResizedEventData testData;
        testData.Size = { 1024, 768 };
        testData.Delta = { 0, 0 };
        gfx->WindowResizedEvent.Call(&testData);

        auto shader = gfx->CreateShader();
        shader->LoadFromFiles({
           "flat.vert",
           "flat.frag",
        });

        Dusk::SetRunning(true);

        while (Dusk::IsRunning()) {
            gfx->ProcessEvents();

            scene.Update(&updateContext);

            Dusk::ScriptConsole::Update();

            shader->Bind();
            scene.Render(&renderContext);

            gfx->SwapBuffers();
        }
    }
<commit_msg>Fix Delta bugs in HelloWorld<commit_after>#include <Dusk/Dusk.hpp>

#include <Dusk/Log.hpp>
#include <Dusk/Module.hpp>
#include <Dusk/ScriptConsole.hpp>
#include <Dusk/Graphics/GraphicsDriver.hpp>
#include <Dusk/Graphics/TransformData.hpp>
#include <Dusk/Scene/AxisComponent.hpp>
#include <Dusk/Scene/MeshComponent.hpp>
#include <Dusk/Scene/Entity.hpp>
#include <Dusk/Scene/Scene.hpp>
#include <Dusk/Scene/Camera.hpp>

#include <Dusk/Event.hpp>

#include <thread>

void testFunc(const Dusk::WindowResizedEventData * data)
{
    DuskLogInfo("testFunc %s", 
        glm::to_string(data->Size));
}

int main(int argc, char** argv)
{
    Dusk::SetApplicationName("HelloWorld");
    Dusk::SetApplicationVersion({ 1, 0, 0 });

    Dusk::Initialize(argc, argv);
    if (!Dusk::RunScriptFile("Assets/Scripts/Main.py")) {
        DuskLogError("Failed to load Main.py");
        return 1;
    }

    Dusk::ScriptConsole::Initialize();

    Dusk::UpdateContext updateContext;
    Dusk::RenderContext renderContext;

    {
        Dusk::Scene scene;
        Dusk::Camera camera;
        camera.SetPosition({ 10, 10, 10 });
        camera.SetLookAt({ 0, 0, 0 });

        // scene.AddComponent(std::make_unique<Dusk::AxisComponent>());

        auto transformData = renderContext.GetTransformData();
        transformData->View = camera.GetView();
        transformData->Projection = camera.GetProjection();

        // if (!scene.LoadFromFile("Models/cube.obj")) {
        //     DuskLogError("Failed to load Models/cube.obj");
        // }

        auto actor = scene.AddChild(std::make_unique<Dusk::Entity>());
        auto mesh = std::make_unique<Dusk::MeshComponent>();
        mesh->LoadFromFile("Assets/Models/crate/crate.obj");
        actor->AddComponent(std::move(mesh));

        auto gfx = Dusk::GetGraphicsDriver();

        Dusk::WindowResizedEventData testData;
        testData.Size = { 1024, 768 };
        gfx->WindowResizedEvent.Call(&testData);

        auto shader = gfx->CreateShader();
        shader->LoadFromFiles({
           "flat.vert",
           "flat.frag",
        });

        Dusk::SetRunning(true);

        while (Dusk::IsRunning()) {
            gfx->ProcessEvents();

            scene.Update(&updateContext);

            Dusk::ScriptConsole::Update();

            shader->Bind();
            scene.Render(&renderContext);

            gfx->SwapBuffers();
        }
    }

{'fraction_non_alphanumeric': 0.15435274747890512, 'fraction_numerical': 0.008643753858818687, 'mean_word_length': 2.875598086124402, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 58, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6696534', 'n_tokens_mistral': 1578, 'n_tokens_neox': 1504, 'n_words': 241}