No description
  • C 85.8%
  • C++ 13.2%
  • Python 0.5%
  • GLSL 0.2%
  • Batchfile 0.2%
  • Other 0.1%
Find a file
2026-06-13 22:02:55 +00:00
include init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
shaders init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
src init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
bsp_viewer.exe init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
build.bat init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
build.sh init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
glfw3.dll init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00
README.md Update README.md 2026-06-13 22:02:55 +00:00
setup_deps.py init commit of bsp-viewer very buggy dont use 2026-06-14 00:55:06 +03:00

bsp-viewer

A Source engine BSP map viewer written in C++ with OpenGL 3.3.

⚠️ WARNING: THIS PROJECT IS FULLY UNUSABLE IN ITS CURRENT STATE. The codebase requires a complete bug fix pass and massive refactoring before it can be considered functional. Do not expect anything to work correctly. You have been warned.

pr's are welcomed.


What it is

Attempts to parse and render .bsp map files from Source engine games (CS:GO, Half-Life 2, etc.). Reads VPK archives for textures, parses VMT/VTF material files, and displays the geometry in a 3D viewport.

What it uses

  • OpenGL 3.3 Core Profile via GLAD
  • GLFW3 for windowing and input
  • stb_image for image loading
  • C++20

Building

Prerequisites

  1. MSYS2/MinGW-w64 with GCC
  2. Run setup_deps.py once to fetch GLAD and stb_image headers
  3. Install GLFW:
    pacman -S mingw-w64-x86_64-glfw
    

Compile

build.bat

Or on Linux/Mac:

./build.sh

Usage

bsp_viewer.exe <map.bsp> [game_dir]

game_dir is the path to the game folder containing a materials/ directory and/or pak01_dir.vpk. Example:

bsp_viewer.exe de_dust2.bsp "C:\Steam\steamapps\common\Counter-Strike Global Offensive\game\csgo"

Controls

Input Action
W A S D Move
Mouse Look
Space / E Move up
Ctrl / Q Move down
Shift 3x speed boost
[ / ] Halve / double speed
Scroll wheel Adjust speed
Escape Toggle mouse capture

Current state

The codebase is a rough first pass. Known issues include (but are not limited to):

  • Rendering is broken / incomplete
  • Texture loading is unreliable
  • VPK/VMT/VTF parsing has unresolved bugs
  • No proper error handling throughout
  • Code structure needs significant refactoring

This needs a full review and rewrite before it is usable for anything.

Source files

File Purpose
src/main.cpp Entry point, GLFW setup, main loop
src/bsp_parser.cpp Source BSP file parser
src/renderer.cpp OpenGL rendering
src/vpk_reader.cpp VPK archive reader
src/vmt_parser.cpp VMT material parser
src/vtf_reader.cpp VTF texture reader
src/mdl_loader.cpp MDL model loader
src/glad.c OpenGL loader