refactor: C Rewrite

This commit is contained in:
2026-05-24 09:38:54 +05:30
parent 012e0e1c69
commit 02fb6ed612
7 changed files with 234 additions and 201 deletions

View File

@@ -1,44 +1,37 @@
# gsplash
A fullscreen splash-screen wrapper for launching a game or app. It displays an image (or a fallback text label), starts your executable, and closes when the process exits or loses focus after launch.
A fullscreen splash-screen wrapper for launching a game or app. It displays an image (or a fallback black screen), starts your executable, and closes when the process exits or loses focus after launch.
## Features
1. Fullscreen, borderless splash screen with hidden cursor
2. Displays a supplied image via Pillow (fallback text if load fails)
1. Fullscreen, borderless splash screen with hidden cursor (SDL2)
2. Displays a supplied image via SDL2_image (fallback to black if load fails)
3. Launches the target executable and exits when it finishes
4. Closes on focus loss after the game starts or on **Esc**
4. Hides on focus loss after the game starts or closes on **Esc**
## Requirements
## Build Requirements
- Python 3.12+
- Tkinter (usually bundled with Python; on some Linux distros you may need a `tk` system package)
- Pillow
- C compiler (GCC or Clang)
- make
- pkg-config
- SDL2
- SDL2_image
## Install
Using `uv` (recommended):
```bash
uv sync
```
Using `pip`:
```bash
python -m venv .venv
source .venv/bin/activate
pip install .
make
sudo make install
```
## Usage
```bash
python main.py <path_to_image> <game_executable> [game_arguments...]
```
Example:
Build output installs to `/usr/local/bin` by default. Override with `PREFIX`.
```bash
python main.py assets/splash.jpg /path/to/game --fullscreen --profile=default
game-splash <image_path> <game_executable> [game_arguments...]
```
```bash
game-splash assets/splash.jpg /path/to/game --fullscreen --profile=default
```