Note that several types represent fixedpoint numbers. The C compiler cannot directly create these from constants. Therefore if you want to pass an integer value of 42 to a function that expects an argument of e.g. type d2_point you would have to write :
function( 42 << 4 ); // conversion from integer to fixedpoint
see also D2_FIX4(x)
Basic Types | Note that several types represent fixedpoint numbers. |
Types | |
d2_device | void |
d2_context | void |
d2_renderbuffer | void |
d2_color | unsigned long |
d2_alpha | unsigned char |
d2_width | short (fixedpoint) |
d2_point | short (fixedpoint) |
d2_border | short |
d2_pattern | unsigned long |
d2_blitpos | unsigned short |
void
Abstract type. The application uses pointers of this type to hold the address of a device structure without knowing its internal layout.
see for example : d2_opendevice
void
Abstract type. The application uses pointers of this type to hold the address of a context structure without knowing its internal layout.
see for example : d2_newcontext
void
Abstract type. The application uses pointers of this type to hold the address of a renderbuffer structure without knowing its internal layout.
see for example : d2_newrenderbuffer
unsigned long
32bit RGB value. Upper 8bits are ignored but should be set to zero. All colors are passed to the driver in this format regardless of the framebuffer format.
see for example : d2_setcolor
unsigned char
Alpha information is passed as 8bit values. 255 representing fully opaque and 0 totally transparent colors.
see for example : d2_setalpha
short (fixedpoint)
Point defines a vertex component (e.g. the x coordinate of an endpoint) pixel position and is specified as a signed 1:11:4 fixedpoint number (1bit sign, 11 bits integer, 4 bits fraction). So the integer range is 2047 to -2048 and the smallest positive value is 1/16.
Points are stored as 16bit quantities because they represent direct screen coordinates and therefor do not become larger than 2047 even for HDTV resolutions.
see for example : d2_renderline
short
The border type is used only when setting clip borders. In contrast to points, borders do not contain any fractional information (no subpixel clipping) and are simple 11bit signed integers.
see for example : d2_cliprect
unsigned long
Patterns are Nbit bitmasks (N is 32 at most so they are passed as longs)
see for example : d2_setpattern
Create a new device handle.
d2_device * d2_opendevice( d2_u32 flags )
Create new context (used to store render settings).
d2_context * d2_newcontext( d2_device * handle )
Create a new renderbuffer.
d2_renderbuffer * d2_newrenderbuffer( d2_device * handle, d2_u32 initialsize, d2_u32 stepsize )
Set color registers.
d2_s32 d2_setcolor( d2_device * handle, d2_s32 index, d2_color color )
set constant alpha value
d2_s32 d2_setalpha( d2_device * handle, d2_alpha alpha )
Render a wide line.
d2_s32 d2_renderline( d2_device * handle, d2_point x1, d2_point y1, d2_point x2, d2_point y2, d2_width w, d2_u32 flags )
Specify the clipping rectangle.
d2_s32 d2_cliprect( d2_device * handle, d2_border xmin, d2_border ymin, d2_border xmax, d2_border ymax )
Specify pattern bitmask.
d2_s32 d2_setpattern( d2_device * handle, d2_pattern pattern )