1. What is OpenGL?
OpenGL is a library of 2D/3D graphic functions, which comes in the form of two DLLs - opengl32.dll and glu32.dll. OpenGL is open source and is a direct competitor to the Microsoft DirectX technologies. OpenGL exposes several hundred API (functions) which PowerBASIC programmers can use in their applications.
OpenGL works at the "primitive" level. It draws only such basic shapes as points, lines, triangles, quads, and other polygons. This means that OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact steps required to render a scene. This contrasts with descriptive languages where a programmer only needs to describe a scene and can let the library manage the details of rendering it.
2. Where do I get OpenGL?
The two OpenGL DLLs are included with Windows. You do not have to download any library files nor do you have to include the OpenGL DLLs in the distribution of your applications. See question #9 below for version release information and for instructions on how to determine which version of OpenGL is installed in your system.
3. Where can I get the OpenGL include files?
Jose Roca has created include files for both of the OpenGL DLLs. The two includes (gl.inc and glu.inc) are available at his web site and are included in his Windows API headers download file.
4. Where are some good sources of information about OpenGL?
There are literally hundreds of sites which provide information about OpenGL. Most, however are not directed towards PowerBASIC programming. Here are some of the more popular sites:
These additional sites provide information specific to using OpenGL with PowerBASIC:
Finally, there are two OpenGL books that get good press. Neither is PowerBASIC specific.
5. How do I use OpenGL in PowerBASIC?
In general, there are 3 steps involved in using OpenGL in your PowerBASIC application:
Source code examples of applying these steps to your PowerBASIC application may be found in the PowerBASIC Source Code forum as well as on a few external web sites. Here are the links a DDT and SDK introductory example:
6. How does OpenGL compare with DirectX?
In general, both OpenGL and DirectX have their proponents. And both technologies have been successfully used in commercial products, including games. So whether one technology has an edge over the other is an ongoing debate. Go to Google and type in "opengl vs directx" and you'll find hundreds of discussions on this topic.
7. Are There Limitations to OpenGL?
There are two feature sets which OpenGL does not provide, that PowerBASIC programmers should be aware of:
8. What is GLUT?
The two limitations mentioned above spawned several attempts to provide extensions to OpenGL to provide the windowing and user interface capabilities. Today, there are two available free libraries, GLUT (glut32.dll) and freeGLUT (freeglut.dll) which are very popular. Neither is distributed with Windows, but can be downloaded at their respective home pages:
GLUT was last updated in 2001 but is still used by many programmers, whereas freeGLUT continues to be developed. The include files for both of these can be found at Jose Roca's web site.
9. What is the latest version of OpenGL?
4.0 is the latest version. Here's a history of version releases. To determine which version of OpenGL is installed on your system, you can use the source code provided here or this freeware utility. Both of these also provide information on OpenGL features supported by your system.
10. Are there 3rd party tools are available that to help me add OpenGL to my PowerBASIC applications?
There are several categories of tools which can help:
Graphic Libaries:
- GDImage - graphics library which supports OpenGL features
Utilities:
- GLView4 - analyze installed OpenGL features and hardware capabilities
I welcome comments, suggestions, or corrections to this FAQ.
Gary Beene
OpenGL is a library of 2D/3D graphic functions, which comes in the form of two DLLs - opengl32.dll and glu32.dll. OpenGL is open source and is a direct competitor to the Microsoft DirectX technologies. OpenGL exposes several hundred API (functions) which PowerBASIC programmers can use in their applications.
OpenGL works at the "primitive" level. It draws only such basic shapes as points, lines, triangles, quads, and other polygons. This means that OpenGL is a low-level, procedural API, requiring the programmer to dictate the exact steps required to render a scene. This contrasts with descriptive languages where a programmer only needs to describe a scene and can let the library manage the details of rendering it.
2. Where do I get OpenGL?
The two OpenGL DLLs are included with Windows. You do not have to download any library files nor do you have to include the OpenGL DLLs in the distribution of your applications. See question #9 below for version release information and for instructions on how to determine which version of OpenGL is installed in your system.
3. Where can I get the OpenGL include files?
Jose Roca has created include files for both of the OpenGL DLLs. The two includes (gl.inc and glu.inc) are available at his web site and are included in his Windows API headers download file.
4. Where are some good sources of information about OpenGL?
There are literally hundreds of sites which provide information about OpenGL. Most, however are not directed towards PowerBASIC programming. Here are some of the more popular sites:
These additional sites provide information specific to using OpenGL with PowerBASIC:
- NeHe Productions
- OpenGL for PowerBASIC (Gary Beene's web site)
- OpenGL Forums (Jose Roca's web site)
Finally, there are two OpenGL books that get good press. Neither is PowerBASIC specific.
- OpenGL Programming Guide ("Red" Book) (Shreiner)
- OpenGL SuperBible (Wright)
5. How do I use OpenGL in PowerBASIC?
In general, there are 3 steps involved in using OpenGL in your PowerBASIC application:
- Use Window's API to create an OpenGL-compatible drawing canvas (dialog or control)
- Use PowerBASIC code to detect user actions (mouse/keyboard)
- Use OpenGL function to draw your 3D scenes
Source code examples of applying these steps to your PowerBASIC application may be found in the PowerBASIC Source Code forum as well as on a few external web sites. Here are the links a DDT and SDK introductory example:
6. How does OpenGL compare with DirectX?
In general, both OpenGL and DirectX have their proponents. And both technologies have been successfully used in commercial products, including games. So whether one technology has an edge over the other is an ongoing debate. Go to Google and type in "opengl vs directx" and you'll find hundreds of discussions on this topic.
7. Are There Limitations to OpenGL?
There are two feature sets which OpenGL does not provide, that PowerBASIC programmers should be aware of:
- 1. OpenGL cannot create windows
You must use PowerBASIC and API functions (DDT or SDK) to create the window in which OpenGL will work - 2. OpenGL cannot receive user inputs
Mouse and keyboard events are not detected by OpenGL. You must use PowerBASIC and API functions to monitor mouse and keyboard activity.
8. What is GLUT?
The two limitations mentioned above spawned several attempts to provide extensions to OpenGL to provide the windowing and user interface capabilities. Today, there are two available free libraries, GLUT (glut32.dll) and freeGLUT (freeglut.dll) which are very popular. Neither is distributed with Windows, but can be downloaded at their respective home pages:
GLUT was last updated in 2001 but is still used by many programmers, whereas freeGLUT continues to be developed. The include files for both of these can be found at Jose Roca's web site.
9. What is the latest version of OpenGL?
4.0 is the latest version. Here's a history of version releases. To determine which version of OpenGL is installed on your system, you can use the source code provided here or this freeware utility. Both of these also provide information on OpenGL features supported by your system.
- 4.0 2010
- 3.3 2010
- 3.2 2009
- 3.1 2008
- 3.0 2008
- 2.1 2006
- 2.0 2004
- 1.5 2003
- 1.4 2002
- 1.3 2001
- 1.2 1998
- 1.1 1992
- 1.0 1992
10. Are there 3rd party tools are available that to help me add OpenGL to my PowerBASIC applications?
There are several categories of tools which can help:
Graphic Libaries:
- GDImage - graphics library which supports OpenGL features
Utilities:
- GLView4 - analyze installed OpenGL features and hardware capabilities
I welcome comments, suggestions, or corrections to this FAQ.
Gary Beene
Comment