# Raycaster with C

A raycasting engine in C and SDL2 that casts a field-of-view of rays across a tile map using DDA.

status: published
C
SDL2
created: 2026-10-14T04:19:36.370789+00:00updated: 2026-10-15T11:14:19.165046+00:00

## About this project

A small raycasting project written in C with SDL2, built to learn how Wolfenstein-style 3D rendering works. A tile-based map is scanned by a fan of rays from the player's position, and DDA grid traversal makes each ray jump from tile edge to tile edge so it stops exactly on the wall face. Includes a top-down debug view of the map, player, and rays, and builds with CMake.

Raycaster with C thumbnail

## Repository

stars0
forks0
open issues0
languageC
craycasterraycastingraycasting-enginesdl2
license: last commit: 2026-10-15T11:49:14Z

📄 README.md

A Simple Raycaster with C

A small raycasting project written in C with SDL2, built to learn how Wolfenstein-style 3D rendering works.

<p align="center"> <img src="demo/3d.gif" alt="Raycasting demo" width="400"> <img src="demo/raycasting.gif" alt="Raycasting demo" width="400"> </p>
  • Tile-based world map (24x24)
  • Player with position and rotating view direction
  • Field-of-view fan of rays using DDA grid traversal, so each ray stops exactly on the wall face
  • Top-down debug view of the map, player, and rays
  • CMake build

Build & run

cmake -B build
cmake --build build -t run

Requires SDL2 and a C compiler.

Controls

  • W/A/S/D: move
  • Q/E: rotate