|
|
POGL Tips and Tutorials
Please Submit sample code and code snippets to the POGL
team for possible inclusion on this site.
Game developers often use Full Screen mode to gain control of the user's entire display.
GLUT provides a portable mechanism to switch POGL to Full Screen mode:
Calling anytime outside of the rendering cycle will
switch your OpenGL window to Full Screen mode.
Calling resets to normal mode.
Special Notes:
On Windows, puts the OpenGL Window frame outside
of the user's desktop area; you need to call to offset the
window.
On some X11 window managers, does not hide the window frame;
instead, call and
to place the frame outside the desktop.
supports a Full Screen Game Mode on some platforms - however,
is not yet fully portable (fails on Windows and MacOS). The POGL
team plans to make fully portable in a future release, and will add
a glpRestoreWindow API.
The GL_framebuffer_object extension provides support for hardware offscreen rendering.
This allows a program to instruct the GPU to render to GPU memory, which can then be used
as a texture, or other data. This provides dramatically enhanced performance over
systems that render to offscreen system memory.
The Vertext Program extension allows you to load assembly-like instructions to your GPU to
dynamically modify vertex data. This allows you to animate or reshape your vertices/objects.
Similarly, the Fragment Program extension alows you to load assembly-like instructions to
your GPU to dynamically modify fragment data. You can think of fragments as virtual pixels -
data that has not yet been resolved to a device pixel.
OpenGL provides a pipeline where a model is composed of objects, which are constructed of
facet primitives (meshes, polygons, strips, quads, triagles), that are defined by vertices.
These vertices are passed through a Vertex Program/Shader, which may manipulate attributes
associated with the vertices, and sets up attributes that may later be used by the
Fragment Program/Shader.
OpenGL steps through all your facets, passing their vertices to your Vertex Program,
then rasterizes the fragments contained by the transformed facet, and passes this on
to the Fragment Program, which then calculates the final pixel value.
Vertex Program Example:
Fragment Program Example:
Note: the
in the Vertex Program is passed into the Fragment Program:
.
Using Vertex and Fragment Programs together:
|
|
|
|
|
|