-
Posts
516 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Downloads
Everything posted by Dreikblack
-
Lasts updates in beta branch reduced peromance a lot in debug
Dreikblack replied to Dreikblack's topic in Bug Reports
With latest update it's better than it was before last update but still worse than prev stable build -
Press Change display to recreate a window and get an error. btw UI now seems to be working now on my 2nd screen. #include "UltraEngine.h" 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<Widget> btn2; bool fullscreen = false; int displayId = 0; 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("Change display", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2, 200, 200, ui->root); btn->SetFontScale(2.0f); btn2 = CreateButton("Fullscreen", (float)framebuffer->GetSize().x / 2, framebuffer->GetSize().y / 2 - 100, 120, 30, ui->root, BUTTON_CHECKBOX); if (fullscreen) btn2->SetState(WIDGETSTATE_SELECTED); } void changeDisplay() { auto displays = GetDisplays(); displayId = ++displayId; if (displayId == displays.size()) { displayId = 0; } if (!fullscreen) { window = CreateWindow("Ultra Engine", 0, 0, 1000, 1000, GetDisplays()[displayId], WINDOW_DEFAULT); } else { window = CreateWindow("Ultra Engine", 0, 0, displays[displayId]->GetSize().width, displays[displayId]->GetSize().height, displays[displayId], WINDOW_DEFAULT | WINDOW_FULLSCREEN); } framebuffer = CreateFramebuffer(window); initGui(); } 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); //Create scenery auto box = CreateBox(menuWold); 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) { changeDisplay(); } if (ev.source == btn2 && ev.id == EVENT_WIDGETACTION) { fullscreen = !fullscreen; } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
-
Look at 123 line loadingWorld->Render(framebuffer); I was doing similar thing to show loading screen when main menu was loading #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; shared_ptr<World> gameWorld; shared_ptr<Interface> gameUi; shared_ptr<World> loadingWorld; shared_ptr<Interface> loadingUi; shared_ptr<Camera> loadingCamera; shared_ptr<Camera> uiCamera; shared_ptr<Map> gameScene; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<Widget> menuPanel; bool isMenuOn = false; bool isMainMenuOn = true; bool resumeGameButtonCallback(const Event& ev, shared_ptr<Object> extra) { menuPanel->SetHidden(true); isMenuOn = false; return true; } bool mainMenuButtonCallback(const Event& ev, shared_ptr<Object> extra) { isMainMenuOn = true; return true; } bool newGameButtonCallback(const Event& ev, shared_ptr<Object> extra) { isMainMenuOn = false; return true; } bool exitButtonCallback(const Event& ev, shared_ptr<Object> extra) { exit(0); return true; } void guiInit() { // Load a font auto font = LoadFont("Fonts/arial.ttf"); // Create user interface gameUi = CreateInterface(gameWorld, font, framebuffer->GetSize()); gameUi->SetRenderLayers(2); gameUi->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); // Create ui camera uiCamera = CreateCamera(gameWorld, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); int menuWidth = 200; int menuHeight = 200; int indent = 25; menuPanel = CreatePanel(framebuffer->size.x * 0.5 - menuWidth / 2, framebuffer->size.y * 0.5 - menuHeight / 2, menuWidth, menuHeight, gameUi->root); menuPanel->SetColor(0.2, 0.2, 0.2, 1); menuPanel->SetLayout(1, 1, 1, 1); menuPanel->SetHidden(true); int buttonWidth = menuWidth - indent * 2; int buttonHeight = 50; int posIter = 0; int buttonY = indent + posIter * (buttonHeight + indent); auto resumeButton = CreateButton("Resume", indent, buttonY, buttonWidth, buttonHeight, menuPanel); ListenEvent(EVENT_WIDGETACTION, resumeButton, resumeGameButtonCallback); posIter = posIter + 1; buttonY = indent + posIter * (buttonHeight + indent); auto mainMenuButton = CreateButton("Main Menu", indent, buttonY, buttonWidth, buttonHeight, menuPanel); ListenEvent(EVENT_WIDGETACTION, mainMenuButton, mainMenuButtonCallback); } int main(int argc, const char* argv[]) { RegisterComponents(); //Load FreeImage plugin (optional) auto fiplugin = LoadPlugin("Plugins/FITextureLoader"); //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Load a font auto font = LoadFont("Fonts/arial.ttf"); // LOADING loadingWorld = CreateWorld(); loadingUi = CreateInterface(loadingWorld, font, framebuffer->GetSize()); loadingUi->SetRenderLayers(2); loadingUi->root->SetColor(0.5f, 0.5f, 0.5f, 1.0f); float labelHeight = float(framebuffer->GetSize().y) * 0.2f; int centerX = float(framebuffer->GetSize().x) * 0.5f; int centerY = float(framebuffer->GetSize().y) * 0.5f; auto loadingLabel = CreateLabel("LOADING...", float(framebuffer->GetSize().x) * 0.05f, centerY - labelHeight * 0.5f, float(framebuffer->GetSize().x) * 0.95f, labelHeight, loadingUi->root, LABEL_CENTER | LABEL_MIDDLE); float fonstScale = labelHeight / 14.0f; loadingLabel->SetFontScale(fonstScale * 0.5f); loadingCamera = CreateCamera(loadingWorld, PROJECTION_ORTHOGRAPHIC); loadingCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); loadingCamera->SetRenderLayers(2); loadingCamera->SetClearMode(CLEAR_DEPTH); //CAUSES AN ISSUE loadingWorld->Render(framebuffer); //Create user interface auto ui = CreateInterface(world, font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.2f, 0.2f, 0.2f, 1.0f); //Create ui camera auto uiCamera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition(float(framebuffer->GetSize().x) * 0.5f, float(framebuffer->GetSize().y) * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); auto newGameButton = CreateButton("New game", 200, 125, 200, 50, ui->root); ListenEvent(EVENT_WIDGETACTION, newGameButton, newGameButtonCallback); auto exitButton = CreateButton("Exit", 200, 200, 200, 50, ui->root); ListenEvent(EVENT_WIDGETACTION, exitButton, exitButtonCallback); gameWorld = CreateWorld(); gameWorld->RecordStats(); WString mapName = "Maps/start.ultra"; gameScene = LoadMap(gameWorld, mapName); guiInit(); shared_ptr<World> currentWorld = world; shared_ptr<Interface> currentUI = ui; while (window->Closed() == false) { if (isMainMenuOn) currentWorld = world; else currentWorld = gameWorld; if (isMainMenuOn) currentUI = ui; else currentUI = gameUi; if (window->KeyDown(KEY_ESCAPE) == true) { menuPanel->SetHidden(false); isMenuOn = true; window->SetMousePosition(framebuffer->size.x * 0.5, framebuffer->size.y * 0.5); } while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { exit(0); break; } break; case EVENT_STARTRENDERER: if (ev.data == 0) { Print("Error: Renderer failed to initialize."); Notify("Renderer failed to initialize.", "Error", true); return 0; } break; default: currentUI->ProcessEvent(ev); break; } } currentWorld->Update(); currentWorld->Render(framebuffer); } return 0; }
-
Before first render only first button had new color which looks correct After applying same half-transparent color to both buttons in real time. #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; shared_ptr<Widget> btn2; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(1.0f, 0.0f, 0.0f, 1.0f); uiCamera = CreateCamera(world, 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("Btn", 20, 20, 100, 100, ui->root); btn2 = CreateButton("Btn", 20, 150, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); auto color = Vec4(0.5, 0, 1, 0.5f); btn->SetColor(color); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyDown(KEY_SPACE)) { btn->SetColor(color); btn2->SetColor(color); } world->Update(); world->Render(framebuffer); } return 0; }
-
#include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> world; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> btn; static bool EventCallback(const Event& e, shared_ptr<Object> extra) { Print("Callback"); return true; } void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(world, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(world, 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("Btn", 20, 20, 100, 100, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 300, 300, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world world = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0, 0, 0); initGui(); ListenEvent(EVENT_DATA, NULL, EventCallback, btn); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyDown(KEY_SPACE)) { Print(btn.use_count()); EmitEvent(EVENT_DATA, btn); Print(btn.use_count()); } world->Update(); world->Render(framebuffer); } return 0; }
-
No. I doubt it would be possible due legal reasons. Also it probably requires to 100$ and some data to fill in which is probably not possible in my region atm. Anyway i want to make a demo first and i will probably create a page at itch.io once it's ready.
-
1. Create a brush. 2. Apply a texture with console commands: local texture = LoadTexture("/Materials/Developer/trigger.dds") local material = CreateMaterial() material:SetTexture(texture) local selected = program:GetSelection() for n = 1, #selected do local currentBrush = Brush(selected[n].entity) if currentBrush ~= nil then currentBrush:SetMaterial(material) currentBrush:Build() end end 3. Save map - material can be seen in .ultra file. 4, Save map again - material is gone, Brush still have a line in .ultra: "material": 1
-
Same problem with Brush #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.8); camera->Move(3, 0, -2); camera->SetDebugPhysicsMode(true); auto unlitMaterial = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.json"); unlitMaterial->SetShaderFamily(unlitShader); int width = 2, height = 1, length = 3; auto brush = CreateBrush(world); brush->AddVertex(0, 0, 0); //S brush->AddVertex(-width * 0.5, -height * 0.5, length);//NW brush->AddVertex(width * 0.5, -height * 0.5, length);//NE auto face = brush->AddFace(); face->AddIndice(0);//S face->AddIndice(1);//NW face->AddIndice(2);//NE brush->AddVertex(-width * 0.5, height * 0.5, length);//NW h brush->AddVertex(width * 0.5, height * 0.5, length);//NE h face = brush->AddFace(); face->AddIndice(0);//S face->AddIndice(3);//NW h face->AddIndice(4);//NE h face = brush->AddFace();//left face->AddIndice(0); face->AddIndice(1); face->AddIndice(3); face = brush->AddFace();//"face" face->AddIndice(1); face->AddIndice(2); face->AddIndice(4); face->AddIndice(3); face = brush->AddFace();//right face->AddIndice(2); face->AddIndice(4); face->AddIndice(0); //Finalize the coneModel brush->Build(); world->SetAmbientLight(1); //auto& mat = unlitMaterial; auto mat = CreateMaterial(); mat->SetTransparent(true); brush->SetMaterial(mat); //model->SetColor(0.5f, 0.8f, 0, 0.25f); brush->SetPosition(0, 0, 0); Vec3 targetPos(-2, 0, 0); auto box = CreateBox(world, 0.1f); box->SetPosition(targetPos); auto mover = box->AddComponent<Mover>(); mover->movementspeed.x = 0.2; brush->Turn(0, 90, 0); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { targetPos = box->GetPosition(); auto newTargetPos = TransformPoint(targetPos, nullptr, brush); bool isInside = brush->GetCollider()->IntersectsPoint(newTargetPos); if (isInside) { brush->SetColor(0, 0.5, 0, 0.5); } else { brush->SetColor(0.5, 0.5, 0.5, 0.5); } world->Update(); world->Render(framebuffer); } return 0; }
-
After save: After load: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetPosition(0, 1, -4); //Create light auto light = CreateBoxLight(world); light->SetRange(-10, 10); light->SetArea(15, 15); light->SetRotation(45, 35, 0); light->SetColor(2); //Create the ground auto ground = CreateBox(world, 20, 1, 20); ground->SetPosition(0, -0.5, 0); ground->SetColor(0, 1, 0); //Create a scene auto scene0 = CreateMap(); scene0->AddEntity(ground); scene0->AddEntity(light); ground = NULL; light = NULL; auto scene = CreateMap(); //Add some boxes for (int n = 0; n < 2; ++n) { auto box = CreateBox(world); box->SetColor(0, 0, 1); box->SetPosition(Random(-5, 5), Random(5, 10), Random(-5, 5)); box->SetMass(1); scene->AddEntity(box); } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_A)) { auto box = CreateBox(world); box->SetColor(1, 0, 1); box->SetPosition(1, 1, 1); box->SetMass(1); scene->AddEntity(box); } if (window->KeyHit(KEY_D)) { for (auto box : scene->entities) { if (box->As<Model>()) scene->RemoveEntity(box); break; } } if (window->KeyHit(KEY_S)) { //Save the scene to a file scene->Save("game.sav"); } //Load the scene when space key is pressed if (window->KeyHit(KEY_SPACE)) { scene = LoadMap(world, "game.sav"); } world->Update(); world->Render(framebuffer); } return 0; }
-
Can be added some method like SetWindow to interface? It would be more convenient to use than ActiveWindow when widget getting initialized since it could be null sometimes (when not window is not active obv.).
-
Main visible changes in this year so far: FPS limiter; Settings splitted into categories with custom tabber; Sounds effect volume setting added. Also for music too but no music in game atm; Default button added to settings for resetting; Modal dialog appears if window restart needed (for applying new resolution, localization etc.); Special hotkeys for weapons added; Controls can be now customized in settings. Control list can be scrolled with mouse scroll; Some buttons have tooltips now. It shows what to press to customize an action hotkeys for example; Camera reworked to have a smooth rotation around a potential target at center of screen instead of 90 degree rotations; Camera can be moved now with cursor near window borders; Cursor changes a color above units and tiles; New in-game menu; Fixed drag'n'drop for inventory (was not smooth and could be stuck if the cursor was out of window etc.). Also dragged item is now highlighted; Unit bars reworked into new non-interactive custom sprite UI for improving performance; Also as sprite were added lines that connect units and their bars; Fixed positional sounds; Units now uses movement points to resist being pushed by enemies; Action points are now being used as movement points for "sprinting", dodging range attacks, push resistance etc. Now attacks can be blocked or dodged only from a front Two arcs that look like a circle together under units - their colors show unit team and selection state. Front colors into action or movement color if being targeted by a player from front. Unit can be rotated by holding Ctrl (by default) into mouse position. Super Shotgun added - can shoot from both barrels to do double damage and double push. Also push back a shooter. It's only weapon that require manual reload (no indicator for ammo yet)
-
#include "UltraEngine.h" 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> panel; 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); panel = CreatePanel(10, 50, 64, 64, ui->root, PANEL_DEFAULT); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); menuWold->RecordStats(); //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); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { { auto uiWindow = ui->GetWindow(); if (uiWindow) Print("Interface provided a window"); else Print("No window provided"); } } menuWold->Update(); menuWold->Render(framebuffer, false); } return 0; }
-
Lasts updates in beta branch reduced peromance a lot in debug
Dreikblack replied to Dreikblack's topic in Bug Reports
FPS is lower in beta in compare with stable branch even before i init GUI and load icons -
Release also have lower fps but difference is not that noticeable. "Benchmark" test with stable build: Beta branch: Example code: #include "UltraEngine.h" 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> panel; shared_ptr<Icon> icon1; shared_ptr<Icon> icon2; bool isFirst = true; 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); panel = CreatePanel(10, 50, 64, 64, ui->root, PANEL_DEFAULT); icon1 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); icon2 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/new.svg"); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); menuWold->RecordStats(); //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); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { if (!ui) initGui(); isFirst = !isFirst; if (isFirst) { panel->SetIcon(icon1); } else { panel->SetIcon(icon2); } } window->SetText("FPS: " + String(menuWold->renderstats.framerate)); menuWold->Update(); menuWold->Render(framebuffer, false); } return 0; }
-
Works for me with original .json from top post. Try to create new component via editor with + button btw maybe some letter is not latin? Like Cyrillic 'C' instead of English one in folder and file name.
-
No, with removed lights it does not. Tried return lights - happens again right away.
-
Well, it's very inconsistent i guess. Can only suggest to try again Steam beta, latest update, even created new project for latest test - 4th attempt (enter press) caused a crash, st and 2nd after that.
-
Made a prefab from player from default map, dragged to a map - no ThirdPersonControls component in it.
-
Yes
-
One crash fixed and 2nd still happens if you comment out one line that i mentioned in first post. Just to make sure you know what i mean i post code it again with commented line #include "UltraEngine.h" #include "ComponentSystem.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { RegisterComponents(); auto fiplugin = LoadPlugin("Plugins/FITextureLoader"); auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); WString mapname = "Maps/start.ultra"; auto scene = LoadMap(world, mapname); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyDown(KEY_ENTER)) { // world = CreateWorld(); scene = LoadMap(world, mapname); } world->Update(); world->Render(framebuffer); } return 0; }