Skip to content

Conversation

@radicazz
Copy link
Owner

@radicazz radicazz commented Oct 18, 2025

Initial components (window, events, renderer) have been added providing the first stable laya API.

- 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 radicazz merged commit 1c190d2 into master Oct 18, 2025
12 checks passed
@radicazz radicazz deleted the develop branch October 18, 2025 07:34
@radicazz radicazz requested a review from Copilot December 1, 2025 05:44
Copy link
Owner Author

@radicazz radicazz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test

Copy link

Copilot AI left a 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-based context for subsystem management
  • Implemented comprehensive event system with both event_range and event_view for 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 {
Copy link

Copilot AI Dec 1, 2025

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants