{"id":21645449,"url":"https://github.com/elijaharita/eseed-window","last_synced_at":"2025-07-06T02:40:35.998Z","repository":{"id":144487763,"uuid":"256667763","full_name":"elijaharita/eseed-window","owner":"elijaharita","description":"A minimal cross-platform C++17 window management library for rendering (deprecated)","archived":false,"fork":false,"pushed_at":"2022-01-06T11:46:31.000Z","size":194,"stargazers_count":24,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T18:55:39.138Z","etag":null,"topics":["cpp17","cross-platform","input","surface","vulkan","win32","window","window-manager","x11"],"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/elijaharita.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"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,"zenodo":null}},"created_at":"2020-04-18T04:15:57.000Z","updated_at":"2024-10-29T18:21:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"6a47e771-d17e-4678-a33e-6aa310fd86e4","html_url":"https://github.com/elijaharita/eseed-window","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/elijaharita/eseed-window","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijaharita%2Feseed-window","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijaharita%2Feseed-window/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijaharita%2Feseed-window/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijaharita%2Feseed-window/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elijaharita","download_url":"https://codeload.github.com/elijaharita/eseed-window/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elijaharita%2Feseed-window/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263839559,"owners_count":23518284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cpp17","cross-platform","input","surface","vulkan","win32","window","window-manager","x11"],"created_at":"2024-11-25T05:57:28.011Z","updated_at":"2025-07-06T02:40:35.993Z","avatar_url":"https://github.com/elijaharita.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eseed window\n\n`namespace esd::wnd` | MIT License | 0.1.0 (Prerelease)\n\n![Example Graphic](example-graphic.jpg)\n\n## Goal\nA cross-platform, minimal, modern window library for C++17. Designed to support a variety of rendering APIs. Currently includes Vulkan surface management.\n\n## A message from me\nHello everyone. This project is my second library, and began as a part of my game engine. If anyone is interested in contributing a different platform / new render API support, I'd love to work with you! In any case, I'll slowly be adding functionality myself, but it'll take plenty of research :) I hope someone will find this library useful!\n\n**This project is currently in active development and some interface features may break at any time until this notice is removed**\n\n## Known quirks / issues\n#### X11\n  - Shift key does not repeat like other keys\n    - Repeat key presses may be disabled on all platforms, that's the purpose of the character callback\n  - Print Screen and Meta keys do not seem to be detected\n  - Button 4 \u0026 5 currently not readable\n\n## Features\n- Current supported platforms\n  - Win32\n  - X11\n- Current supported rendering APIs\n  - Vulkan\n- Input handling\n  - Event polling and waiting\n  - Keyboard\n    - Key callback\n      - Applicable key codes are mapped to their ASCII analogs\n    - Char input callback (Unicode)\n    - Key state getter\n  - Mouse\n    - Cursor position getter and setter\n    - Cursor screen position getter and setter\n    - Mouse button state getter\n    - Mouse move callback\n    - Mouse button callback\n- Title management (Unicode)\n- Size and position management\n- Fullscreen\n\n### Planned\n- More platform support\n  - Mac, Wayland, possibly others (contributions appreciated)\n  - More Windows support\n    - IME input\n- More rendering API support\n  - OpenGL context management\n  - Possibly others\n- More input handling\n  - Mouse capturing\n  - Controllers / gamepads\n  - Additional (needs more research)\n- More callbacks\n  - Resize\n  - Reposition\n  - Window close\n  - etc.\n- Thread safety\n- Sound? (possible)\n- Anything else as it comes along :)\n\n## Ghetto temporary documentation\n\n### Building\n\nESeed Window uses CMake.\n\nCMake Configuration Options:\n- ESD_WND_BUILD_EXAMPLES *(ON, OFF | Default - OFF)*\n- ESD_WND_ENABLE_VULKAN_SUPPORT *(ON, OFF | Default - OFF)*\n  - Must be enabled to use Vulkan helper functions\n- ESD_WND_PLATFORM *(Win32, X11 | Default - Auto Detect)*\n  - This option may be manually set in order to specify a target platform for a different OS, otherwise the platform will be auto-detected\n  - If no value is provided, Linux operating systems will default to X11, and Windows will default to Win32\n\n#### Linking via a CMake subdirectory\n\nIf you are building your project with CMake as well, the library can easily be included in your project with `add_subdirectory(path/to/eseed-window)` and subsequently `target_link_libraries(target eseed_window)`.\n\n### Basics\nAt the moment, the only supported rendering API is Vulkan. The library is currently implemented for Win32 and X11.\n\nWindows are created with a simple constructor taking a title and size. This may be expanded with additional optional parameters in the future.\n\nAfter the window has been created, events need to be checked periodically. This can be accomplished either with `.poll()` or `.waitEvents()`. Polling immediately processes 0 or more messages, and is useful for games and other applications that have a continuously updated event loop. However, GUI applications that don't need to be updated until input is received can simply wait until one or more new events are available, and let the CPU rest in the meantime.  \n\nWhen the window class goes out of scope or is destroyed, the window itself will be freed and destroyed automatically.\n\nThe window can be closed early using `.close()`. When using Vulkan, the window must be closed after the surface, and before the instance. A window that has been closed cannot be used again unless it is reinitialized.\n\n```cpp\n#include \u003ceseed/window/window.hpp\u003e\n\nint main() {\n  \n    // Window creation\n\n    esd::wnd::Window window(\"Title\", { 1366, 768 });\n\n    // Event polling until window closes\n    \n    while (!window.isCloseRequested()) {\n        window.waitEvents();\n        // or: window.poll();\n    }\n}\n```\n\n### Input handling\nWindow input can be intercepted by setting the listeners in the window object.\n\n#### Raw Keyboard Input\n```cpp\nwindow.keyHandler = [](esd::wnd::KeyEvent e) { ... };\n```\n\nCalled when a key is pressed or released. `e` contains a key code and a boolean indicating whether it was pressed or released.\n\nIndividual key states can also be queried with `.isKeyDown(esd::wnd::Key)`.\n\nToggleable keys' toggle states (such as caps lock) can be queried with `.isKeyToggled(esd::wnd::Key)`.\n\nKeys\n\n#### Keyboard Char Input\n```cpp\nwindow.setKeyCharHandler([](esd::wnd::KeyCharEvent) { ... });\n```\n\nCalled for each character generated by one or more keys.\n\n`e` contains a `char32_t codePoint`, representing a Unicode code point.\n\n#### Cursor Movement\n```cpp\nwindow.setCursorMoveHandler([](esd::wnd::CursorMoveEvent e) { ... });\n```\n\nCalled while the cursor is actively moving. `e` contains the cursor's window coordinates, as well as screen coordinates. It also contains a boolean indicating whether the cursor has just entered the window.\n\nCursor position can be checked at any time using `.getCursorPos()` and `.getCursorScreenPos()`.\n\nCursor position can be set using `.setCursorPos(esd::wnd::CursorPos)` and `.setCursorScreenPos(esd::wnd::CursorPos)`.\n\n#### Cursor Exiting Window\n```cpp\nwindow.setCursorExitHandler([](esd::wnd::CursorExitEvent e) { ... });\n```\n\nCalled when the cursor exits the screen. `e` is an empty structure reserved for future use, and should be ignored for the moment.\n\nMouse reentry can be detected with cursor movement handler.\n\n#### Mouse Button Input\n```cpp\nwindow.setMouseButtonHandler([](esd::wnd::MouseButtonEvent e) { ... });\n```\n\nCalled when a mouse button is pressed or released. `e` contains a button code and boolean indicating whether it was pressed or released.\n\nIndividual mouse button states can be queried with `.isMouseButtonDown(esd::wnd::MouseButton)`\n\n#### Scrolling\n```cpp\nwindow.scrollHandler = [](esd::wnd::ScrollEvent e) { ... };\n```\n\nCalled when vertical or horizontal scroll is detected. `e` contains `vScroll` for vertical scroll and `hScroll` for horizontal scroll.\n\n#### Window Resize\n```cpp\nwindow.resizeHandler = [](esd::wnd::ResizeEvent e) { ... };\n```\n\nCalled when the window is resized. `e` contains the new window size.\n\n#### Window Move\n```cpp\nwindow.moveHandler = [](esd::wnd::MoveEvent e) { ... };\n```\n\nCalled when the window is moved. `e` contains the new window position.\n\n### Vulkan support\nThe `esd::wnd::VulkanWindow` class is a helper class extending the base window class to provide platform-specific Vulkan functionality (surface creation). Both the C Vulkan library and C++ bindings (`vulkan.hpp`) are supported.\n\nTo use `VulkanWindow`, the CMake build files must be generated with `-DESD_WND_ENABLE_VULKAN_SUPPORT`.\n\nMake sure to include the Vulkan header before `\u003cesd/window/vulkanwindow.hpp\u003e`.\n\n`VulkanWindow` provides 3 additional functions:\n- `std::vector\u003cconst char*\u003e getRequiredSurfaceInstanceExtensions()`\n- `VkSurface createSurface(const VkInstance\u0026 instance)`\n- `vk::Surface createSurface(const vk::Instance\u0026 instance)` (only if `vulkan.hpp` is included)\n\n```cpp\n#include \u003cvulkan/vulkan.hpp\u003e\n#include \u003ceseed/window/vulkanwindow.hpp\u003e\n\nint main() {\n    // Window creation\n    esd::wnd::VulkanWindow window(\"Title\" { 1366, 768 });\n    \n    // Get required instance extensions for surface creation\n    std::vector\u003cconst char*\u003e extensions = \n        window.getRequiredSurfaceInstanceExtensions();\n    \n    // Vulkan instance creation\n    vk::InstanceCreateInfo instanceCreateInfo;\n    ...\n    instanceCreateInfo.setEnabledExtensionCount((uint32_t)extensions.size());\n    instanceCreateInfo.setPpEnabledExtensions(extensions.data());\n    ...\n    vk::Instance instance = vk::createInstance(instanceCreateInfo);\n\n    // Vulkan surface creation with eseed window\n    vk::SurfaceKHR surface = window.createSurface(instance);\n\n    ...\n\n    while (!window.isCloseRequested()) {\n\n        ...\n      \n        window.poll();\n    }\n\n    ...\n    \n    instance.destroySurfaceKHR(surface);\n\n    // Important!\n    // Close the window after destroying the surface but before destroying the\n    // instance\n    // Some platforms will give segmentation fault if this is performed out of order\n    window.close();\n    \n    instance.destroy();\n}\n```\n\n## Development notes\n\nSemantic versioning is used.\n\nEach platform in development should have its own development branch named `[platform]-dev`, e.g. `win32-dev`. It should refrain from modifying any non-platform-specific files, except for very simple files like `.gitignore`. All changes to the public API should be applied directly to the main branch, and never to individual platform dev branches. This minimizes merge conflicts by compartmentalizing changes for the public include headers, and each platform implementation.\n\nPlatform-specific source files are located under their own respectively named folder in the `platforms/` directory. Naming matters, as CMake will add the platform-specific subdirectory based on the value of `${ESD_WND_PLATFORM}`. Platform-specific folders should be named in lowercase.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijaharita%2Feseed-window","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felijaharita%2Feseed-window","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felijaharita%2Feseed-window/lists"}