Libraries
Articles

OpenGL

From Libzter

Share/Save/Bookmark
Jump to: navigation, search


OpenGL

Developer(s)Silicon Graphics
Initial Release1992
Current Version3.1
Language(s)all major
Licence(s)various
Platform(s)independent

Contents

[edit] OpenGL

OpenGL is a graphics library mostly used for real-time graphics rendering. This library is developed by Silicon Graphics, but many companies and organizations are involved in the development process.


[edit] Example

A simple example of OpenGL render code in C that renders a blue square.

glClear( GL_COLOR_BUFFER_BIT ); /* clear the screen */
glMatrixMode( GL_PROJECTION );  /* Seting up the scene projection*/    
glLoadIdentity();                    
glFrustum(-1, 1, -1, 1, 1, 100); 
 
glMatrixMode( GL_MODELVIEW ); /* clear the current model matrix */
glLoadIdentity();                  
glTranslatef( 0, 0, -3 ); /* moves the object 3 units on the z-axis*/          
 
/* Draws a polygon with 4 vertices and color blue*/
glBegin( GL_POLYGON );              
glColor3f( 0, 0, 1 );               
glVertex3f( -1, -1, 0 );            
glVertex3f( -1, 1, 0 );            
glVertex3f( 1, 1, 0 );              
glVertex3f( 1, -1, 0 );             
glEnd();

[edit] Language Bindings and wrappers

OpenGL is supported by a large number of languages. You can probably find your favourite language among them.

[edit] Advantages

  • Probably the best and most standard 3d graphics library that works on most platforms
  • All implementations has to support the full OpenGL feature set - if not in hardware, so in software.

Library Navigation

  • Language

  • Category
Google AdSense