Kickstarter campaign is Live!
Jump to content

Render crash if reCreateWorld same world


Go to solution Solved by Dreikblack,

Recommended Posts

Posted

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

Check out Slipgate Tactics - turn based tactics Quake fan game, which is made with Ultra Engine/Leadwerks 5:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

Posted

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

 

Check out Slipgate Tactics - turn based tactics Quake fan game, which is made with Ultra Engine/Leadwerks 5:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

  • 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.

×
×
  • Create New...