Framebuffer and view specific functions.
Viewport Functions | Framebuffer and view specific functions. |
Clipping | |
d2_cliprect | Specify the clipping rectangle. |
d2_getcliprect | Get the clipping rectangle. |
Framebuffer management | |
d2_framebuffer | Specify the rendering target. |
d2_getframebuffer | Get information about the rendering target |
d2_s32 d2_cliprect( d2_device * handle, d2_border xmin, d2_border ymin, d2_border xmax, d2_border ymax )
Specify the clipping rectangle.
No pixels outside the clipping rectangle are touched (rendered or read). The clipping borders are specified as integer positions (in contrast to rendering where subpixel positions are supported).
The driver checks whether the specified rectangle fits within the framebuffer memory (by checking the dimensions given with d2_framebuffer). Cliprects will be automatically adjusted to fit inside the framebuffer region.
handle | device pointer (see: d2_opendevice) |
xmin | integer pixel position of left border (inclusive) |
ymin | integer pixel position of top border (inclusive) |
xmax | integer pixel position of right border (inclusive) |
ymax | integer pixel position of bottom border (inclusive) |
errorcode (D2_OK if successfull) see list of Errorcodes for details
d2_s32 d2_getcliprect( d2_device * handle, d2_border * xmin, d2_border * ymin, d2_border * xmax, d2_border * ymax )
Get the clipping rectangle.
No pixels outside the clipping rectangle are touched (rendered or read). The clipping borders are specified as integer positions (in contrast to rendering where subpixel positions are supported).
handle | device pointer (see: d2_opendevice) |
xmin | pointer to an integer that receives pixel position of left border |
ymin | pointer to an integer that receives pixel position of top border |
xmax | pointer to an integer that receives pixel position of right border |
ymax | pointer to an integer that receives pixel position of bottom border |
errorcode (D2_OK if successfull) see list of Errorcodes for details
d2_s32 d2_framebuffer( d2_device * handle, void * ptr, d2_s32 pitch, d2_u32 width, d2_u32 height, d2_s32 format )
Specify the rendering target.
Use this function to define the framebuffer’s memory area and layout. All subsequent Rendering Functions will work on the given buffer.
Setting a new framebuffer will automatically adjust the cliprect to the maximum range [0 .. width-1] and [0 .. height-1]
handle | device pointer (see: d2_opendevice) |
ptr | address of the top left pixel (coordinate 0,0) |
pitch | number of pixels (not bytes) per scanline |
width | width of framebuffer in pixels (equal or less than pitch) |
height | height of framebuffer in pixels |
format | pixel encoding type (framebuffer format) |
d2_mode_alpha8 | monochrome 8bit per pixel |
d2_mode_rgb565 | colored 16bit per pixel |
d2_mode_argb8888 | colored 32bit per pixel |
d2_mode_argb4444 | colored 16bit per pixel |
d2_mode_rgba8888 | colored 32bit per pixel |
d2_mode_rgba4444 | colored 16bit per pixel |
errorcode (D2_OK if successfull) see list of Errorcodes for details
this function has no effect on what memory area is currently visible
d2_s32 d2_getframebuffer( d2_device * handle, void ** ptr, d2_s32 * pitch, d2_u32 * width, d2_u32 * height, d2_s32 * format )
Get information about the rendering target
Use this function to get information about the framebuffer’s memory area and layout (framebuffer pointer, pitch, size and format).
handle | device pointer (see: d2_opendevice) |
ptr | pointer to receive address of the top left pixel (coordinate 0,0) |
pitch | pointer to receive number of pixels (not bytes) per scanline |
width | pointer to receive width of framebuffer in pixels (equal or less than pitch) |
height | pointer to receive height of framebuffer in pixels |
format | pointer to receive pixel encoding type (framebuffer format) |
d2_mode_alpha8 | monochrome 8bit per pixel |
d2_mode_rgb565 | colored 16bit per pixel |
d2_mode_argb8888 | colored 32bit per pixel |
d2_mode_argb4444 | colored 16bit per pixel |
errorcode (D2_OK if successfull) see list of Errorcodes for details
Specify the clipping rectangle.
d2_s32 d2_cliprect( d2_device * handle, d2_border xmin, d2_border ymin, d2_border xmax, d2_border ymax )
Get the clipping rectangle.
d2_s32 d2_getcliprect( d2_device * handle, d2_border * xmin, d2_border * ymin, d2_border * xmax, d2_border * ymax )
Specify the rendering target.
d2_s32 d2_framebuffer( d2_device * handle, void * ptr, d2_s32 pitch, d2_u32 width, d2_u32 height, d2_s32 format )
Get information about the rendering target
d2_s32 d2_getframebuffer( d2_device * handle, void ** ptr, d2_s32 * pitch, d2_u32 * width, d2_u32 * height, d2_s32 * format )
Create a new device handle.
d2_device * d2_opendevice( d2_u32 flags )