0% found this document useful (1 vote)
37 views

How To Set Up Opengl With Dev C

The document provides 6 steps to set up an OpenGL environment using Dev C++. It includes downloading the freeglut library, setting up include and library files, creating a new console project, linking the project to OpenGL, compiling and running a simple program to display a window.

Uploaded by

habtamu fentew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
37 views

How To Set Up Opengl With Dev C

The document provides 6 steps to set up an OpenGL environment using Dev C++. It includes downloading the freeglut library, setting up include and library files, creating a new console project, linking the project to OpenGL, compiling and running a simple program to display a window.

Uploaded by

habtamu fentew
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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