{"id":20113041,"url":"https://github.com/yottaawesome/onyx32","last_synced_at":"2026-02-22T15:33:29.131Z","repository":{"id":109071028,"uuid":"65466901","full_name":"yottaawesome/onyx32","owner":"yottaawesome","description":"An experimental C++ Win32 DLL-based framework.","archived":false,"fork":false,"pushed_at":"2022-04-14T10:03:06.000Z","size":10398,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-11-02T16:01:37.322Z","etag":null,"topics":["cpp","cpp20","dll","win32","win32api"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yottaawesome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-11T12:17:58.000Z","updated_at":"2025-10-04T14:02:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4f27592-ecea-404f-a8d1-7360d01cb045","html_url":"https://github.com/yottaawesome/onyx32","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yottaawesome/onyx32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yottaawesome%2Fonyx32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yottaawesome%2Fonyx32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yottaawesome%2Fonyx32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yottaawesome%2Fonyx32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yottaawesome","download_url":"https://codeload.github.com/yottaawesome/onyx32/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yottaawesome%2Fonyx32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29717333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-22T15:10:41.462Z","status":"ssl_error","status_checked_at":"2026-02-22T15:10:04.636Z","response_time":110,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp","cpp20","dll","win32","win32api"],"created_at":"2024-11-13T18:23:14.386Z","updated_at":"2026-02-22T15:33:29.088Z","avatar_url":"https://github.com/yottaawesome.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Onyx32\r\n\r\n## Introduction\r\n\r\nOnyx32 is an experimental Win32 framework written in C++ that is currently in development. It's intended to take advantage of newer C++ features and provide a pleasant interface in lieu of the ugly Win32 C calls. This project has roots in older projects of mine started many years ago as a means for me to learn newer C++ features while also exploring the Win32 API. Onyx32 is the latest incarnation of this effort.\r\n\r\n## Status\r\n\r\n_Major_ changes are planned. The documentation below may no longer be accurate. It's just on standby for the moment as a I focus a bit more on other things. \r\n\r\n## Caveats\r\n\r\nIt goes without saying that this project is purely for my own fun and education; it's not meant for production-level work. Win32 also has a huge surface area for an API, and time is a limited resource for me, so Onyx32 is woefully incomplete in terms of features. Remember that building and maintaining quality frameworks takes serious work; if you need a GUI framework for production Win32 work, consider [wxWidgets](https://www.wxwidgets.org/).\r\n\r\n## Using the library\r\n\r\nDevelopment is best done in Visual Studio 2019 Community Edition. Onyx32 targets the latest Windows SDK, so you will need the \"Desktop development with C++\" workload installed for your Visual Studio. Cross-platform development makes little sense for this project, so you'll need a recent version of Windows. Simply clone this repo and open it in Visual Studio -- you should be able to build immediately if you have met the prerequisites.\r\n\r\n### Using Onyx32.Gui.dll\r\n\r\nCheck `Onyx32.Gui.Tests project` for an example. Essentially, in your project in which you want to use Onyx32.Gui.dll, do the following:\r\n\r\n1. Include `Onyx32.Gui.h` and `Onyx32.Gui.Lib.h` (or just the latter, since it includes the former) located in the `Onyx32.Gui/include/` directory.\r\n2. Create an instance of `Onyx32Lib`. This class will automatically load the DLL and unload it on its destruction, so this instance should remain active for the entire scope of your use of `Onyx32` (which will probably be your entire application lifetime).\r\n3. Create the main factory via `Onyx32Lib::GetMainFactory()`.\r\n4. Use the factory to create windows and controls.\r\n5. Add controls to windows.\r\n6. Add event handlers to windows and controls.\r\n7. Create the application loop via `Onyx32Lib::GetApplication()`.\r\n8. Enter the message pump loop `IApplication::MainLoop()`.\r\n9. Bob's your uncle.\r\n\r\nReally simple example below. Note that the API demonstrated below will be changing in the near future to a more [fluid style](https://en.wikipedia.org/wiki/Fluent_interface).\r\n\r\n```C++\r\n// Update this as per your folder set up\r\n#include \"Onyx32.Gui.Lib.h\"\r\n\r\nusing Onyx32::Gui::IWindow;\r\nusing Onyx32::Gui::IFactory;\r\nusing Onyx32::Gui::IMainLoop;\r\nusing Onyx32::Gui::OnyxFree;\r\n\r\n// Declare a memory cleanup function\r\ntemplate\u003ctypename T\u003e\r\nauto ReleaseOnyxObject = [](T* t) -\u003e void { t-\u003eDestroy(); };\r\n\r\nint main()\r\n{\r\n    // Load the library -- this example assumes the DLL exists in the same directory as your executable\r\n    Onyx32::Gui::Onyx32Lib lib;\r\n    // Get factory\r\n    std::shared_ptr\u003cIFactory\u003e factory(lib.GetMainFactory(), OnyxFree\u003cIFactory\u003e);\r\n    // Create a default top-level window\r\n    std::shared_ptr\u003cIWindow\u003e window(factory-\u003eCreateDefaultWindow(L\"This is a test\", 500, 500), OnyxFree\u003cIWindow\u003e);\r\n    // Create the message loop\r\n    std::shared_ptr\u003cIMainLoop\u003e app(factory-\u003eCreateMainLoop(), OnyxFree\u003cIMainLoop\u003e);\r\n    // Initialize main window\r\n    window-\u003eInitialize();\r\n    // If the user closes the Window, exit the main loop\r\n    window-\u003eSetWindowEvent(\r\n        WindowEvents::OnClose,\r\n        [](WindowEvents evt, IWindow\u0026 window) -\u003e void { PostQuitMessage(0); });\r\n    // Enter the main loop\r\n    int retVal = app-\u003eEnter();\r\n    // End -- lib will automatically unload the DLL when it goes out of scope\r\n    return retVal;\r\n}\r\n```\r\n\r\n## Future features\r\n\r\nThe project is undergoing refactoring and I'm slowly adding more features. Features I intend to add support:\r\n\r\n* Custom Windows Win32 classes.\r\n* Additional control support.\r\n* Better support for owner drawn windows and controls.\r\n* Networking.\r\n* Drawing.\r\n* DirectX support.\r\n* In future, I may also update the project to move away from VS Community and use VS Code instead.\r\n* And more!\r\n\r\nObviously, this is a bit ambitious (remember I also have a full-time job!), so it will take a while for me to piece everything together.\r\n\r\n## Considerations\r\n\r\nNote that Win32 imposes restrictions on threads sharing and manipulating windows. Whilst it's possible for threads to [join their thread input state](https://docs.microsoft.com/en-us/windows/win32/procthread/creating-windows-in-threads), certain operations, [such as destroying windows](https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-destroywindow#remarks), can only be performed by the threads that created said windows.\r\n\r\nCurrently, the Onyx DLL allocates memory, which the client code must `delete`. This is not safe across clients and DLL that are compiled with different versions of the runtime. I do plan to refactor the code to make use of either a fixed allocation function such as `LocalAlloc()` or a wrapper allocation function exported from the DLL.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyottaawesome%2Fonyx32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyottaawesome%2Fonyx32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyottaawesome%2Fonyx32/lists"}