Jump to content

Render crash if reCreateWorld same world


Dreikblack
 Share

Go to solution Solved by Dreikblack,

Recommended Posts

Default start map from template

Happens after first enter press:

image.thumb.png.9924bf4480f3c4f3b5c7b2f9abdb6d68.png

Comment in loop "world = CreateWorld();" to get another render crash (RecordDraw) but it's not consistent and may take several attempts (Andy have this issue i believe):

image.thumb.png.93acc1bea7b92a7e6af4b803a5cb61e4.png

#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;
}

 

  • Thanks 1
Link to comment
Share on other sites

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;
}

 

Link to comment
Share on other sites

Using a new project and the current beta branch on Steam, I copied this code into the main.cpp file, ran it, pressed the enter key about 10 times to reload the map, with no errors.

https://www.ultraengine.com/community/topic/63031-render-crash-if-recreateworld-same-world/?do=findComment&comment=305162

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • 4 weeks later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...