OPEN GL

   The Open Graphics Library, or abbreviated as Open GL, is a program library for visualization of geometric objects. It comprises about 120 functions and procedures for creating objects and operations for their display and animation for high quality computer graphics.
    The Open GL is independent on an operation system (OpenGL API running also on Windows 95, 98, 2000, NT, or OS/2 and X Windows systems). Mostly, OpenGL requires a framebuffer from the graphics card. The majority of OpenGL functions relate to the rendering of objects; like for example: points, lines, polygons, bitmaps, as well as their parameters of rendering (e.g., either antialiasing is on or off). The existence of a framebuffer can make drawing these objects easier.

    From the programmer's point of view, OpenGL is a set of functions providing specification of objects in 2D or 3D space, together with procedures through which the quality of object rendering is set. A typical program using OpenGL starts with a call for opening a window in the framebuffer, where the program is visualized. Other calls serve for the allocation of GL parameters and their association to the display window. Subsequently, we can use OpenGL commands. Some calls serve for rendering simple geometrical objects (e.g., points, line elements, polygons), while others are affecting the rendering of these geometric forms, including their lighting and painting, and how they are mapped from the user 2D or 3D dimension of the model area onto the 2D screen. And, some other calls serve for checking the framebuffer as well as for reading and writing pixels.

    OpenGL maintains for itself a status information set. These statuses check how the objects are rendered into the framebuffer. Some of these statuses are accessible directly to the user.

    OpenGL maintains for itself a status information set. These statuses check how the objects are rendered into the framebuffer. Some of these statuses are accessible directly to the user.

    OpenGL represents an instrument for checking a set of specific rendering operations. OpenGL participates only in rendering into the framebuffer. It does not support other peripheries, like for instance a keyboard and so on.

     By 'graphical form' can be understood for instance a point, a line segment, or a square pixel (a square rastered into pixels). Every mode can be changed independently. Modes are sets of specified forms and other OpenGL operations. Forms are defined as a group of single or several vertexes. A vertex defines a point, a final point of an edge, or a corner of a polygon, where two edges met. Data (comprising coordinates, colors, normal, and texture coordinates) are associated to vertexes, and each vertex is created independently.

    OpenGL has direct control over basic operations in 2D and 3D graphics, in particular: transformation equations, light equation coefficients, antialiasing methods, and pixel operations. OpenGL contains a mechanism for the complex geometric representation of objects and rendering.

    Interpretation of OpenGL commands is client-server type, where the program (client) sends an instruction, and this is interpreted when OpenGL (server) performs it. The server can be, but does not have to be, on the same computer as the client. Through this it is made possible that OpenGL is network transparent.

 Additional OpenGL options

   Besides the standard functions for description of objects and defining a scene, OpenGL also has available the following instruments for:
 

  •   rendering visible edges (Z-buffer)
  •   setting parameters of the camera shooting a scene
  •   clipping objects
  •   application of textures on to objects, including mip-mapping
  •   defining light sources in the scene and setting light characteristics, including damping parameters
  •   antialiasing
  •   motion blur
  •   optimizing of processing set operations
  •   distributed processing ? calculation on the server

Example of simple OpenGL program for Microsoft VisualC++ 5.0:

/* /*
* simple.c 
* This program draw a rectangle on the black background 
*/ 

#include "glos.h" 

#include 
#include 
#include 

int main(int argc, char** argv) 

auxInitDisplayMode (AUX_SINGLE | AUX_RGB); 
auxInitPosition (0, 0, 500, 500); // window 
auxInitWindow ("Simple Openg GL example"); 

glClearColor (0.0, 0.0, 0.0, 0.0); 
glClear(GL_COLOR_BUFFER_BIT); 
glColor3f(1.0, 1.0, 1.0); // adjust color on the white 
glMatrixMode (GL_PROJECTION); 
glLoadIdentity (); 
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0); 

// polygon creation  
glBegin(GL_POLYGON); 
glVertex2f(-0.5, -0.5); 
glVertex2f(-0.5, 0.5); 
glVertex2f(0.5, 0.5); 
glVertex2f(0.5, -0.5); 
glEnd(); 

glFlush(); // draw 
_sleep (10000); 
return(0); 
}
 

Attention: : For correct compilation, in the menu (Visual C++ 5.0 and more) Project Setting, in the option Object/library modules, it is necessary to add the following libraries:
Opengl32.lib
Glu32.lib
Glau32.lib
If you do not have the given libraries you should download them at the addresses:   http://reality.sgi.com/mjk/glut3/glut3.html or http://reality.sgi.com/mjk/ .

INFO:

Framebuffer: the memory for frames; a frame is a pre-processed image, subsequently rendered, and when rendered, displayed on the screen.

CPU - processor, e.g., Pentium K6, and others

Literature used:

OpenGL Graphics Systems: A Specification (version 1.2.1.), Oct. 14, 1998, Oct. 14, 1998

OpenGL is a registered trademark of Silicon Graphics, Inc.

Copyright (c) 1999-2017 Juraj Štugel. www.netgraphics.sk