reepblue Posted 5 hours ago Posted 5 hours ago On most situations, I get a crash when loading a map. I first discovered this on a complex project and I thought it was me doing something stupid. Turns out, on a very basic project, the problem still happens. #include "Leadwerks.h" using namespace Leadwerks; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Leadwerks", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); auto scene = LoadScene(world, "Maps/Start.map"); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } SceneCrash.7z Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon!
Josh Posted 5 hours ago Posted 5 hours ago This has something to do with the Lua binding code being too big for the stack. When I declare this before the call to LoadScene, the program works correctly: GetLuaState(); Specifically, it's crashing in the Entity class binding code, which is probably the class with the most methods. Quote Let's build cool stuff and have fun.
Josh Posted 5 hours ago Posted 5 hours ago Another option is to increase the stack reserve size in the project settings: Properties->Configuration Properties->Linker->System->Stack Reserve Size The default value is one MB. Set this value to 4194304 to change it to four MB. Quote Let's build cool stuff and have fun.
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.