MarKli Posted October 3, 2023 Share Posted October 3, 2023 When creating it I get an access violation when reading at position 0x0000000000000000. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0]); //Create framebuffer auto framebuffer = CreateFramebuffer(window); //Create world auto world = CreateWorld(); //Load a font auto font = LoadFont("Fonts/arial.ttf"); //Create user interface auto ui = CreateInterface(world, font, framebuffer->size); //Create camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetPosition(float(framebuffer->size.x) * 0.5f, float(framebuffer->size.y) * 0.5f, 0); //Create widget iVec2 sz = ui->root->ClientSize(); auto treeview = CreateTreeView(10, 10, sz.x - 20, sz.y - 20, ui->root, TREEVIEW_DRAGANDDROP | TREEVIEW_DRAGINSERT); treeview->SetLayout(1, 1, 1, 1); auto node = treeview->root->AddNode("Node 1"); node->AddNode("Subnode 1"); node->AddNode("Subnode 2"); node->AddNode("Subnode 3"); node = treeview->root->AddNode("Node 2"); node->AddNode("Subnode 1"); node->AddNode("Subnode 2"); node->AddNode("Subnode 3"); node = treeview->root->AddNode("Node 3"); node->AddNode("Subnode 1"); node->AddNode("Subnode 2"); node->AddNode("Subnode 3"); while (true) { while (PeekEvent()) { const Event event = WaitEvent(); switch (event.id) { case EVENT_WIDGETSELECT: if (event.source == treeview and event.data == 1) { node = event.extra->As<Widget>(); Print("Selected: " + node->text); } break; case EVENT_WIDGETACTION: if (event.source == treeview) { node = event.extra->As<Widget>(); Print("Action: " + node->text); if (!node->kids.empty()) { if (node->Collapsed()) { node->Expand(); } else { node->Collapse(); } } } break; case EVENT_WIDGETDROP: { auto child = event.source->As<Widget>(); auto parent = event.extra->As<Widget>(); child->SetParent(parent, event.data); } break; case EVENT_WINDOWCLOSE: if (event.source == window) { return 0; } break; default: ui->ProcessEvent(event); break; } } world->Update(); world->Render(framebuffer); } return 0; } 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted October 8, 2023 Share Posted October 8, 2023 Working on it... Quote 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 More sharing options...
Solution Josh Posted October 8, 2023 Solution Share Posted October 8, 2023 The fix will be available in a build later today. Quote 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 More sharing options...
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.