Computer Graphics Lecture 5

advertisement
Computer Graphics
Lecture 5
Graphics Library
Graphics Library :
• There are many graphics library use with program
language to draw shape.
Example :
• Graphics.h with Borland C++
• The most common libraries use today is open
Graphical Libraries called Open GL
Open GL
• Basic library of functions is provided in Open GL
for specifying graphics
• Open GL use with all operating system with
program language.
Header files:• In all our graphics program, we need to include
the header file for Open GL library .
• For most application we will need also GLU, and
we need to include header file for windows
system , for instance, with Microsoft windows,
the header file, must be list before GL ,GLU.
• Because it contains macros needed by Microsoft
windows version to Open GL library.
Header files:Example :#include <windows .h>
#include <GL/gl.h>
#include <GL/glu.h>
Open GL role or characteristics
1)all Open GL instruction start with gl
2)all Open GL start with capital letter
3) Open GL code is sensitive case
4)if we define const start with GL and (-)all prefix
start by capital letter (GL- COLOR- BUFFER-BIT)
Open GL libraries
• GLU:- Open GL utility , provided routines for
setting up viewing ,and describing complex objects
with line and polygons.
• Every Open GL implementation includes GLU
library, and all GLU function name start with prefix
glu.
• Open inventor :- provides routines and
predefined object shapes for interactive three
dimensional application.
Open GL libraries
• PGL:- presentation to Open GL
• AGL:-apple GL, use as interface for window
management
Download