This is a simple image viewer application written in C++. The project uses SDL3 (Simple DirectMedia Layer 3) to render images in a window.
This is my first small graphics-based project, built to understand:
- Basic SDL3 window creation
- Rendering images
- Handling external libraries in C++
- Compiling with MinGW (MSYS2)
The project currently supports PPM image format only. Support for additional formats (PNG, JPG, etc.) will be added in future updates.
- C++
- SDL3
- MSYS2 MinGW64 (Recommended compiler environment)
src/ → SDL3 include and library files
Image_viwer.cpp → Main source file
image1.ppm → Sample test image
SDL3.dll → Required runtime library
- MSYS2 installed
- MinGW64 environment
- SDL3 development libraries
Recommended terminal:
MSYS2 MinGW64
Run the following command inside the project directory:
g++ Image_viwer.cpp -o Image_viwer.exe -I src/include -L src/lib -lsdl3After successful compilation:
./Image_viwer.exeMake sure:
SDL3.dllis present in the same directory as the executable.- The image file path is manually specified inside the source code.
- The image file must be manually opened inside the source code.
- Only
.ppmimage format is currently supported. - Incorrect file paths may cause the program to fail.
- Other image formats will be supported in future versions.
This project is suitable for:
- Beginner to Early-Intermediate C++ learners
- Students learning graphics programming
- Anyone exploring SDL for the first time
- Support for PNG and JPG formats
- File selection via command line argument
- Basic zoom functionality
- Image resizing
- Error handling improvements
Created as a learning project to understand SDL3 and graphics programming in C++.