Dreikblack Posted July 7, 2023 Share Posted July 7, 2023 #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 widget iVec2 sz = ui->root->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->root); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto quakeLoaderPlugin = LoadPlugin("Plugins/QuakeLoader"); //Load model WString path = AppDir(); auto pak = LoadPackage(path + "/PAK0.PAK"); ChangeDir(path); auto pixmap = LoadPixmap("gfx/bigbox.lmp"); button->SetPixmap(pixmap); //Create camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2, 0); while (true) { while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; default: ui->ProcessEvent(ev); break; } } world->Update(); world->Render(framebuffer); } return 0; } 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 19, 2023 Share Posted July 19, 2023 LMP isn't really a defined file format. This particular file reports that the width and height are both -1... https://six-of-one.github.io/quake-specifications/qkspec_3.htm#PLMP What is bigbox.lmp? Is it the background image? 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...
Dreikblack Posted July 19, 2023 Author Share Posted July 19, 2023 44 minutes ago, Josh said: What is bigbox.lmp? It was just an example. LMP are for UI images in Quake. I need weapon icons from rerelese pak0.pak (gfx/weapons). Currently have to keep ported icons in game folder. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 19, 2023 Share Posted July 19, 2023 Okay, I think it will work now. Update is available. #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 widget iVec2 sz = ui->root->ClientSize(); auto button = CreateButton("Button", sz.x / 2 - 75, sz.y / 2 - 15, 150, 30, ui->root); auto plg = LoadPlugin("Plugins/FITextureLoader"); auto quakeLoaderPlugin = LoadPlugin("Plugins/QuakeLoader"); //Load model WString path = "D:/SteamLibrary/steamapps/common/Quake/id1"; auto pak = LoadPackage(path + "/PAK0.PAK"); auto pixmap = LoadPixmap(path + "/gfx/bigbox.lmp"); Assert(pixmap); ui->root->SetPixmap(pixmap); //Create camera auto camera = CreateCamera(world, PROJECTION_ORTHOGRAPHIC); camera->SetPosition(framebuffer->size.x / 2, framebuffer->size.y / 2, 0); while (true) { while (PeekEvent()) { const Event ev = WaitEvent(); switch (ev.id) { case EVENT_WINDOWCLOSE: if (ev.source == window) { return 0; } break; default: ui->ProcessEvent(ev); break; } } world->Update(); world->Render(framebuffer); } return 0; } 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...
Dreikblack Posted July 19, 2023 Author Share Posted July 19, 2023 After update still an exception thrown, with other lmp files too. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 19, 2023 Share Posted July 19, 2023 You updated project to get the plugin? 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 July 19, 2023 Solution Share Posted July 19, 2023 I uploaded it to the wrong folder. Try again please. 1 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...
Dreikblack Posted July 19, 2023 Author Share Posted July 19, 2023 Thanks! Now it's working! Quote Link to comment Share on other sites More sharing options...
Dreikblack Posted July 19, 2023 Author Share Posted July 19, 2023 btw the editor still crashing when i'm trying to open .lmp file (probably i don't really need it, just letting you know). 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 19, 2023 Share Posted July 19, 2023 Are you sure? 1 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...
Dreikblack Posted July 20, 2023 Author Share Posted July 20, 2023 Was a case for me Updated and tried again today - now works, Quote 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.