How To Instal and Program With Glut (OpenGL Utility) Libraires

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Download the Dev C ++ from the following:

https://vulms.vu.edu.pk/Courses/CS602/Downloads/Dev-Cpp%205.11%20TDM-GCC%204.
9.2%20Setup.rar

Download the freeglut 3.0.0 MinGW Package from following:


https://vulms.vu.edu.pk/Courses/CS602/Downloads/freeglut-MinGW-3.0.0-1.mp.zip

Linker:
-lopengl32
-lfreeglut
-lglu32

================
1. Install the Dev C++ 5.11 using the default directories.
2. Extract Free Glut folder in D drive or in a new folder and open it.
3. Open the Destination Folder C:\Program Files (x86)\Dev-Cpp\MinGW64\x86_64-w64-mi
ngw32\include\GL
4. Copy 4 files from downloaded directory as D:\Dev CPP 5.11\Freeglut 3.0.0 MinGW Pack
age\freeglut\include\GL to the above destination in step 3.
5. Copy the two files located in source lib folder D:\Dev CPP 5.11\Freeglut 3.0.0 MinGW Pa
ckage\freeglut\lib\x64 to destination lib folder as C:\Program Files (x86)\Dev-Cpp\Min
GW64\x86_64-w64-mingw32\lib
6. Now go to C:\Windows\System32 to select a destination folder.
7. Go to the bin folder of Source Folder D:\Dev CPP 5.11\Freeglut 3.0.0 MinGW Package\fr
eeglut\bin\x64 and copy freeglut.dll then paste it in the system32 folder as in Step 3.
8. Open Dev C++ with default setting, then goto new project then choose console applicatio
n,
9. Save the default name of project1 in the default directory.
10. Copy the given program at below in Project1
11. Right Click on project in left pan then goto project options and select parameter tab and g
ive the linker parameters
12. Now compile and execute

Basic Window Program


#include<GL/freeglut.h>

//Program to create an empty Window


void init(){
glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB); //Line C
glutInitWindowSize(640,480);
glutInitWindowPosition(1000,200);
glutCreateWindow("Simple Window");
}
void display()
{
glClearColor(1.0,1.0,1.0,0.0);
glClear(GL_COLOR_BUFFER_BIT);
// gluOrtho2D(0.0,100.0,0,100.0);
glFlush();
}

int main(int argc,char **argv)


{
glutInit(&argc,argv); //Line A
init(); //Line B
glutDisplayFunc(display);
glutMainLoop();

return 0;
}

You might also like