concept
This commit is contained in:
parent
8af3a803b2
commit
58a31223d1
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
build/
|
||||
raylib/
|
||||
|
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "raylib"]
|
||||
path = raylib
|
||||
url = https://github.com/raysan5/raylib.git
|
94
README.md
94
README.md
@ -1,2 +1,94 @@
|
||||
# shapes
|
||||
# Shape Pattern Generator
|
||||
|
||||
## Description
|
||||
|
||||
A simple C++ application that generates an animated grid of colorful shapes (circles, squares, triangles). The patterns are designed to be visually engaging, with repeating but variable sequences, shifting colors, and periodic regeneration of the entire grid.
|
||||
|
||||
This project uses [Raylib](https://www.raylib.com/) for graphics rendering and [CMake](https://cmake.org/) for the build system. It's intended as a fun visual toy, particularly inspired by a request for an autistic child who enjoys such patterns.
|
||||
|
||||
## Features
|
||||
|
||||
* Displays a dynamic grid of shapes (circles, rectangles, triangles).
|
||||
* Randomized shape types and base colors for variety.
|
||||
* Smooth hue-shifting color animation for each shape.
|
||||
* Periodic regeneration of the entire pattern for continuous visual interest.
|
||||
* Cross-platform (thanks to Raylib and CMake).
|
||||
* Simple to compile and run.
|
||||
|
||||
## Dependencies
|
||||
|
||||
To build and run this project, you'll need the following:
|
||||
|
||||
1. **Raylib:** A recent version (e.g., 4.5, 5.0).
|
||||
* The `CMakeLists.txt` is configured to find Raylib via `find_package` (if installed system-wide or `CMAKE_PREFIX_PATH` is set) or by building it from a `raylib` subdirectory (e.g., added as a Git submodule).
|
||||
2. **CMake:** Version 3.15 or higher.
|
||||
3. **C++ Compiler:** A C++17 compatible compiler (e.g., Clang, GCC, MSVC).
|
||||
4. **System Libraries (Mainly for Linux):**
|
||||
* On Linux, Raylib has dependencies on various X11 and OpenGL libraries. Based on experience and common requirements, you might need to install development packages such as:
|
||||
* `libx11-dev`
|
||||
* `libxrandr-dev`
|
||||
* `libxinerama-dev`
|
||||
* `libxcursor-dev`
|
||||
* `libxi-dev`
|
||||
* `libgl1-mesa-dev` (or equivalent for your OpenGL drivers)
|
||||
* `libasound2-dev` (for audio, though not used in this specific version, Raylib might link it)
|
||||
* For Wayland-based systems, dependencies might differ (`libwayland-dev`, etc.).
|
||||
* Please refer to the official Raylib documentation for the most up-to-date and comprehensive list of dependencies for your specific operating system and distribution.
|
||||
|
||||
## Build Instructions
|
||||
|
||||
1. **Clone the Repository:**
|
||||
If you have this project in a Git repository, clone it. Otherwise, ensure `main.cpp` and `CMakeLists.txt` are in your project's root directory.
|
||||
|
||||
2. **Get Raylib:**
|
||||
* **If using `find_package`:** Ensure Raylib is installed where CMake can find it (e.g., system-wide, or by setting `CMAKE_PREFIX_PATH` during CMake configuration).
|
||||
* **If building Raylib as a subdirectory:** Clone the Raylib library into a subdirectory named `raylib` within your project root:
|
||||
```bash
|
||||
git submodule add [https://github.com/raysan5/raylib.git](https://github.com/raysan5/raylib.git) raylib
|
||||
# Or download and extract Raylib source into a 'raylib' folder.
|
||||
```
|
||||
|
||||
3. **Configure with CMake:**
|
||||
Create a build directory and run CMake from there. To use Clang:
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
|
||||
```
|
||||
* If Raylib is installed in a custom location and you're not using the subdirectory method, you might need to tell CMake where to find it:
|
||||
```bash
|
||||
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_PREFIX_PATH=/path/to/your/raylib_install_directory
|
||||
```
|
||||
|
||||
4. **Compile the Project:**
|
||||
While still in the `build` directory:
|
||||
```bash
|
||||
cmake --build .
|
||||
```
|
||||
Or, you can use `make` (or `ninja`, etc., depending on the generator CMake used):
|
||||
```bash
|
||||
make
|
||||
```
|
||||
|
||||
5. **Run the Application:**
|
||||
The executable will be generated in the `build` directory (e.g., `ShapeGenerator` on Linux/macOS, `ShapeGenerator.exe` on Windows).
|
||||
```bash
|
||||
./ShapeGenerator
|
||||
```
|
||||
|
||||
## How to Use
|
||||
|
||||
* Launch the application after building it.
|
||||
* A window will appear displaying the animated shape patterns.
|
||||
* Press the `ESC` key to close the application window.
|
||||
|
||||
## Tinkering
|
||||
|
||||
Feel free to modify the source code (`main.cpp`) to:
|
||||
* Change color palettes or animation speeds.
|
||||
* Add new shapes or behaviors.
|
||||
* Adjust grid size or regeneration timings.
|
||||
* Experiment with different Raylib features.
|
||||
|
||||
---
|
||||
*This project was inspired by a desire to create a simple, visually engaging application.*
|
1
raylib
Submodule
1
raylib
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 8d9c1cecb7f53aef720e2ee0d1558ffc39fa7eef
|
Loading…
x
Reference in New Issue
Block a user