Difference between revisions of "OpenGL Introduction"

From LinuxMCE
Jump to: navigation, search
m (spelling corrections)
Line 1: Line 1:
 
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>OpenGL is one API (Application Programming Interface) originally written by SGI that enable using your graphic hardware.
 
<table width="100%"> <tr><td bgcolor="#FFCFCF">This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007.  In general any information should apply to LinuxMCE.  However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.</td></tr> </table>OpenGL is one API (Application Programming Interface) originally written by SGI that enable using your graphic hardware.
The specifications are defined at the adress www.opengl.org
+
The specifications are defined at the address www.opengl.org
 
The actual implementation match the OpenGL version 1.1 (means that is compatible with most mainstream boards that offer hardware acceleration), but future implementations may not match that compatibility.
 
The actual implementation match the OpenGL version 1.1 (means that is compatible with most mainstream boards that offer hardware acceleration), but future implementations may not match that compatibility.
  
 
OpenGL architecture is in that way:
 
OpenGL architecture is in that way:
  
- OpenGL context is attached with an window (may be any widget) and the programmer then call drawing commands. When they are valid and ready to be drawed they became effective. OpenGL works too as a state machine, which means that at one moment exist only one function and one way to draw. To change it, you must change the current function, OpenGL flags, etc.
+
- OpenGL context is attached with an window (may be any widget) and the programmer then call drawing commands. When they are valid and ready to be drawn they became effective. OpenGL works too as a state machine, which means that at one moment exist only one function and one way to draw. To change it, you must change the current function, OpenGL flags, etc.
  
 
- drawing operations are mathematically based, which means that you may translate, rotate, scale using predefined functions. For doing that exist functions as: glTranslate, glRotate, etc. To recover the scale and positions to be defaults, you may call glLoadIdentity()
 
- drawing operations are mathematically based, which means that you may translate, rotate, scale using predefined functions. For doing that exist functions as: glTranslate, glRotate, etc. To recover the scale and positions to be defaults, you may call glLoadIdentity()
Line 11: Line 11:
 
- OpenGL have more drawing perspectives, but for now the perspective used is orthogonal one (means that even the distance of the object increase, the object will not became smaller)
 
- OpenGL have more drawing perspectives, but for now the perspective used is orthogonal one (means that even the distance of the object increase, the object will not became smaller)
  
- OpenGL drawing commands are between glBegin and glEnd, and glBegin gets one parameter that say which mode will be drawn. For instance the mode GL_TRIANGLES will draw one triangle only after three points will be displayed, but GL_TRIANGLESTRIP, the first triangle will be drawed after three points. but the every next point with last two points in the definition of the last drawn triangle will made one new triangle
+
- OpenGL drawing commands are between glBegin and glEnd, and glBegin gets one parameter that say which mode will be drawn. For instance the mode GL_TRIANGLES will draw one triangle only after three points will be displayed, but GL_TRIANGLESTRIP, the first triangle will be drawn after three points. but the every next point with last two points in the definition of the last drawn triangle will made one new triangle
  
 
- current OpenGL implementation use double-buffer and that may mean that until a SwapBuffer command, no result will be shown
 
- current OpenGL implementation use double-buffer and that may mean that until a SwapBuffer command, no result will be shown

Revision as of 15:48, 10 December 2006

This page was written by Pluto and imported with their permission when LinuxMCE branched off in February, 2007. In general any information should apply to LinuxMCE. However, this page should be edited to reflect changes to LinuxMCE and remove old references to Pluto.
OpenGL is one API (Application Programming Interface) originally written by SGI that enable using your graphic hardware.

The specifications are defined at the address www.opengl.org The actual implementation match the OpenGL version 1.1 (means that is compatible with most mainstream boards that offer hardware acceleration), but future implementations may not match that compatibility.

OpenGL architecture is in that way:

- OpenGL context is attached with an window (may be any widget) and the programmer then call drawing commands. When they are valid and ready to be drawn they became effective. OpenGL works too as a state machine, which means that at one moment exist only one function and one way to draw. To change it, you must change the current function, OpenGL flags, etc.

- drawing operations are mathematically based, which means that you may translate, rotate, scale using predefined functions. For doing that exist functions as: glTranslate, glRotate, etc. To recover the scale and positions to be defaults, you may call glLoadIdentity()

- OpenGL have more drawing perspectives, but for now the perspective used is orthogonal one (means that even the distance of the object increase, the object will not became smaller)

- OpenGL drawing commands are between glBegin and glEnd, and glBegin gets one parameter that say which mode will be drawn. For instance the mode GL_TRIANGLES will draw one triangle only after three points will be displayed, but GL_TRIANGLESTRIP, the first triangle will be drawn after three points. but the every next point with last two points in the definition of the last drawn triangle will made one new triangle

- current OpenGL implementation use double-buffer and that may mean that until a SwapBuffer command, no result will be shown