Jump to content

SlipperyBrick

Developers
  • Posts

    543
  • Joined

  • Last visited

Everything posted by SlipperyBrick

  1. There is an easier solution I have found, which uses Lua. https://premake.github.io/
  2. I have never compiled C++ code with any other compiler (I've never compiled C++ code on Linux either), I've never put a shirt on back to front, I've also never eaten cereal without milk (I'll stop with the never ever's). I took a look at this for you and I gotta say, it made me feel sick, it shook me to my very core ? All the years of technological advances in GUI's and fancy displays and we are back to the terminal window. Anyway, from some reading and watching it didn't seem too bad to pick up. I will warn you though this is my first time but, this should hopefully give you a starting point and if this doesn't help then I'm sorry and I will be buying one of those Men in Black mind erasing pens and we will all cuddle in a circle waiting for that big flash. From what I found, the general layout of these makefiles tend to follow a similar pattern, where they are made up of a set of rules: targets: prerequisites command command command Targets are the files you want to output (similar to building an executable with Visual Studio, your target application type would be a .exe). Prerequisites are the files you would like to track, consider them dependencies that you need to use in order for any commands to work. Commands are the functions run to produce the output. Lets say you have like 5 files, a main.cpp and two other .cpp and .h files (lets call them functions.cpp and functions.h and utilities.cpp and utilities.h). Those files when compiled make ".o" files (I'm pretty sure you are probably aware of this, me on the other hand ... I had no clue). If we extend this to the above pattern to achieve an automated build by calling the "make" command from your projects directory: # output is our target that is built from our C/C++ source files, it depends on all other source files that are included within it output: main.o functions.o utilities.o g++ main.o functions.o utilities.o -o output # main.o is output only when main.cpp is changed (main.o depends on main.cpp), we run g++ -c main.cpp to produce main.o main.o: main.cpp g++ -c main.cpp # functions.o is output only when functions.cpp or functions.h is changed (functions.o depends on functions.cpp and functions.h), we run g++ -c functions.cpp to produce functions.o functions.o: functions.cpp functions.h g++ -c functions.cpp # utilities.o is output only when utilities.cpp or utilities.h is changed (utilities.o depends on utilities.cpp and utilities.h), we run g++ -c utilities.cpp to produce utilities.o utilities.o: utilties.cpp utilities.h g++ -c utilities.cpp # clean is a command that can be executed to remove all ".o" files (consider this to be very similar to running "Clean solution" in Visual Studio, you know ... when it removes all of your intermediary files and folders) clean: rm *.o output There are some subtle syntax shenanigans at play here too, like you have to have 4 spaces before each command. I found this for you which goes further than my explanation and there are some nice code examples too. Depending on how much time you really want to put into this I'm sure you could do some very complex automated build tasks (and it would certainly set you up in the long run). What I mentioned above though should get you by, although all those source files you have would be really tedious to have to type, you can do something called "pattern rules" which can form expressions to define more complex rules than the ones I wrote above. Good luck!
  3. I believe the library wraps around the Win32 API. Of course Windows has had many features since Windows 7 and DPI scaling per monitors is one of them (which introduced other things such as dynamic scaling). Also "disabling" this would break other things such as DPI awareness (which again Windows 7 doesn't support). I think you really only have one option, which is to upgrade to Windows 10. Here is some further information regarding the efforts that went into DPI scaling for Windows 10 https://docs.microsoft.com/en-gb/archive/blogs/askcore/display-scaling-in-windows-10
  4. Congrats on the release. Keep up the great work Josh! I'm praying to GUI Jesus every night that we will get the ability for custom fonts in UAK. In return, I've promised a good deed. To stop my cat from s***ing in my neighbours garden.
  5. Looks like a good contender for articy:draft. Very cool idea and would certainly help formalise the game design/requirements gathering phase of a game project ?
  6. Nice man! I'd be interested in seeing your progress. I agree, shapes would be a welcomed addition (as well as custom fonts). I think UAK would be a complete solution then that would probably overtake IMGUI and other similar GUI libraries
  7. I'm currently porting over my OpenGL renderer into my newest solution which is an application that will have a UAK GUI. I've not been able to completely focus on this at the moment as I have a bunch of University assignments I need to finish before start my masters research project. My end goal is to have an application that meets my current requirements for my research project (real-time neural supersampling, think NVIDIA DLSS but without NVIDIA hardware). I'll write a short blog when I get back to working on it on how I managed to get modern OpenGL and UAK into my project (I've seen a few people ask about this in a couple of other posts). Out of interest why would you want to use IMGUI with UAK? UAK pretty much does the same thing bar the fact that IMGUI is an immediate-mode GUI library. Personally I think UAK is actually better than IMGUI right now and offers so much more (GUI events, process handling, window creation and management, multi-threading) not to mention the whole library is wrapped in smart pointers ?
  8. One of the methods I use in my concrete classes (that derives from my Layer base class) is OnEvent(). With the event class UAK provides this gives some amazing flexibility, I pass an UltraEngine::Event as a reference to my OnEvent() methods and now I can iterate through all events in my applications layerstack. Applications Run(): void Application::Run() { // Initialize applications GUI OnInit(); while (!m_Window->Closed()) { if (!m_Window->Minimized()) { // Update all the applications layers in the layer stack for (Layer* layer : m_LayerStack) { layer->OnUpdate(m_TimeStep); } // Check if any events exist in the event queue if (UltraEngine::PeekEvent()) { // Return the oldest event from the event queue UltraEngine::Event e = UltraEngine::WaitEvent(); // Process the event (s_Instance is the instance of the application) s_Instance->OnEvent(e); } } } } Applications OnEvent(): void Application::OnEvent(UltraEngine::Event& e) { // Event callbacks go here UltraEngine::ListenEvent(e.id, s_Instance->GetWindow(), Application::OnWindowResize); // Traverse the applications layer stack to handle events for (auto it = m_LayerStack.end(); it != m_LayerStack.begin(); ) { (*--it)->OnEvent(e); } } Callback OnWindowResize(): bool Application::OnWindowResize(const UltraEngine::Event& e, std::shared_ptr<UltraEngine::Object> o) { if (e.id == UltraEngine::EVENT_WINDOWSIZE) { ... } return true; } Every layer in the layerstack has an OnEvent() which passes an Ultra Engine event. This allows me to call ListenEvent in each layers class and also allows me to implement the event callback in each layers class too. void SmartexGUILayer::OnEvent(UltraEngine::Event& e) { UltraEngine::ListenEvent(e.id, Application::Get()->GetWindow(), SmartexGUILayer::OnSomeButtonThatIsPressed); } GUI widget events I can handle now in my SmartexGUILayer class by calling ListenEvent in its OnEvent() and implementing the event callback in there too. UAK has made it real easy ?
  9. I would recommend to check out post build events in Visual Studio if you wish to add any kind of content that your application will use (that is if you are even using Visual Studio). Post build events allow you to run commands post build (yeah, pretty obvious haha). This gives you the opportunity to do things like copy directories over for resources you have used in your application, for example lets say you used some nice looking icons for your GUI you will want to make sure your release target directory has all the appropriate folders and files for those to be packaged in your final target directory. Failing to do this will give you some nasty surprises (not really nasty surprises, its fairly obvious that any resources you use within your Visual Studio project won't be present in your built binary folder) when you run your application outside of the Visual Studio environment. If you are trying to change your applications default icon for some branding purposes then I did post an example a few pages from here in this thread
  10. I've already started some designs on the backend of my application and I gotta say, UAK fits so well into all of this (I've not stumbled upon any limitations). There is so much room for code abstraction, it can pretty much conform to whatever design an application requires. The pattern I tend to follow when making a robust system is to have an Application class that contains a list of layers. Layers are my abstraction for other components of my application. I have various interfaces for each layer and my concrete classes derive from those for their implementations. In my applications run loop I simply iterate over all layers in the applications layer stack to execute their code. Following good programming practices such as DRY and SOLID this gives a pretty extendable architecture to your codebase. Thanks for the video tutorials for some of the code examples in the docs too, very welcomed stuff!
  11. 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 ?
  12. 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 ?
  13. What a painful experience. For anyone who is looking to do the same you need to follow this process: In Solution Explorer find the "Resource Files" folder (if you work in "Show all files" mode like I do you may need to switch to see the folder) Right click "Resource Files" folder and select Add > Resource... From the window dialog select "Icon" and choose "Import" (your icon must be .ico format) With those steps complete, head over to wherever you have created your window and add the following code: // Get device context HWND hwnd = m_Window->GetHandle(); HDC hdc = GetDC(hwnd); // Load the icon for window titlebar and taskbar HICON icon = LoadIconA(GetModuleHandle(NULL), (LPCSTR)IDI_ICON1); SendMessage(hwnd, WM_SETICON, ICON_SMALL, reinterpret_cast<LPARAM>(icon)); I would recommend to clean up your projects directory by added a "res" folder and dragging in the files that were created when you added a resource to your project. P.S. It should go without saying but whatever variable name you have provided for your window (mine is m_Window) replace that with your own.
  14. Ugh I hate Windows haha. How the heck do you change the titlebar default icon to one of your own. Stackoverflow and the Win32 documentation is sending me on a wild goose chase. I have added a resource and selected my .ico file but from there it seems a mystery to use the icon in the windows titlebar ?
  15. That's my personalise settings in Windows 10. If you right-click your desktop and go to Personalise > Colours. Scroll to the bottom of the window and you'll see "Show the accent colour on the following surfaces". You can check "Title bars and window borders" from there. The colour I have is called Storm.
  16. The start of my GUI with Ultra App Kit (the empty space underneath the 3D viewport will have a console for output). Such a friendly API though, really easy to work with and it really doesn't take much to get great results! ? Josh you are a GUI fiend! Thanks for sharing this with us and not locking it away from the world ??
  17. Ok problem solved. I use Affinity Designer to draw my vector graphics and I realised that my logo wasn't pixel perfect. After some adjustments (drawing it again) its looking great!
  18. There seems to be a typo in the documentation for the LoadIcon() method. The return type is a std::shared_ptr<Icon>, yet the documentation says it is a std::shared_ptr<Pixmap>. I am also having some issues displaying an icon. According to the documentation SetIcon() passes a path to a vector image, I am calling this on a panel object. Yet when I display my loaded vector image it looks pretty bad. The image format is a .svg so I'm not entirely sure how it is being displayed like this.
  19. The treeview isn't going to do anything as there is no functionality programmed for it. The example code simply renders a GUI to the window along with a viewport with some OpenGL code. It is down to you to start using UAK and leveraging the awesome GUI's you can create with it to accommodate your applications functionality. I'd recommend to try something simple to start with, for example you could try and change the colour of the triangle using a button widget. Maybe style it so the buttons are radio buttons that are encapsulated in a panel object. The hierarchy of a GUI (if you dissect the documentation examples) is as follows: You have a window (a context to render the GUI) You have an interface (a container for holding panels and widgets) You have a panel (optional, although handy for encapsulating various components of your GUI) You have the widgets (buttons, treeviews, labels, etc) I'd maybe start by trying to code your way down the hierarchy. Make a window first, then an interface for the window, then a panel, then add some widgets to it. Hope that helps!
×
×
  • Create New...