OpenGL - %og[options]

In this section:

In order to open an OpenGL window with ClearWin+, you must use the %og (OpenGL Graphics Region) format code:

 i=winio('%og[static]')

%og takes an list of options consisting of any valid combination of the following:

double

This option is used for animation and causes OpenGL output to be sent to an in-memory buffer until the swap_opengl_buffers@ subroutine is called. This helps to reduce flicker at the expense of requiring more memory.

depth16

Specifies 16 bits of depth buffering.

depth32

Specifies 32 bits of depth buffering.

stencil

Stencil buffer. The stencil buffer is used to define masks used to prevent part of image being drawn. For example, OpenGL only allows convex polygons to be filled. More complex polygons require the use of the stencil buffer.

accum

The accumulation buffer is used to accumulate images for effects such as anti-aliasing motion blur, depth of field etc.

user_resize

Same as %gr (Graphics Region) usage.

static

Used to redraw window after it has been partially revealed.


Any combination of these attributes is permitted. Depth buffering is an option that can be omitted. If both depth16 and depth32 are specified, depth32 takes effect.

These attributes, with the exception of static, are directly analogous to the GLAUX equivalent. For example, the GLAUX attribute AUX_ACCUM is the same as the ClearWin+ attribute ACCUM.

Converting examples written using GLAUX to ClearWin+ is, therefore, relatively straight forward. Most of the differences arise through language choice rather than by the use of ClearWin+. A Fortran program will inevitably have a slightly different structure from a C program.

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited