Sunteți pe pagina 1din 4

OpenGL

OpenGL (Open Graphics Library) is a standard specification defining a cross-


language, cross-platform API(Application Programming Interface) for writing
applications that produce 2D and 3D computer graphics.

 OpenGL was developed by Silicon Graphics Inc. (SGI) in 1992.


 OpenGL is managed by a non-profit technology consortium, the Khronos
Group.
 widely used in CAD, virtual reality, scientific visualization, information
visualization, and flight simulation. It is also used in video games.
 Written in C language.
 OpenGL serves two main purposes:
 To hide the complexities of interfacing with different 3D accelerators,
by presenting the programmer with a single, uniform interface.

 To hide the differing capabilities of hardware platforms, by requiring


that all implementations support the full OpenGL feature set (using
software emulation if necessary).
 OpenGL's basic operation is to accept primitives such as points, lines and
polygons, and convert them into pixels. This is done by a graphics pipeline
known as the OpenGL state machine.
 The OpenGL API is controlled by an independent board, the Architecture
Review Board (ARB).

The following list briefly describes the major graphics operations which OpenGL
performs to render an image on the screen.
1. Construct shapes from geometric primitives, thereby creating
mathematical descriptions of objects.
(OpenGL considers points, lines, polygons, images, and bitmaps to be
primitives.)
2. Arrange the objects in three-dimensional space and select the desired
vantage point for viewing the composed scene.
3. Calculate the color of all the objects. The color might be explicitly
assigned by the application, determined from specified lighting conditions,
obtained by pasting a texture onto the objects, or some combination of
these three actions.
4. Convert the mathematical description of objects and their associated
color information to pixels on the screen. This process is called
rasterization.

OpenGL was designed to be graphic output-only: it provides only rendering


functions. The core API has no concept of windowing systems, audio, printing to
the screen, keyboard/mouse or other input devices. While this seems restrictive
at first, it allows the code that does the rendering to be completely independent
of the operating system it is running on, allowing cross-platform development.
However, some integration with the native windowing system is required to allow
clean interaction with the host system. This is performed through the following
add-on APIs:

• GLX – X11 (including network transparency)


• WGL – Microsoft Windows
• CGL – Mac OS X. Better integration with Mac OS X's application frameworks
is provided by APIs layered on top of CGL: AGL for Carbon and NSOpenGL
for Cocoa.

Additionally, GLUT, SDL and the GLFW libraries provide functionality for basic
windowing using OpenGL, in a portable manner.

Some open source cross-platform toolkits, such as GTK+, Qt and WxWidgets,


include widgets to embed OpenGL contents.

Creating commands in OpenGL can take place in two different ways.


(1) It is possible for the programmer to create and save a list of commands that
can engage on a recurring basis. This is one of the more routine ways that the
program interface is used.

(2) It is also possible to create and execute one time commands within the
perimeters of the computer graphics as well.

Consider the case of working in a networked computer environment where many


computers are connected to one another by a digital network. In this situation,
the computer on which your program runs and issues OpenGL drawing commands
is called the client, and the computer that receives those commands and
performs the drawing is called the server. If there’s only one computer, and it is
both the client and the server.

Q: What is an API and why is it important?

Ans: An API provides a defined method for developing applications software.


Industry-standard APIs greatly simplify the software development process,
reducing development cost and time. Platform-independent APIs enable PC,
workstation, and supercomputing hardware vendors to provide high-performance
2D and 3D graphics solutions and enable ISVs to write an application once and
deploy it across many platforms.

 Provides 2D and 3D graphics functions, including modeling, transformations,


color, lighting, and smooth shading, as well as advanced features such as texture
mapping, NURBS, fog, alpha blending, and motion blur.

Q: How is OpenGL API is network-transparent ?

Ans: A defined common extension to the X Window System allows an OpenGL


client on one vendor's platform to run across a network to another vendor's
OpenGL server.

Q: What are the benefits of OpenGL for hardware and software developers?

Ans:

1. Industry standard. An independent consortium, the OpenGL Architecture


Review Board, guides the OpenGL specification. With broad industry support,
the OpenGL API is the only truly open, stable, vendor-neutral, multiplatform
graphics standard. OpenGL implementations have been available for more than
nine years on a wide variety of platforms. Additions to the specification are
well-controlled, and proposed updates are announced in time for developers to
adopt changes. Backward-compatibility requirements ensure that existing
applications do not become obsolete.
2. Reliable and portable. All OpenGL applications produce consistent visual
display results on any OpenGL API-conformant hardware, regardless of
operating system or windowing system.

3. Evolving. Because of its thorough and forward-looking design, the OpenGL


API allows new hardware innovations to be accessible through the API via the
OpenGL extension mechanism. In this way, innovations appear in the API in a
timely fashion, letting application developers and hardware vendors incorporate
new features into their normal product release cycles.

4. Scalable. Applications based on the OpenGL API can run on systems ranging
from consumer electronics to PCs, workstations, and supercomputers. As a
result, applications can scale to any class of machine that the developer chooses
to target.

5. Easy to use.The OpenGL API is well structured with an intuitive design and
logical commands. Efficient OpenGL routines typically result in applications
with fewer lines of code than those that make up programs generated using
other graphics libraries or packages. In addition, OpenGL drivers encapsulate
information about the underlying hardware, freeing the application developer
from having to design for specific hardware features.

6. Well-documented. Numerous books have been published about the OpenGL


API, and a great deal of sample code is readily available, making information
about the OpenGL API inexpensive and easy to obtain.

S-ar putea să vă placă și