Dreikblack Posted June 9, 2023 Posted June 9, 2023 #include "UltraEngine.h" #include "Components/Mover.hpp" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Scene> scene; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); btn = CreateButton("Delete", 0, 0, 100, 20, ui->root); //Create scenery auto box = CreateBox(menuWold); box->AddComponent<Mover>(); scene->AddEntity(box); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1000, 1000, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); scene = CreateScene(); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { scene->entities.clear(); } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; } 1 Quote
SpiderPig Posted June 9, 2023 Posted June 9, 2023 I re-call running into this same issue a while back... is there a RemoveComponent option? Quote
Solution Josh Posted July 19, 2023 Solution Posted July 19, 2023 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Dreikblack Posted July 20, 2023 Author Posted July 20, 2023 Fix will be later? Still have this issue after update. Quote
Josh Posted July 20, 2023 Posted July 20, 2023 Next build. The library takes a while to upload, so I tend to not update it more than once a day or so. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.