13 Commits

Author SHA1 Message Date
portersky 6bfde6c6fb feat: add Cornell Box scene with orbit camera
- gfx::pipeline gains bind_vec3/bind_float for passing arbitrary
  uniforms to shaders (used for light position/color)
- scene base gains on_mouse_drag virtual hook; cuber.cpp polls
  left-mouse delta each frame and forwards it to the active scene
- cornell_box scene: 5-wall room (red/green/white), two pre-rotated
  white boxes with proportions from the original paper, an unlit
  ceiling light panel, and a point-light Lambert shader
- left-click drag orbits the camera around the scene origin;
  pitch is clamped to ±80° to prevent gimbal flip
- key 3 / --scene cornell_box selects the scene
2026-05-11 16:35:26 +02:00
portersky 5b4743ff8f docs: document gfx::pipeline + add Markdown style rule to AGENTS.md + README styling
- Added comprehensive "Pipeline Abstraction" section to README.md
  (for dummies, with step-by-step examples, render-to-texture, and
  post-processing).
- Added "Documentation (Markdown)" section to AGENTS.md with the
  max-80-cols rule (exceptions for tables/code blocks).
- Applied consistent Markdown styling to AGENTS.md and README.md
  (wrapped text at 80 cols, bold, code spans, cleaned duplicates).
- Moved scenes libraries to  (cleaned main
  CMakeLists.txt significantly).

No behavior change. All follows AGENTS.md conventions.
2026-05-06 00:55:53 +02:00
portersky 98673b57ff docs: update README and AGENTS.md to match current project
Updated project description from 'cube timer' to 'OpenGL 3D
renderer with multiple scenes'. Added usage section with CLI
flags and key bindings. Listed both available scenes.

Updated AGENTS.md to include the sphere scene in static
libraries and source layout. Normalized run command to
./build/cuber for cross-platform consistency.
2026-05-06 00:15:43 +02:00
portersky 22d2bb1c40 refactor: separate window from opengl::context
Extract GLFW window management into a dedicated cbt::window
class (new files in cbt/). The opengl::context now only
handles GLAD setup and context activation (no more window
creation or GLFW init/terminate).

Updated main loop in cuber.cpp, CMakeLists.txt (to build
the new source), and AGENTS.md (docs + source layout).

Addresses the design note in context.cpp about mixing
concerns.
2026-05-05 23:37:19 +02:00
portersky 0c8af1dc0f docs: update AGENTS.md to reflect current project structure
- Update source layout with scenes/ directory and static libraries
- Add static library documentation (cbt_opengl, cbt_scene, scenes_cube)
- Remove stale references to nerv project
- Update run command for Windows
2026-05-05 22:35:17 +02:00
portersky b6adb7c23a style: move public members first in class declarations
- Reorder all class headers to put public interface before private members
- Document convention in AGENTS.md
2026-05-05 22:30:56 +02:00
portersky 30ddaf7d39 feat: render spinning 3D cube with glm
- Add glm dependency for matrix transformations
- Replace triangle with 6-face colored cube
- Add MVP shader uniforms (model, view, projection)
- Enable depth testing for proper 3D rendering
- Spin cube around (1, 0.5, 0.3) axis

style: fix trailing return type for move assignment operators

- buffer/texture/shader/vao: use auto fn() -> T& style
- Document trailing return type convention in AGENTS.md
2026-05-05 22:19:33 +02:00
portersky 9114eaabc6 style: switch to east const across the codebase
- const T* -> T const* in all headers and implementations
- const T& -> T const& for copy constructor/operator= deletes
- update AGENTS.md to document east const convention
2026-05-05 22:10:00 +02:00
portersky 90d013695d feat: add OpenGL abstraction layer with RAII resources
- Replace window class with cbt::opengl::context
- Add buffer resource (VBO, EBO, UBO, SSBO) with move semantics
- Add texture resource with format/type enums and filtering
- Add descriptor_set for Vulkan-style resource binding
- All resources use RAII with proper cleanup
2026-05-05 21:58:34 +02:00
portersky 47d01f57c0 feat: add RAII window class with OpenGL 4.1 context
- Add cbt::window class in cbt/ directory with RAII lifecycle
- Add setup_opengl and info_opengl for glad init and GL info
- Add Q key to quit the application
- Update CMakeLists.txt with glfw3 and glad dependencies
- Update AGENTS.md with snake_case naming and shell conventions
2026-05-05 21:50:50 +02:00
portersky f13eb491d9 docs: add commit message conventions with 50/72 rule 2026-05-05 21:36:24 +02:00
portersky a13105a591 docs: add coding and shell conventions to AGENTS.md
- Add include ordering rules: C++ std, C std, OS-specific,
  third-party, local headers (separated by blank lines)
- Clarify <> for system headers, "" for third-party deps
- Remove .exe from run command
- Mark shell code blocks as sh (POSIX compliant)
- Add shell script conventions section
2026-05-05 21:34:00 +02:00
portersky e2110ddf4f Inital commit 2026-05-05 21:34:00 +02:00