Cpp-Graphics-Algorithms
所属分类:绘图程序
开发工具:C++
文件大小:0KB
下载次数:0
上传日期:2024-02-16 17:36:19
上 传 者:
sh-1993
说明: 使用graphics.h.探索在C++CPP中实现的基本图形算法,如DDA和Bresenham。在此存储库中学习和实验基本图形编程概念。
(Explore essential graphics algorithms like DDA and Bresenham implemented in C++ CPP using graphics.h. Learn and experiment with basic graphics programming concepts in this repository.)
文件列表:
.idea/
graphics/
CMakeLists.txt
LICENSE
main.cpp
# C++ Graphics Algorithms with CLion
> A simple graphics algorithms written in C++ using the `graphics.h` library and compiled in CLion.
## Table of Contents
- [Introduction](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#introduction)
- [Features](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#features)
- [Prerequisites](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#prerequisites)
- [How to Run](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#how-to-run)
- [Adding External Header and Library in CLion](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#adding-external-header-and-library-in-clion)
- [Credits](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#credits)
- [License](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/#license)
## Introduction
This C++ graphics program is designed to illustrate fundamental drawing algorithms such as DDA line drawing, Bresenham line drawing, and circle drawing. The program creates a simple scene featuring a house and a sun.
## Features
- Implements DDA and Bresenham line drawing algorithms.
- Demonstrates circle drawing algorithms, including Midpoint and Bresenham.
- Draws a basic scene with a house and a sun.
## Prerequisites
Before running this program, ensure you have the following installed:
- CLion or any other C++ IDE.
- A compatible C++ compiler (e.g., MinGW) with support for the `graphics.h` library.
- The `libbgi.a` library file.
Note: Both `graphics.h` and `libbgi.a` are included in the "Cpp-Graphics-Algorithms/Graphics"
## How to Run
1. Clone or download this repository to your local machine.
2. Open the project in CLion.
3. Build and run the project.
## Adding External Header and Library in CLion
To add the `graphics.h` header in CLion, follow these steps:
1. Copy `graphics.h` to `path\to\CLion\bin\mingw\lib\gcc\x86_64-w64-mingw32\13.1.0\include` and `path\to\CLion\bin\mingw\lib\gcc\x86_64-w64-mingw32\13.1.0\include\c++`
2. Restart Clion.
To add the `libbgi.a` library to your project in CLion, follow these steps:
1. Copy `libbgi.a` to `path\to\CLion\bin\mingw\lib\gcc\x86_64-w64-mingw32\13.1.0`
2. Open your `CMakeLists.txt` file.
3. Use the `target_link_libraries()` function to link the library to your executable target.
```cmake
target_link_libraries(YourProjextName "\path\to\CLion\bin\mingw\lib\gcc\x86_64-w64-mingw32\13.1.0\include\libbgi.a")
```
Replace `YourProjextName` with the name of your Clion Project and `\path\to\` with the actual path to the Clion.
4. Save the changes and reload the CMake project in CLion.
## Credits
This program is created by **o-Erebus**.
## License
This project is licensed under the [MIT License](https://github.com/o-Erebus/Cpp-Graphics-Algorithms/blob/master/LICENSE).
近期下载者:
相关文件:
收藏者: