VOOZH about

URL: https://www.geeksforgeeks.org/c/c-program-to-color-the-different-figures-drawn-on-the-console-using-opengl/

⇱ C program to color the different figures drawn on the console using OpenGL - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C program to color the different figures drawn on the console using OpenGL

Last Updated : 23 Jul, 2025

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
Comment