Skip to content

September22

Mitchell Davis edited this page Oct 1, 2022 · 2 revisions

September 2022

Here is a list of updates during the month of September. Some of the updates will be mentioned here. For a full list of updates, please refer to the commit history.

This month saw two major updates. One was support for high resolution displays such as the Retina displays found on Macs. Supporting this required use of SVG images for icons so that scaling can properly occur. The other major feature is support for custom title bars. The current implementation is not quite customizable yet, but is a good first step towards that direction.

Application

Window event processing has been changed to process all possible events within a single loop. Prior to this change, each window would only process a single event per frame, which caused noticable input lag on weaker hardware. This change allows the input to feel more responsive.

A new callback 'OnFrame' has been introduced. This callback is invoked at the beginning of each frame before any window event processing occurs.

Container

Containers now have a boolean 'Clip' JSON property. This will notify the container if the contents should be clipped or not.

Credits

A Credits file has been added to properly credit projects that are used in both the library and the frontends. This also includes the license used by the project.

Frontend

Windowing

Support for forcing modal windows to always be on top. Each platform needed their own implementation to fully support this.

SDL2

Event handling has been changed to help support events which may be needed for other windows. Events for windows other than the current one being processed may be pumped and these events need to be stored for when the associated window starts processing events. On Linux, events may not have a defined window, so these events should be propagated to all windows, such as the mouse released event when outside of all windows.

Icons

The internal bitmap icons have been changed to all be 16x16 icons.

SVG versions of each icon type has been added. This helps with scaling the icon when using a high resolution display. The files are referenced through the 'Icons' JSON object. The format takes a list of key-value pairs where the key is the icon type and the value is the file name relative to the current directory.

Message Box

Initial support for message boxes. The API provides a static function that accepts a title, message, and the buttons to display. The list of supported buttons are:

  • OK
  • Yes
  • No
  • Cancel

A callback can be given and when invoked provides one of three possible responses:

  • Accept
  • Reject
  • Cancel

NanoSVG

A 3rd-party header only library has been added to aid in loading SVG files.

Resources

All files in the 'Resources' folder is copied to a 'Resources' folder in the 'bin' destination. This helps organize files so that only executable and associated files are found in the root 'bin' folder.

Tools

All tools functionality has been moved into its own interface. This is to begin the process of keeping all tools related functionality and memory allocations within a single place. This interface is accessed through the Application::Tools function.

Command Palette

A new 'messagebox' or 'mb' command has been added to test out message boxes. This command takes up to three arguments. The first argument is the title, the second argument is the message, and the third argument is the type of buttons to use. The default is to use the OK/Cancel button, but the following are possible arguments:

  • ok - OK button.
  • yesno - Yes/No buttons.
  • yesnocancel - Yes/No/Cancel buttons.

Texture Viewer

A menu bar option has been added to load a texture from the file system. Only SVG and PNG files can be loaded at the moment. More formats will be supported in the future.

Window

Some of the boolean flags to represent the state of the window has been changed to be bit flags instead.

Custom Title Bar

Each window can have a custom title bar instead of the system's title bar. The custom title bar is a container displayed above the menu bar if one exists and consists of the window title along with the minimize, maximize, and close buttons if they are not set to be hidden. This is still early so customization is not yet supported but will be in future updates.

High Resolution

Windows can now be rendered with high resolution displays such as Retina displays on Macbooks. This is achieved by calculating the render scale based on the window size and the rendering output size. The images below show the difference of rendering at low vs high resolutions.

Title Bar Buttons

The minimize and maximize button can now be hidden in both the system title bar and the custom title bar. This can be controlled through the 'CanMinimize' JSON property for the minimize button and the 'Resizable' JSON property for the maximize button.

Unit Tests

Additional tests have been added to the TextInput test suite. All string literals have been converted to use raw string literats for easier readability.

Clone this wiki locally