3. What is Open GL?
| Application Program interface.
| Multi-Platform or Cross-Platform API.
| Interact with GPU for accelerate Hardware.
| Easy to Use.
| Developed by Silicon Graphics in 1991.
| Managed by Khronos Group.
| Latest OpenGL 4.4 released in 22 July 2013
3/4/2014
By: VJY
3
4. Cont…
What is Open GL?
| Performance by GPU
| Control GPU using Graphics shaders
| GPU all rendering
Vertices
3/4/2014
Vertex
Processor
Clipper and
primitive assembler
By: VJY
Rasterizer
Fragment
processor
Pixels
4
6. What is GLUT
| Provides functionality common to all window
systems
|
|
|
|
Open a window
Get input from mouse and keyboard
Menus
Event-driven
| GLUT-based user interface library
| freeglut updates GLUT (written by Pawel W.
Olszta)
3/4/2014
By: VJY
6
7. What is GLEW
| OpenGL Extension Wrangler Library
| Makes it easy to access OpenGL extensions
available on a particular system
| Provide efficient run-time machinism
| Application needs only to include glew.h and run a
glewInit()
3/4/2014
By: VJY
7
11. Downloading
| Downloading required Software
• Dev C++
• Microsoft Visual Studio 2010 Express Edition
| Download Required Library
• Download OpenGL Library
• Download Supported Libraries
3/4/2014
By: VJY
11
12. Links
| Download Dev C++ http://goo.gl/DsLA
| Download MSVS 2010 http://goo.gl/liHnq
| Download Open GL for VS http://goo.gl/qckMm1
| Download Open GL for Dev C++ http://goo.gl/tgjHnu
| Download Glew for VS http://goo.gl/WuqD95
3/4/2014
By: VJY
12
16. Configure Open GL
| Open Microsoft SDKs folder path:
C:Program FilesMicrosoft
SDKsWindowsv7.0A
| Now copy the content of the files from the
freeglut and glew here in include and lib
directory. Such as:
Open lib folder of freeglut and copy freeglut.lib and
paste it inside the Lib of v7.0A
Open include folder of freeglut and copy header files
form gl folder to Gl folder of of v7.0A
Do same thing for the glew and for DevC++
3/4/2014
By: VJY
16
19. Compile and Run on MSVC
| Create a new project with a Name
File -> New -> Project
Select “Empty Project” and give a name
| Now Add an item using
Right Click on project in solution
explorer-> Add -> New item –> Select
C++ file -> Type name main.c -> Click
on add button
| Type or paste the source code you
downloaded
3/4/2014
By: VJY
19
20. Cont.
Compile and Run on MSVC
| Set Property of project
Right Click -> Properties -> select
All Configurations option from drop
down and do following setting
C/C++ -> Preprocessor
Preprocessor Definition:
_CRT_SECURE_NO_WARNINGS
WIN32
_DEBUG
_CONSOLE
3/4/2014
By: VJY
20
22. Cont.
Compile and Run on MSVC
C/C++ -> General
Warning Level : Level 4
Treat Warning as Errors Yes(/wx)
C/C++ -> Advanced
Compile As: Compile as C Code
Linker -> INput
Additional ..: Edit and add
glew32.lib
freeglut.lib
3/4/2014
By: VJY
22
23. Cont.
Compile and Run on MSVC
| Build Project
Build Menu -> Build ProjectName
| Add dll file
Open freeglut folder again copy freeglut.dll file
from bin folder and paste in project debug folder
Ex: C:UsersVJYDocumentsVisual Studio
2010Projects3March1Debug
| Debug
Debug -> Start Debugging (F5)
Successful!
3/4/2014
By: VJY
23
24. Compile and Run on DEVC++
| Create a new project with a Name
File -> New -> Project
Select “Console Application” and save
with a name
| Configure the project
Project -> Project Options ->
Parameter tabs and add following to linkers
-lglut32 -lglu32 -lopengl32 -lwinmm
-lgdi32
3/4/2014
By: VJY
24
25. Cont.
Compile and Run on DEVC++
| Type Source Code or paste it that is
downloaded sample.c
| Complied it
Execute -> Compile -> Done
| Run it
Execute -> Run
Successful !
3/4/2014
By: VJY
25
26. Summary of Program
glutInit(&argc,argv);
glutInitDisplayMode (GLUT_SINGLE |
GLUT_RGB);
glutInitWindowSize(500,500);
glutInitWindowPosition(0,0);
glutCreateWindow("simple");
glutDisplayFunc(display);
init();
glutMainLoop();
3/4/2014
By: VJY
26