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

On page 97

Lab1 How to set up opengl with dev c++ environment

Step 1 download free glut opengl library from:

https://www.transmissionzero.co.uk/files/software/development/GLUT/
freeglut-MinGW.zip

step2: setup freeglut with dev c++ environment:

1. From freeglut folder select all include files in side GL:


Freeglut/include/GL and paste it in to:
C:/ProgramFiles(x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/include/
GL.
2. From freeglut folder select all lib files inside:
Freeglut/lib/x64 and paste it into:
C:/Program Files (x86)/Dev-Cpp/MinGW64/x86_64-w64-mingw32/lib
3. From freeglut folder select freeglut.dill file inside:
Freeglut/bin/x64 and paste it into:
C:/Windows/System32

Step 3: create new project:

Open dev c++filenewprojectConsole applicationselect c++


projectgive project nameassign your folder name and save it.

Step 4: make link b/n project and opengl:

Click on project menuproject optionparametersthen inside the linker type


three linkers:

-lfreeglut

-lopengl32

-lglu32

Step5: compile and assign file name


File name should be the same as project name except it be without extension.

Eg. Project name=pro.dev

File name=pro

Step6: run it. Thank you!

1. First program that display window


#include<GL/gl.h>

#include<GL/glu.h>

#include<GL/glut.h>

void display(){

int main(int argc,char**argv){

glutInit(&argc,argv);

glutInitDisplayMode(GLUT_RGB);

glutInitWindowPosition(100,100);

glutInitWindowSize(200,200);

glutCreateWindow("window 1");

glutDisplayFunc(display);

glutMainLoop();}

Output
2. Program that display point

You might also like