Jump to content

How to get decals from world?


Go to solution Solved by Josh,

Recommended Posts

Posted

World::GetEntities() does not have decals. How to get all decals?

#include "Leadwerks.h"
#include "ComponentSystem.h"
#include "Encryption.h"

using namespace Leadwerks;

int main(int argc, const char* argv[]) {
    RegisterComponents();

    auto cl = ParseCommandLine(argc, argv);

    //Get the displays
    auto displays = GetDisplays();

    //Create a window
    auto window = CreateWindow("Leadwerks", 0, 0, 720, 400, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

    //Create a framebuffer
    auto framebuffer = CreateFramebuffer(window);

    //Create a world
    auto world = CreateWorld();

    auto decal = CreateDecal(world);
    
    auto entities = world->GetEntities();
    Print(entities.size());

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) {

        world->Update();
        world->Render(framebuffer, false);
    }
    return 0;
}

 

  • Like 1

Check out Slipgate Tactics demo, which is made with Ultra Engine/Leadwerks 5:

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

  • Solution
Posted

Entities have to be inserted into this listed in their creation command, and I missed this one. I am adding it now...

  • Like 1

Let's build cool stuff and have fun. :)

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