Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zreechxnn/calculator-sdl2
SDL2 Calculator: A simple calculator built with C++ and SDL2, supporting basic arithmetic, advanced math functions, and trigonometry. Features a user-friendly graphical interface.
https://github.com/zreechxnn/calculator-sdl2
calculator calculator-application conio cpp cross-platform graph gui math math-operations opensource sdl2 sdl2-library sdl2-ttf simple-app software-development stdlib trigonometry
Last synced: 18 days ago
JSON representation
SDL2 Calculator: A simple calculator built with C++ and SDL2, supporting basic arithmetic, advanced math functions, and trigonometry. Features a user-friendly graphical interface.
- Host: GitHub
- URL: https://github.com/zreechxnn/calculator-sdl2
- Owner: Zreechxnn
- License: gpl-3.0
- Created: 2024-08-25T06:55:12.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-05T14:15:17.000Z (21 days ago)
- Last Synced: 2025-01-05T14:29:57.312Z (21 days ago)
- Topics: calculator, calculator-application, conio, cpp, cross-platform, graph, gui, math, math-operations, opensource, sdl2, sdl2-library, sdl2-ttf, simple-app, software-development, stdlib, trigonometry
- Language: C++
- Homepage:
- Size: 80.1 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# calculator-SDL2
# SDL2 CalculatorA simple calculator application developed using SDL2 and SDL_ttf. This calculator includes various mathematical functions and operations, such as square root, pi, exponentiation, trigonometric functions, and basic arithmetic operations.
![image](https://e.top4top.io/p_31596566j1.png)## ⚠️ Disclaimer
The code in this repository is intended **only for developers** with a basic understanding of programming. Please use it responsibly and for development purposes only.
- **Not recommended for direct use in production environments without thorough testing.**
- No guarantees are provided regarding the absence of bugs or errors.
- The author is not liable for any damages or issues caused## Features
- **Basic Arithmetic Operations**: Addition, subtraction, multiplication, and division.
- **Mathematical Functions**: Square root, exponentiation, factorial, and more.
- **Trigonometric Functions**: Sine, cosine, and tangent.
- **Advanced Features**: Decimal points, parentheses, percentage calculations, and more.## Getting Started
### Prerequisites
To build and run this project, you need to have the following installed:
- SDL2
- SDL2_ttfYou can install these libraries using your package manager or from the official SDL website.
### Installation
1. **Clone the repository**:
```bash
git clone https://github.com/Zreechxnn/calculator-SDL2.git
cd calculator-SDL2
```2. **Install dependencies**:
- On Ubuntu/Debian-based systems:
```bash
sudo apt-get install libsdl2-dev libsdl2-ttf-dev
```
- On Fedora-based systems:
```bash
sudo dnf install SDL2-devel SDL2_ttf-devel
```3. **Build the project**:
```bash
gcc -o calculator main.cpp -lSDL2 -lSDL2_ttf -lm
```4. **Run the application**:
```bash
./calculator
```## Usage
- **Basic Operations**: Click the buttons to input numbers and operators. Click the `=` button to calculate the result.
- **Advanced Functions**: Use buttons like `sqrt`, `pi`, `^`, `!`, `deg`, `sin`, `cos`, `tan`, and `AD` for advanced calculations (coming soon) .
- **Clear and Delete**: Click `D` to delete the last character and `0` to reset the input.## Troubleshooting
- **Font Issues**: Ensure 'lonely.ttf` is present in the same directory as the executable or adjust the path in the source code.
- **Library Errors**: Verify that SDL2 and SDL2_ttf libraries are installed and properly linked during compilation.## Contributing
Feel free to open issues or submit pull requests if you find bugs or have suggestions for improvements.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgments
- [SDL2](https://www.libsdl.org/) - Simple DirectMedia Layer
- [SDL2_ttf](https://www.libsdl.org/projects/SDL_ttf/) - SDL2 font rendering library©️ 2024 Rechan Dinata