reepblue Posted March 24, 2021 Share Posted March 24, 2021 Isn't there more differences with the settings besides the compiler? I recall there being other things I had to change when I was writing my project builder for the new engine. For the record, I imported UAK to Leadwerks, and not the other way around. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2021 Share Posted March 24, 2021 8 minutes ago, reepblue said: For the record, I imported UAK to Leadwerks, and not the other way around. That is what I would recommend. 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...
Josh Posted March 24, 2021 Share Posted March 24, 2021 I successfully compiled a project that includes both. Add this code to the end of App.h in a new Leadwerks project: #undef GMF_FLOAT #undef GMF_DOUBLE #undef COPY_INSTANCE #undef COPY_DUPLICATE #undef CLEAR_COLOR #undef CLEAR_DEPTH #undef LUA_VERSION #undef STREAM_READ #undef STREAM_WRITE //Include header file #define _ULTRA_APPKIT #include "C:\\Program Files (x86)\\Steam\\\steamapps\\common\\Ultra App Kit\\Include\\UltraEngine.h" //Compile library into project #ifdef _WIN32 #ifdef _DEBUG #pragma comment (lib, "C:\\Program Files (x86)\\Steam\\\steamapps\\common\\Ultra App Kit\\Libs\\win32\\App Kit_d.lib") #else #pragma comment (lib, "C:\\Program Files (x86)\\Steam\\\steamapps\\common\\Ultra App Kit\\Libs\\win32\\App Kit.lib") #endif #endif And add this to the header search paths: C:\\Program Files (x86)\\Steam\\\steamapps\\common\\Ultra App Kit\Include That's all! It will work. Use VS2019. UAKTest.rar 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...
reepblue Posted March 24, 2021 Share Posted March 24, 2021 14 minutes ago, Josh said: That's all! It will work. Use VS2019. I'm taking this you upgrade the project to use v141 / VS2019 tools. I'll give this a go! Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted March 24, 2021 Share Posted March 24, 2021 Well, it works but the scene only updates if the mouse is moving. Not sure if I'm doing this correctly, but it's still neat. #include "App.h" int main() { UltraEngine::Print("Hello world!"); auto display = UltraEngine::ListDisplays(); shared_ptr<UltraEngine::Window> mainwindow = UltraEngine::CreateWindow("Leadwerks + UAK", 0, 0, 1024, 768, display[0], UltraEngine::WINDOW_TITLEBAR | UltraEngine::WINDOW_RESIZABLE); //Create User Interface auto ui = CreateInterface(mainwindow); auto sz = ui->root->ClientSize(); //Create widget //auto panel = CreatePanel(50, 50, sz.x - 100, sz.y - 100, ui->root); shared_ptr<UltraEngine::Window> leadwerkswindow = UltraEngine::CreateWindow("Leadwerks + UAK", 0, 0, 800, 600, mainwindow, UltraEngine::WINDOW_CHILD); Leadwerks::Window* lewindow = Leadwerks::Window::Create(leadwerkswindow->GetHandle()); Leadwerks::Context* context = Leadwerks::Context::Create(lewindow); Leadwerks::World* world = World::Create(); lewindow->SetActive(); auto button = CreateButton("Button", 850, 200, 120, 30, ui->root); if (!Map::Load("Maps/start.map")) return 1; while (!mainwindow->KeyHit(UltraEngine::KEY_END)) { if (mainwindow->Closed()) break; Leadwerks::Time::Update(); world->Update(); world->Render(); context->DrawStats(2, 2, true); context->Sync(false); const UltraEngine::Event ev = UltraEngine::WaitEvent(); if (ev.id == UltraEngine::EVENT_WIDGETACTION) { if (ev.source == button) UltraEngine::Print("I'm still active!"); } } return 0; } Something simple like this seems to work fine. #include "App.h" int main() { UltraEngine::Print("Hello world!"); auto display = UltraEngine::ListDisplays(); shared_ptr<UltraEngine::Window> mainwindow = UltraEngine::CreateWindow("Leadwerks + UAK", 0, 0, 1024, 768, display[0], UltraEngine::WINDOW_TITLEBAR); Leadwerks::Window* lewindow = Leadwerks::Window::Create(mainwindow->GetHandle()); Leadwerks::Context* context = Leadwerks::Context::Create(lewindow); Leadwerks::World* world = World::Create(); lewindow->SetActive(); if (!Map::Load("Maps/start.map")) return 1; while (!mainwindow->KeyHit(UltraEngine::KEY_END)) { if (mainwindow->Closed()) break; Leadwerks::Time::Update(); world->Update(); world->Render(); context->DrawStats(2, 2, true); context->Sync(false); } } The only benefit of doing this is tools and having more control over multiple monitors. For some reason I was thinking I could easily draw images to the context, but that's a whole different thing. Still really, cool. Maybe you should test the app kit by redoing the Leadwerks Editor. This way you have a bridge/starting point for the new editor maybe. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2021 Share Posted March 24, 2021 4 minutes ago, reepblue said: Still really, cool. Maybe you should test the app kit by redoing the Leadwerks Editor. This way you have a bridge/starting point for the new editor maybe. https://media1.giphy.com/media/SdYnnxQ30OahG/200.gif 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...
Josh Posted March 24, 2021 Share Posted March 24, 2021 Use this code in your main loop: while (UltraEngine::PeekEvent()) { const UltraEngine::Event ev = UltraEngine::WaitEvent(); if (ev.id == UltraEngine::EVENT_WIDGETACTION) { if (ev.source == button) UltraEngine::Print("I'm still active!"); } } 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...
reepblue Posted March 24, 2021 Share Posted March 24, 2021 Much better, thanks. Still deciding if this is worth doing in a LE4 game. The only upside I see is knowing what monitor to display the game on. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 24, 2021 Share Posted March 24, 2021 I think it is only useful if you want to make some custom tool. 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...
SlipperyBrick Posted March 25, 2021 Share Posted March 25, 2021 Does UAK have any functionality for changing the font of your GUI? I've been perusing through the documentation and can't seem to find any hint of loading a new font. I saw freetype in the dependencies so I assume it can be done but maybe not through UAK ? Quote Link to comment Share on other sites More sharing options...
Josh Posted March 25, 2021 Share Posted March 25, 2021 47 minutes ago, SlipperyBrick said: Does UAK have any functionality for changing the font of your GUI? I've been perusing through the documentation and can't seem to find any hint of loading a new font. I saw freetype in the dependencies so I assume it can be done but maybe not through UAK ? Not yet. The DPI scaling made this a little tricky. There is a command to change the font scale for a widget, and it will give consistent results no matter what DPI is in use. 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...
SlipperyBrick Posted March 25, 2021 Share Posted March 25, 2021 21 minutes ago, Josh said: Not yet. The DPI scaling made this a little tricky. There is a command to change the font scale for a widget, and it will give consistent results no matter what DPI is in use. Ok the "not yet" has me hopeful haha. Yeah I saw the SetFontScale(), I'll just hang in there for now and wait for further developments ? 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted March 25, 2021 Share Posted March 25, 2021 There is also a widget::SetFontWeight method but it's not official. Zero is the default weight, 600 is bold. 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...
Josh Posted March 29, 2021 Share Posted March 29, 2021 An update is available on Steam that fixes a bug with treeview sliders, where dragging the slider knob would not work correctly. I believe this was the only bug that exists in the library. 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...
Josh Posted March 29, 2021 Share Posted March 29, 2021 I am trying to make a diagram describing how the whole GUI system works: Untitled Diagram.rar 3 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...
Josh Posted March 30, 2021 Share Posted March 30, 2021 Updated program and documentation to replace ListDisplays() with GetDisplays(). 1 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...
Robert_d1968 Posted March 30, 2021 Share Posted March 30, 2021 So now, my programs name is Ultra App Kit instead of Ultra Engine. Are you merging them? Robert PS. is there any game made with this as of yet? If so I would like to see some source code as I learn faster from that. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 30, 2021 Share Posted March 30, 2021 4 hours ago, Robert_d1968 said: So now, my programs name is Ultra App Kit instead of Ultra Engine. Are you merging them? I don't understand what this means. What program is this? Where is the name? 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...
Josh Posted March 30, 2021 Share Posted March 30, 2021 4 hours ago, Robert_d1968 said: PS. is there any game made with this as of yet? If so I would like to see some source code as I learn faster from that. Ultra App Kit is not for making games, it is just for making GUI applications. Leadwerks Game Engine is our current game engine. Ultra Engine is in development and will include all the functionality of Ultra App Kit (except for 32-bit builds). 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...
reepblue Posted March 31, 2021 Share Posted March 31, 2021 12 hours ago, Josh said: Ultra App Kit is not for making games, I mean, you could make games with it but you need to be creative. ? Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
comanchetr Posted March 31, 2021 Share Posted March 31, 2021 Hello, firstly thanks a lot for this amazing framework. Now my question is; I'm starting a notepad process everytime I press a button, I push_back the process handle to a vector and update a label and show the current number of the vector's size. Like this; auto proc = CreateProcess("C:/Windows/notepad.exe"); procList.push_back(proc); label1->SetText(procList.size()); Now, when the user clicks the close button of any notepad window opened by the app, I want to catch this, close that process and remove it from the vector and update the label with current number. I don't want to periodically check the status of every process in the vector. Is there a way to emit an event every time a notepad child process closed externally? In other words instead of polling the status of the process, I want to be notified when the status is changed. Quote Link to comment Share on other sites More sharing options...
Josh Posted March 31, 2021 Share Posted March 31, 2021 Hmmmm, check out this code example: https://stackoverflow.com/questions/3556048/how-to-detect-win32-process-creation-termination-in-c It looks like something like that might work: VOID CALLBACK WaitOrTimerCallback( _In_ PVOID lpParameter, _In_ BOOLEAN TimerOrWaitFired ) { MessageBox(0, L"The process has exited.", L"INFO", MB_OK); return; } DWORD dwProcessID = 1234; HANDLE hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessID); HANDLE hNewHandle; RegisterWaitForSingleObject(&hNewHandle, hProcHandle , WaitOrTimerCallback, NULL, INFINITE, WT_EXECUTEONLYONCE); I am adding a Process::GetHandle() method now so you can gain access to the win32 process handle. 2 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...
Josh Posted March 31, 2021 Share Posted March 31, 2021 @comanchetrI also added documentation for AllocEventID(): https://www.ultraengine.com/learn/CPP/AllocEventID You can use it like this to make a new event ID for custom events: const EventID EVENT_PROCESSCLOSE = AllocEventID(); 2 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...
SlipperyBrick Posted March 31, 2021 Share Posted March 31, 2021 19 minutes ago, Josh said: @comanchetrI also added documentation for AllocEventID(): https://www.ultraengine.com/learn/CPP/AllocEventID You can use it like this to make a new event ID for custom events: const EventID EVENT_PROCESSCLOSE = AllocEventID(); Ah sick man! Thanks for this! Quote Link to comment Share on other sites More sharing options...
Josh Posted March 31, 2021 Share Posted March 31, 2021 Yeah, the advantage is that this can be used by separate pieces of code, so you don't have to worry about two different code files using the same constant for the event ID like you would if you did this: const EventID EVENT_PROCESSCLOSE = 1000; 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.