EiffelOpenGL

Current release 0.2.0
January 1, 2002

EiffelOpenGL Examples sourceforge.net
www.opengl.org


-> Home
-> FAQ
-> Documentation
-> Download
-> Examples
-> Project page
-> Links


Contact:
paco@ieee.org

EGLUT Red book examples translated from C
All the example programs in this section are based on EGLUT. They are all translations of the C example programs in the Red Book.

All the programs are comprised of two classes; one class, called APPLICATION, that inherits from EGLUT_APPLICATION that acts as the root class for the program, and one class, called MAIN_WINDOW, that inherits from EGLUT_TOP_LEVEL_WINDOW. The MAIN_WINDOW class contains most of the program code. Among other things it contains code for handling all GLUT events that can be recieved by the program. In the examples below the source code for every application can be viewed by clicking on the program screenshot.

Example 1: lines

This example demonstrates the use of the OpenGL drawing primitive GL_LINES and the use of line stippling.

Specific EGL features used:

egl_begin ()
egl_end
egl_line_stipple () Eiffel source code

Example 2: torus

Eiffel source code This example demonstrates the use of OpenGL display lists. By pressing the 'x' and 'y' keys the torus can be made to rotate though the x and y axis respectively.

Specific EGL features used:

egl_new_list ()
egl_end_list
egl_call_list ()

Example 3: cube

Eiffel source code This example demonstrates a single modeling transformation and a single viewing transformation. A wireframe cube is rendered.

Specific EGL features used:

egl_scale_f ()
eglu_look_at ()
egl_translate_f ()
egl_frustum ()
eglu_perspective ()

Example 4: planet

Eiffel source code This example demonstrates shows how to do simpler composite modeling transformations and how to draw translated and rotated models . By pressing the 'd', 'h' and 'm' keys the planet and moon can be made to raotate around the sun and the planet respectively.

Specific EGL and EGLUT features used:

glut_wire_sphere ()
egl_rotate_f ()
egl_translate_f ()
egl_push_matrix
egl_pop_matrix

Example 5: teapots

Eiffel source code This example demonstrates how to draw objects with different material properties. A single light source illuminates the objects.

Specific EGL and EGLUT features used:

egl_material_fv ()
egl_material_f ()
glut_solid_teapot ()

Example 6: aapoly

Eiffel source code This example draws filled polygons with antialiased edges. The special GL_SRC_ALPHA_SATURATE blending function is used. Pressing the 't' key turns the antialiasing on and off.

Specific EGL features used:

egl_blend_func ()
egl_cull_face ()
egl_enable ()
egl_disable ()
egl_enable_client_state ()
egl_disable_client_state ()
egl_vertex_pointer_double ()
egl_color_pointer_double ()
egl_draw_elements_integer ()

Example 7: surface

Eiffel source code This example draws a NURBS surface in the shape of a symmetrical hill. The 'c' keyboard key allows you to toggle the visibility of the control points themselves. Note that some of the control points are hidden by the surface itself.

Specific EGL features used:

eglu_new_nurbs_renderer
eglu_nurbs_property
eglu_nurbs_surface
activate_nurbs_error_callback
on_nurbs_error

Other GLUT examples
When I get the time ... Take a look in the source code examples directory!
Some examples based on ISEs WEL
When I get the time ... Take a look in the source code examples directory!

Author: Paul Cohen
"$Date: 2002/01/08 20:20:27 $"
"$Revision: 1.6 $"