Fully functional chess game written using C and OpenGL with minimal external libraries.
DISCLAIMER: This project was created for fun and to explore OpenGL, so the code can definitely be improved / optimized further.
- Supports all the main chess rules, including castling, promotion and En Passant.
- Play with 2 people on the same device.
- Interact with pieces by clicking or dragging.
- Piece movement animations
- Windows: MSYS2/MinGW toolchain (tested). Pre-compiled libraries are provided in
/libfor MSYS2 UCRT64 environment. - Linux: System packages required:
libfreetype-dev(orfreetype2-devel)libglew-dev(orglew-devel)libglfw3-dev(orglfw-devel)- Standard build tools (
gcc,make)
- Clone this repository
git clone https://github.com/roh1th-s/chess-opengl.git
cd chess-opengl
- Build the project using make
make
- Run
"./build/chess"
-
/src: Contains the main source code:/ui: UI components/gfx: Graphics rendering code/chess: Main game logic lives here.main.c: Entry point
-
/res: Contains project resources (fonts, shaders, textures)
- Improve build system to support more platforms.
- Make UI system more flexible, remove hardcoded positions/sizes.
- Implement an AI to play against.
MIT
