Difference between revisions of "OpenGL"

From Free Pascal wiki
Jump to navigationJump to search
(The names of the diferent units are in bold)
Line 1: Line 1:
OpenGL ('''Open''' '''G'''raphics '''L'''ibrary) is a cross-platform API for producing 3D computer graphics. Most modern video cards provide hardware accelerated OpenGL support, wich makes OpenGL a good solution for writing advanced graphics software.
+
OpenGL is the platform independent standard library for 3D graphics. The same OpenGL commands works exactly the same under all platforms.
 +
The only platform dependent part is the creation of the OpenGL context. But this is already done by the following packages, so you just have to learn OpenGL.
  
 +
== OpenGL control ==
  
The FreePascal OpenGL interface consists of the following units:
+
Lazarus comes with a simple and easy to use OpenGL control, that provides an OpenGL context under the following platforms:
* '''gl''': This unit contains the main functionality such as drawing polygons, applying transformations, setting colors and materials,... Procedures always start with the preposition "gl".
+
 
* '''glu''': This unit contains OpenGL utils. Although it has some usefull functions, this unit is not necessary as you can implement all glu Procedures with the functionality of the gl unit. Procedures always start with the preposition "glu".
+
* Linux: GTK + GLX, ToDo: gtk2
* '''glext''': Vendors can provide additional functionality through extensions. Use this unit to use these extensions.
+
* FreeBSD: GTK + GLX, ToDo: gtk2
* '''glut''': This unit provides functionality for creating an OpenGL window. Although this is a cross-platform unit, most Windows operating systems don't have a glut dll by default.
+
* Windows: Win32 + WGL
* '''glx''': glx provides functionality to set up an OpenGL window in an x window system. Procedures always start with the preposition "glx". Obviously, you cannot use this unit on non-x window systems such as Windows.
+
* MacOSX: Carbon + AGL
 +
 
 +
Just install the package components/opengl/lazopenglcontext.lpk and have a look at the example.
 +
 
 +
== GLScene ==
 +
 
 +
There is a big Delphi package, that has been ported to Lazarus. Along with tools and editors integrated in the IDE.
 +
See [[GLScene]].
 +
 
 +
== Tutorials ==
 +
 
 +
There are a lot of tutorials at [http://nehe.gamedev.net/ nehe].

Revision as of 19:37, 14 January 2006

OpenGL is the platform independent standard library for 3D graphics. The same OpenGL commands works exactly the same under all platforms. The only platform dependent part is the creation of the OpenGL context. But this is already done by the following packages, so you just have to learn OpenGL.

OpenGL control

Lazarus comes with a simple and easy to use OpenGL control, that provides an OpenGL context under the following platforms:

  • Linux: GTK + GLX, ToDo: gtk2
  • FreeBSD: GTK + GLX, ToDo: gtk2
  • Windows: Win32 + WGL
  • MacOSX: Carbon + AGL

Just install the package components/opengl/lazopenglcontext.lpk and have a look at the example.

GLScene

There is a big Delphi package, that has been ported to Lazarus. Along with tools and editors integrated in the IDE. See GLScene.

Tutorials

There are a lot of tutorials at nehe.