Skip to content

Commit 7cf8ae9

Browse files
author
Reece
committed
feat: v0.2.0 - RAII, Builder pattern, Full documentation, CI/CD
Major improvements: - RAII resource management (Handle<T>, Buffer, Shader, Program, Texture) - VitaGlBuilder for fluent initialization - Comprehensive documentation on all public APIs - GitHub Actions CI pipeline - 3 examples (triangle, instanced_colorful_grid, textured_quad) - MIT/Apache-2.0 dual license - Feature flags: debug-gl, logging - Deprecated legacy APIs with migration notes See CHANGELOG.md for full details.
1 parent b903a9b commit 7cf8ae9

File tree

22 files changed

+4032
-369
lines changed

22 files changed

+4032
-369
lines changed

.github/workflows/ci.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
branches: [main, master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Check
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust toolchain
20+
uses: dtolnay/rust-toolchain@stable
21+
22+
- name: Run cargo check
23+
run: cargo check --all-features
24+
25+
test:
26+
name: Test
27+
runs-on: ubuntu-latest
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- name: Install Rust toolchain
32+
uses: dtolnay/rust-toolchain@stable
33+
34+
- name: Run tests
35+
run: cargo test --all-features
36+
37+
fmt:
38+
name: Format
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Install Rust toolchain
44+
uses: dtolnay/rust-toolchain@stable
45+
with:
46+
components: rustfmt
47+
48+
- name: Check formatting
49+
run: cargo fmt --all -- --check
50+
51+
clippy:
52+
name: Clippy
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Install Rust toolchain
58+
uses: dtolnay/rust-toolchain@stable
59+
with:
60+
components: clippy
61+
62+
- name: Run clippy
63+
run: cargo clippy --all-features -- -D warnings
64+
65+
docs:
66+
name: Documentation
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Install Rust toolchain
72+
uses: dtolnay/rust-toolchain@stable
73+
74+
- name: Build documentation
75+
run: cargo doc --no-deps --all-features
76+
env:
77+
RUSTDOCFLAGS: -D warnings

CHANGELOG.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Changelog
2+
3+
All notable changes to `vita_gl_helpers` will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.2.0] - 2026-05-02
9+
10+
### Added
11+
12+
#### RAII Resource Management
13+
- **`Handle<T>` generic wrapper** - Automatic GPU resource cleanup via `Drop` trait
14+
- **`Buffer`** - RAII buffer type with `Buffer::new()` and `Buffer::new_batch()`
15+
- **`Shader`** - RAII shader type with `Shader::compile(source, ShaderType)`
16+
- **`Program`** - RAII program type with `Program::link(&vert, &frag)`
17+
- **`Texture`** - RAII texture type with `Texture::new()` and `Texture::new_batch()`
18+
19+
#### Builder Pattern Initialization
20+
- **`VitaGlBuilder`** - Fluent API for vitaGL configuration
21+
- `.resolution(width, height)` - Set display resolution
22+
- `.msaa(samples)` - Set MSAA level
23+
- `.ram_threshold(bytes)` - Set RAM threshold
24+
- `.shader_optimization(level)` - Set shader compiler optimization
25+
- `.fast_math(enabled)` / `.fast_precision(enabled)` / `.fast_int(enabled)`
26+
- `.build()` - Initialize and return `VitaGlContext`
27+
- **`VitaGlContext`** - Represents initialized graphics context
28+
- `.swap_buffers()` - Swap front/back buffers
29+
- `.resolution()` / `.width()` / `.height()` - Query display info
30+
- `.aspect_ratio()` - Get aspect ratio
31+
32+
#### New Features
33+
- **`Sampler2D`** uniform type for texture binding
34+
- **`BoundTexture::set_linear_filtering()`** and `set_nearest_filtering()` helpers
35+
- **`BoundTexture::set_wrap()`** helper for texture wrapping
36+
- **`Texture::bind_to_unit()`** for easy texture unit binding
37+
- **`AttributeFormat` constants** - `FLOAT1`, `FLOAT2`, `FLOAT3`, `FLOAT4`, `UBYTE4_NORM`, `USHORT2_NORM`
38+
- **`GlError::is_error()`** and `GlError::description()` methods
39+
- **`check_error()`** - Returns `Result<(), GlError>` for `?` operator
40+
- **`assert_no_error()`** - Panics on GL error (debugging)
41+
- **`debug_check_error()`** - Conditional error checking with `debug-gl` feature
42+
- **`draw_arrays_instanced()`** function
43+
- **Additional draw modes** - `LineStrip`, `LineLoop`, `TriangleStrip`, `TriangleFan`
44+
- **`ElementsBufIdU16` / `ElementsBufIdU32`** - Draw with raw buffer IDs
45+
46+
#### Documentation
47+
- Comprehensive module-level documentation with examples
48+
- Doc comments on all public types, traits, and functions
49+
- Code examples in doc comments
50+
- Migration guide from v0.1
51+
52+
#### Infrastructure
53+
- **GitHub Actions CI** - Check, test, fmt, clippy, docs
54+
- **Feature flags** - `debug-gl`, `logging`
55+
- **Prelude module** - `use vita_gl_helpers::prelude::*`
56+
- **PRD and ARD documents** - Project roadmap in `docs/`
57+
58+
### Changed
59+
- **Rust edition** - 2024 → 2021 for stability
60+
- **Cargo.toml** - Added metadata (authors, description, repository, license, keywords, categories)
61+
- **`Program::use_program()`** - New preferred name (alias `use_me()` retained)
62+
- **`attribute_table!` macro** - Now supports trailing commas
63+
- **`uniform_table!` macro** - Now supports trailing commas
64+
65+
### Deprecated
66+
- `load_shader()` → Use `Shader::compile()` instead
67+
- `link_program()` → Use `Program::link()` instead
68+
- `initialise_default()` / `initialise_extended()` → Use `VitaGlBuilder`
69+
- `RuntimeShaderCompilerSettings` → Use `VitaGlBuilder`
70+
- `VglInitSettings` → Use `VitaGlBuilder`
71+
- `GenDelBuffersExt` trait → Buffers auto-delete on drop
72+
- `GenDelTexturesExt` trait → Textures auto-delete on drop
73+
- `LegacyShader` / `LegacyProgram` → Use RAII types
74+
75+
### Fixed
76+
- **Memory leaks** - All GPU resources now auto-cleanup via RAII
77+
78+
---
79+
80+
## [0.1.0] - Initial Release
81+
82+
### Added
83+
- Basic vitaGL initialization helpers
84+
- Buffer management with `GenDelBuffersExt` trait
85+
- Shader compilation via `load_shader()`
86+
- Program linking via `link_program()`
87+
- Texture management with `GenDelTexturesExt` trait
88+
- Vertex attribute configuration with `attribute_table!` macro
89+
- Uniform management with `uniform_table!` macro
90+
- Draw call helpers (arrays, elements, instanced)
91+
- GL error handling utilities
92+
- Example: triangle rendering
93+
- Example: instanced colorful grid

Cargo.lock

Lines changed: 25 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
[package]
22
name = "vita_gl_helpers"
3-
version = "0.1.0"
4-
edition = "2024"
3+
version = "0.2.0"
4+
edition = "2021"
5+
authors = ["LexiBigCheese"]
6+
description = "Safe, ergonomic helpers for vitaGL development on PlayStation Vita"
7+
repository = "https://github.com/LexiBigCheese/vita_gl_helpers"
8+
license = "MIT OR Apache-2.0"
9+
keywords = ["vita", "playstation", "opengl", "graphics", "homebrew"]
10+
categories = ["graphics", "game-development", "rendering"]
11+
readme = "README.md"
12+
13+
[features]
14+
default = []
15+
debug-gl = []
16+
logging = ["log"]
517

618
[dependencies]
7-
derive_more = { version = "2.1.1", features = ["from", "into", "try_from"] }
19+
derive_more = { version = "2.1.1", features = ["from", "into", "try_from", "display"] }
820
gl = "0.14.0"
21+
log = { version = "0.4", optional = true }
22+
23+
[dev-dependencies]

0 commit comments

Comments
 (0)