-
Add header source files into the Dev C++ directory
- First, download the header files from this Google drive link and extract the files.
- It contains three files:
- graphics.h
- winbgim.h
- libbgi.a.
- You need to copy "graphics.h" and "winbgim.h" into include the directory of Dev-Cpp program resource files. The exact directory address is –
- C:\Program Files (x86)\Dev-Cpp\MinGW64\include
- Next, copy “libbgi.a” to lib folder, which should be inside MinGW64. The directory address is –
- C:\Program Files (x86)\Dev-Cpp\MinGW64\lib
-
Change compiler suit in Dev C++
- First open Dev C++ appliaction.
- On the right side of the toolbar, you will have the drop-down menu to select the desired compiler suit.
- Set it to TDM - GCC 4.9.2 32-bit release.
-
Configure required linkers for graphics
-
On Dev, C++, look for the Tool option on the top menu.
-
Expand tools and select Compiler Options.
-
You should arrive on the general tab of the compiler options window.
-
Ensure the “Add the following commands when calling the linker” check box is selected.
-
Then add these linkers in the input box – (just copy and paste this line)
-libgcc -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
-
Then click on OK to save.
-
Installation/verification for openGL
OpenGL comes with the X11 installation, to verify, look for the following files:
-
header file: /usr/include/GL/glut.h
-
If OpenGL and/or GLUT is not installed on your system, you can install both with: Ubuntu:
sudo apt-get install freeglut3-dev
or
Fedora/RedHat:
sudo yum install freeglut-devel
which should install all the dependent packages, including OpenGL itself. You must have sudo/administrator privileges.
-
In your OpenGL source files, include the following line:
#include <GL/glut.h>
You don't need to include gl.h and glu.h, as they are already included in glut.h.
-
To make a GLUT application on the command line, use the following linker options:
-lGL -lGLU -lglut
-
The process of representing continuous graphics object as a collection of discrete pixels is known as scan conversion.
-
Scan Converting a Point and a straight Line:
-
Scan Converting Circle and Ellipse:
-
-
copy the files and make new project for dev for openGL programming