In this article, the task is to create different figures on a computer screen using OpenGL.
Approach:
- In this article, in order to fill the figures with colors, different algorithms are used, so the filling can be done in the optimized pattern.
- Here, the flood fill and boundary fill algorithm with the implementation in the C++ program with the concept of sub-windows will be used.
- The mouse() function is used in the program. After running the program, use the left click to draw the image and then right-click to fill the image.
Below is the C++ program illustrating the use of OpenGL:
Output
👁 Image👁 Image