A Dynamic 2D OpenGL Experience in C++
Experience the scenic beauty of Cox's Bazar with a dynamic day/night cycle, realistic traffic, ocean views, and weather effects.
This project was developed as part of the Computer Graphics course at AIUB (American International University-Bangladesh).
- 🌤️ Dynamic Day/Night Cycle – Seamlessly switch between a bright day and a starry night.
- 🔊 Immersive Audio – Integrated sound effects for passing cars, ship horns, and falling rain.
- 🌧️ Weather System – Toggle rain with realistic visual drops and ambient sound.
- 🚗 Dynamic Traffic – Animated vehicles traveling in distinct lanes with speed adjustments.
- ⛴️ Ocean Scenery – Moving ships along the shoreline with distinct models for varied distances.
- ☁️ Procedural Sky – Clouds passing during the day and softly glowing stars lighting up the night sky.
/
├── assets/
│ ├── car-passing.wav # 🎵 Sound effects
│ ├── light-rain.wav
│ └── ship.wav
├── main.cpp # 🧠 Main OpenGL rendering logic
├── test3.cbp # ⚙️ Code::Blocks project file
├── README.md # 📖 Project documentation
└── .gitignore # 🚫 Git ignore rules
Take control of the environment using your keyboard:
| Key | Action |
|---|---|
| n | Switch to Night Mode 🌙 |
| d | Switch to Day Mode ☀️ |
| c | Play Car Passing sound 🚗 |
| s | Play Ship Horn sound 🚢 |
| r | Toggle Rain & Audio 🌧️ |
| ESC | Exit the application ❌ |
- C++ Compiler (e.g., MinGW)
- OpenGL & GLUT libraries configured
- Windows OS (required for
<mmsystem.h>audio playback)
- Open the
test3.cbpproject file. - Ensure GLUT is correctly linked in your build settings.
- Press F9 to Build and Run.
⚠️ Note: To hear sound effects when running directly from your IDE's bin folder, ensure the.wavfiles are in the same directory as the executable.
Using MinGW, run the following command to link the required libraries:
g++ main.cpp -o app.exe -lglut32 -lopengl32 -lglu32 -lwinmm -lgdi32After building, ensure your assets/ audio files sit alongside the compiled app.exe before executing.
Contributions, issues, and feature requests are highly appreciated!
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.

