2025-08-24 13:11:24 +02:00
|
|
|
# Simple OpenGL FPS (C + FreeGLUT)
|
|
|
|
|
|
|
|
|
|
A tiny first-person demo using legacy OpenGL (compat) and FreeGLUT:
|
2025-11-30 13:42:16 +01:00
|
|
|
|
2025-08-24 13:11:24 +02:00
|
|
|
- Move with WASD, hold Tab or Q to sprint
|
|
|
|
|
- Aim with mouse (captured by default). Press M to toggle capture
|
|
|
|
|
- Shoot with Left Mouse or Space. Hit the red cube to score; it respawns
|
|
|
|
|
- Press Esc to quit
|
|
|
|
|
|
|
|
|
|
## Build
|
|
|
|
|
|
2025-08-24 13:17:58 +02:00
|
|
|
Requires development packages for OpenGL, GLU, FreeGLUT, and SDL2 (for audio).
|
2025-08-24 13:11:24 +02:00
|
|
|
On Debian/Ubuntu:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
sudo apt-get update
|
2025-08-24 13:17:58 +02:00
|
|
|
sudo apt-get install -y build-essential freeglut3-dev libsdl2-dev pkg-config
|
2025-08-24 13:11:24 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Then build and run:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
make -C C/fps
|
|
|
|
|
make -C C/fps run
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If your distro uses different package names, install the equivalents of:
|
2025-11-30 13:42:16 +01:00
|
|
|
|
2025-08-24 13:11:24 +02:00
|
|
|
- libgl1, libglu1, freeglut (dev headers)
|
|
|
|
|
|
|
|
|
|
## Notes
|
2025-11-30 13:42:16 +01:00
|
|
|
|
2025-08-24 13:11:24 +02:00
|
|
|
- This uses old-school fixed-function OpenGL for simplicity and broad compatibility.
|
|
|
|
|
- Mouse is confined via glutWarpPointer; press M if you need to release it.
|
2025-08-24 13:17:58 +02:00
|
|
|
- SDL2 is used only for simple procedurally generated sound effects (shoot, hit, game over).
|