Skip to content

Modernize C++ includes and add OpenGL renderer foundation#2

Open
awest813 wants to merge 23 commits into
jeremybennett:r1-3-1from
awest813:claude/continue-milestone-AYD2N
Open

Modernize C++ includes and add OpenGL renderer foundation#2
awest813 wants to merge 23 commits into
jeremybennett:r1-3-1from
awest813:claude/continue-milestone-AYD2N

Conversation

@awest813

Copy link
Copy Markdown

Summary

This PR modernizes the codebase by replacing legacy C-style headers with C++ standard library equivalents, and introduces a new OpenGL-based graphics renderer module with supporting infrastructure.

Key Changes

C++ Header Modernization

  • Replaced C-style headers (<stdio.h>, <stdlib.h>, <math.h>, <assert.h>, <errno.h>, <time.h>) with C++ equivalents (<cstdio>, <cstdlib>, <cmath>, <cassert>, <cerrno>, <ctime>) across multiple source files
  • Updated code comments to use nullptr instead of NULL in documentation
  • Added -std=c++11 flag to configure.in for C++ standard compliance

New OpenGL Graphics Module (src/modules/graphic/oglgraph/)

  • OGLRenderer: Core renderer class managing geometry, shadows, post-processing, particles, and skid marks
  • Shader: Shader program compilation and management with error handling
  • Texture: Texture loading and caching system with fallback support
  • AC3DLoader: Parser for AC3D model format with material and surface handling
  • PostProcess: Post-processing effects framework (bloom, color correction)
  • ShadowMap: Shadow mapping implementation for dynamic lighting
  • Particles: Particle system for effects (dust, smoke, sparks)
  • SkidMarks: Real-time skid mark rendering
  • Camera: Camera management and view matrix calculations
  • Mesh: Mesh data structure and rendering
  • GLSL Shaders: Geometry, shadow, particle, and post-processing shader implementations

Documentation and Testing

  • Added CONTRIBUTING.md: Development environment setup and contribution guidelines
  • Added ROADMAP.md: Project direction and priorities for Open Racing Simulator fork
  • Added test/math/: Unit tests for vector math library (v2t, v3t) with test framework
  • Updated robot tutorial documentation to reference "Open Racing Simulator"
  • Updated architecture documentation

Project Rebranding

  • Updated page titles and references from "TORCS" to "Open Racing Simulator" across web interface and documentation
  • Updated credits and FAQ pages

Build System

  • Added Makefile for oglgraph module
  • Added Makefile for math unit tests
  • Updated .gitignore for test artifacts

Implementation Details

  • The new renderer uses modern OpenGL 3.3+ with VAO/VBO for efficient rendering
  • Shader system supports dynamic compilation with detailed error reporting
  • Texture manager implements singleton pattern with LRU-style caching
  • AC3D loader handles hierarchical object structures with transformations
  • Post-processing pipeline supports multiple effects through framebuffer objects
  • Math test suite provides foundation for vector/matrix operations validation

https://claude.ai/code/session_014bb7MjvNn1nPjSHzkQhsJF

Copilot AI and others added 23 commits March 26, 2026 20:59
…-roadmap

[WIP] Review codebase and create an initial roadmap
Replace unsafe strcpy/sprintf with snprintf to eliminate buffer overflow risks
Replace all remaining unsafe string functions with bounds-checked alternatives
Graphics overhaul: new oglgraph module with OpenGL 3.3 Core + GLSL shaders
…config, add ESC key to exit menu

Agent-Logs-Url: https://github.com/awest813/Open-Racing-Simulator-/sessions/97b65771-dc5b-4159-97e1-ff7b465e2f00

Co-authored-by: awest813 <208855664+awest813@users.noreply.github.com>
Overhaul menus: UX improvements, label clarity, restore Simulation config
Agent-Logs-Url: https://github.com/awest813/Open-Racing-Simulator-/sessions/53dc122e-2f38-45d8-a734-18d304000dae

Co-authored-by: awest813 <208855664+awest813@users.noreply.github.com>
Overhaul root README and restructure project roadmap
- Fix last remaining "Quit TORCS" tooltip in race pause menu
- Rebrand XSL race results page from TORCS to Open Racing Simulator
- Improve results screen column headers (Top Speed, Best Lap, Pits)
- Clarify race options labels (Number of laps, Display mode)
- Improve driver selection labels and key help text
- Improve track selection key help text consistency
- Improve pit stop menu labels (Fuel to add, Repair damage, Change tires)
- Improve sound and simulation config labels and key help
- Improve in-race key help text (Slow down time, Speed up time, etc.)
- Normalize screenshot key help text across all screens
- Rebrand racing board web UI: update 95+ files replacing TORCS with
  Open Racing Simulator in page titles, descriptions, keywords,
  templates, and content pages

https://claude.ai/code/session_01DVdz1bkSrLeLu5qybagLRC
Overhaul UI/UX: improve labels, tooltips, and rebrand from TORCS
…utorial updates, ROADMAP progress

Agent-Logs-Url: https://github.com/awest813/Open-Racing-Simulator-/sessions/ecd35ba7-bd6b-4af4-b1ef-8265ec33c9f0

Co-authored-by: awest813 <208855664+awest813@users.noreply.github.com>
Continue milestone: contributor docs, architecture rebranding, robot tutorial updates
Start modernizing: C++14 + nullptr + C++ headers in TGF core
…al math unit tests

- Replace C headers (<stdlib.h>, <stdio.h>, <math.h>, <memory.h>) with their
  C++ equivalents (<cstdlib>, <cstdio>, <cmath>, <cstring>) in:
  src/libs/robottools/rttrack.cpp, rttelem.cpp
  src/modules/simu/simuv2/car.cpp, categories.cpp, simu.cpp,
  simuitf.cpp, susp.cpp, wheel.cpp
- Replace NULL with nullptr throughout rttrack.cpp and the simuv2 files
- Add test/math/ with a self-contained unit test suite (69 tests) covering
  v2t and v3t vector operations (arithmetic, dot/cross products, length,
  normalize, distance, equality, approxEquals, fakeCrossProduct)
- Mark 'Migrate away from pre-C++11 idioms' and 'Add initial automated test
  suite' as complete in ROADMAP.md

https://claude.ai/code/session_014bb7MjvNn1nPjSHzkQhsJF
Ignore the compiled test_math binary and the tmath symlink that are
generated when running tests in test/math/.

https://claude.ai/code/session_014bb7MjvNn1nPjSHzkQhsJF
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.

3 participants