-
Notifications
You must be signed in to change notification settings - Fork 0
Initial library API completion #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added fully type-safe generic bitmask header for SDL subsytems - Updated testing/cmake for new API
- Added `docs/quick_start.md` which describes how to use the project as intended - Fixed Clang compilation errors (constexpr related) - Updated `hello_laya` to demonstate RAII usage as well.
- Added pre-commit hook that calls clang-format and clang-tidy (more to come) - Added script to verify and/or setup the tools on new clone (or when needed) - Added color printing to powershell files.
- Upgraded Python version from 3.11 to 3.12 - Made `clang-xxx` tooling version 18+ - Upgraded pre-commit & clang-tidy configs
- Implemented a new example demonstrating window creation and event handling using SDL. - Introduced bitmask operators for enum types to facilitate flag management. - Created error handling class for SDL-related errors. - Developed an event queue system for polling and managing events. - Defined various event structures for keyboard, mouse, and window events. - Refactored subsystem management for better initialization and cleanup. - Added window management class with methods for showing, hiding, resizing, and moving windows. - Updated CMakeLists to include new source files for the added functionality.
- Added direct SDL use-case comparison example to `tests/performance` - Removed integration testign for now. - Updated clang-tidy version in `static_analysis` workflow.
- Updated Clang version from 15 to 18 in Linux and Windows CI workflows. - Modified benchmark test suite to use 'benchmark' instead of 'performance'. - Added benchmark utility functions and tests for laya vs SDL3 initialization. - Enhanced static analysis configuration for clang-tidy.
- Replaced `events.cpp` with `event_types.cpp` to centralize event type definitions and handling. - Modified `event_polling.cpp` to use `emplace_back` for efficiency. - Enhanced `window.cpp` to initialize window IDs directly in constructors. - Created strong types for window IDs and dimensions to improve type safety. - Added benchmarks for event polling mechanisms, comparing Laya's implementation with raw SDL3. - Removed obsolete benchmark tests and updated the benchmark suite to focus on event handling.
- Updated examples & added docs accordingly - Fully revamped style guide in `CONTRIBUTING` - Other minor changes
- Added `SDL_Renderer` wrapper with utilities - Added unit tests - Added rendering example - Updated README to reflect the changes
- Renamed unit and benchmark test executables in CMake configuration for consistency. - Updated Linux and Windows CI workflows to use new benchmark test executable names. - Improved headless display setup in Linux workflow with error verification. - Added cleanup step for headless display in Linux workflow. - Modified release workflow to avoid fetching submodules and added checksum generation for source archive.
radicazz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces the initial stable API for the laya library, completing the foundational components for window management, event handling, and rendering. The changes represent a significant step forward in establishing a type-safe, modern C++20 wrapper around SDL3.
Key Changes:
- Replaced simple
init()/quit()API with RAII-basedcontextfor subsystem management - Implemented comprehensive event system with both
event_rangeandevent_viewfor flexible event polling - Added complete renderer API with primitive drawing operations and RAII state guards
Reviewed changes
Copilot reviewed 73 out of 74 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tools/pyproject.toml |
Adds Python tooling dependencies for development (pre-commit, clang-format, clang-tidy) |
tools/README.md |
Documents the development tools setup and usage |
tests/unit/test_window_event.cpp |
Comprehensive unit tests for type-safe window events using std::variant |
tests/unit/test_subsystems.cpp |
Tests for context-based subsystem initialization |
tests/unit/test_renderer.cpp |
Unit tests for renderer types and basic functionality |
tests/unit/test_event_view.cpp |
Tests for zero-allocation event view implementation |
tests/unit/test_event_range.cpp |
Tests for event range with multi-pass iteration support |
tests/test_main.cpp |
New centralized test main replacing old test infrastructure |
tests/benchmark/test_events_benchmark.cpp |
Performance benchmarks comparing event polling approaches |
src/laya/window.cpp |
Complete window management implementation with RAII |
src/laya/subsystems.cpp |
Subsystem initialization via context class |
src/laya/renderer.cpp |
Full 2D rendering API with primitives and state management |
src/laya/event_types.cpp |
Type-safe event conversion from SDL to laya types |
src/laya/event_polling.cpp |
Dual event polling APIs (range and view) |
src/laya/errors.cpp |
Error handling with source location support |
include/laya/laya.hpp |
Unified public API header |
examples/events/main.cpp |
Comprehensive event handling demonstration |
examples/rendering/main.cpp |
Rendering primitives example with CI support |
CMakeLists.txt |
Updated build configuration with conditional defaults |
.pre-commit-config.yaml |
Pre-commit hooks for code quality enforcement |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| }; | ||
|
|
||
| /// Strong types for window properties | ||
| struct dimentions { |
Copilot
AI
Dec 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dimentions struct has a spelling error. It should be dimensions (with an 's' instead of a 't'). This typo appears throughout the codebase and should be corrected before the API is stabilized.
Initial components (window, events, renderer) have been added providing the first stable
layaAPI.