Create buffers for use with a QNXGL context
qnxgl_bufs_t* qnxgl_buffers_create (
uint32_t fmt,
unsigned int buffers,
unsigned int w,
unsigned int h,
qnxgl_buf_attrib_t * attrib,
int interface_idx
);
- fmt
- The color buffer format. Color buffers must be of one of
these defined formats:
- QNXGL_FORMAT_PAL_8 -- 8 bit palettized
format
- QNXGL_FORMAT_ARGB8888 -- 8 bits alpha,
8 bits red, 8 bits green, 8 bits blue
- QNXGL_FORMAT_RGB888 -- 8 bits red, 8
bits green, 8 bits blue
- QNXGL_FORMAT_RGB565 -- 5 bits red, 6
bits green, 5 bits blue
- QNXGL_FORMAT_RGB556 -- 5 bits red, 5
bits green, 5 bits blue
- QNXGL_FORMAT_ARGB1555 -- 1 bit alpha,
5 bits red, 5 bits green, 5 bits blue
- QNXGL_FORMAT_BEST_RGB -- pick the fastest
RGB format
- QNXGL_FORMAT_BEST_PAL -- pick the fastest
palettized format
- buffers
- The number of color buffers you wish to create.
- w
- The width of the buffers, in pixels.
- h
- The height of the buffers, in scan lines.
- attrib
- The list of attributes you wish the buffers to have. This
parameter can be NULL for no attributes.
Set these attributes using the convenience functions listed below.
- interface_idx
- The OpenGL interface you wish to create the buffers for.
If -1, then qnxgl_buffers_create() attempts
to use the best interface it can find.
qnxgl
This function creates a set of buffers for use with a QNXGL context. These
buffers always include at least one color buffer, and may optionally have
other buffers associated with them (for example, a depth buffer
for use with depth testing).
In addition to the basic parameters of color format, number of
buffers, width, and height, there are other attributes that may
affect how the buffers are used or created. These attributes are
defined by an array of qnxgl_buf_attrib_t. The final
element in the array must be QNXGL_ATTRIB_END, which
you can set with qnxgl_attrib_set_end().
You can use the following convenience functions to set attributes
in a qnxgl_buf_attrib_t array:
- qnxgl_buf_attrib_t* qnxgl_attrib_set_accum ( qnxgl_buf_attrib_t
* attrib, uint8_t accum_bits )
- The application requires an accumulation buffer. The accum_bits argument
is the number of bits per element for the accumulation buffer.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_depth ( qnxgl_buf_attrib_t
* attrib, uint8_t depth_bits )
- The application requires a depth buffer. The depth_bits argument
is the number of bits per element for the depth buffer.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_end ( qnxgl_buf_attrib_t
* attrib )
- Mark the end of the array.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_force_hw ( qnxgl_buf_attrib_t
* attrib )
- The buffer is only to be created using an OpenGL renderer that
uses a hardware renderer. If there is no hardware support,
qnxgl_buffers_create() returns NULL.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_force_sw ( qnxgl_buf_attrib_t
* attrib )
- The buffer is only to be created using an OpenGL renderer
that uses a software renderer.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_hint_fullscreen
( qnxgl_buf_attrib_t * attrib )
- The application will use this buffer full screen. Setting this
option allows the OpenGL stack to optimize the buffer, but doesn't
necessarily change the video mode.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_stencil ( qnxgl_buf_attrib_t
* attrib, uint8_t stencil_bits )
- The application requires a stencil buffer. The stencil_bits argument is
the number of bits per element for the stencil buffer.
- qnxgl_buf_attrib_t* qnxgl_attrib_set_stereo ( qnxgl_buf_attrib_t
* attrib )
- The application requires stereo rendering.
|
If neither qnxgl_attrib_set_force_hw() nor
qnxgl_attrib_set_force_sw() is set, the qnxgl library generally tries to
create a hardware renderer buffer first, then falls back to a software renderer buffer. |
You should destroy buffers created with qnxgl_buffers_create() with
qnxgl_buffers_destroy() when you're through with them.
A pointer to an opaque qnxgl_bufs_t, or NULL on
failure.
See the code example in the "OpenGL" section of the Raw Drawing and Animation chapter
in the Photon Programmer's Guide.
Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
qnxgl_buffers_destroy()
"OpenGL" section of the Raw Drawing and Animation chapter
in the Photon Programmer's Guide