Drawing


Modules

 Drawing base
 Clipping / Windowing
 Broken. Please see detailed description!
 Untextured geometry
 Untextured geometry (rectangles, lines, etc.).
 Images
 Image support in µLibrary.
 Advanced vertex commands
 Advanced vertex commands and depth management.

Data Structures

struct  UL_IMAGE

Defines

#define UL_SCREEN_WIDTH   256
#define UL_SCREEN_HEIGHT   192
#define ulEnableEdgeAntialiasing()   (GFX_CONTROL |= GL_ANTIALIAS)
#define ulDisableEdgeAntialiasing()   (GFX_CONTROL &= ~GL_ANTIALIAS)
#define ulSetTransparentColor(color)   (ul_colorKeyEnabled = 1, ul_colorKeyValue = color)
#define ulDisableTransparentColor()   (ul_colorKeyEnabled = 0)

Typedefs

typedef unsigned short UL_COLOR

Enumerations

enum  UL_SPECIAL_EFFECT { UL_FX_DEFAULT = 0, UL_FX_ALPHA = 1 }

Functions

void ulSetAlpha (UL_SPECIAL_EFFECT effect, int coeff, int polygroup)
void ulSetMainLcd (int position)
int ulGetMainLcd ()
void ulSetRegCapture (bool enable, uint8 srcBlend, uint8 destBlend, uint8 bank, uint8 offset, uint8 size, uint8 source, uint8 srcOffset)

Detailed Description

All about drawing!

Define Documentation

#define UL_SCREEN_WIDTH   256

Screen width

#define UL_SCREEN_HEIGHT   192

Screen height

 
#define ulEnableEdgeAntialiasing (  )     (GFX_CONTROL |= GL_ANTIALIAS)

Enables edge antialiasing

 
#define ulDisableEdgeAntialiasing (  )     (GFX_CONTROL &= ~GL_ANTIALIAS)

Disables edge antialiasing

#define ulSetTransparentColor ( color   )     (ul_colorKeyEnabled = 1, ul_colorKeyValue = color)

Sets the transparent color for loading images. Any pixel matching this color will be set as transparent upon loading. This does not have any effect ouside of loading images, and doesn't work for JPG format.

 
#define ulDisableTransparentColor (  )     (ul_colorKeyEnabled = 0)

Disables the transparent color setting (as it is by default). Useful if your image already has an alpha channel and you don't need to have a color key.


Typedef Documentation

typedef unsigned short UL_COLOR

Color type


Enumeration Type Documentation

enum UL_SPECIAL_EFFECT

Special effects

Enumerator:
UL_FX_DEFAULT  Opaque.
UL_FX_ALPHA  Alpha blending.


Function Documentation

void ulSetAlpha ( UL_SPECIAL_EFFECT  effect,
int  coeff,
int  polygroup 
)

Defines the transparency and grouping of objects. Everything drawn next to this command will use those alpha parameters. You can then restore the original state (opaque) by writing ulSetAlpha(UL_FX_DEFAULT, 0, 0).

Parameters:
effect can be UL_FX_DEFAULT for opaque or UL_FX_ALPHA for semi-transparency (alpha blending).
coeff blending coefficient: 0 = wireframe, 1 = nearly transparent, ..., 31 = nearly opaque. Has no effect with UL_FX_DEFAULT.
polygroup defines the polygon group of next objects. Objects with different polygroups will be blended together, while objects with the same polygroup will be merged and drawn as a single layer. In each group, the first object drawn will have the highest priority.
Example:
//Default (opaque) objects always have 0 as an ID. Any other value may cause garbage on real DS.
ulSetAlpha(UL_FX_DEFAULT, 0, 0);
//Draw a blue sky background
ulDrawFillRect(0, 0, 256, 192, RGB15(0, 16, 31));
//Set alpha to 1/2, set ID to 1 so that actual objects will be blended with the background (ID = 0)
ulSetAlpha(UL_FX_ALPHA, 16, 1);
//Draw a semi transparent image
ulDrawImage(anImage);
//Restore to default (opaque)
ulSetAlpha(UL_FX_DEFAULT, 0, 0);

void ulSetMainLcd ( int  position  )  [inline]

Set the main LCD, the one which is currently controlled by µLibrary.

Parameters:
position 
  • 0 = touchpad
  • 1 = top screen
You can also use the libnds macro lcdSwap if you simply want to swap the LCDs.

Note: By default, µLibrary controls the top screen.

int ulGetMainLcd (  )  [inline]

Returns 1 if µLibrary is currently drawing to the top screen, 0 if it is on the touchpad.

void ulSetRegCapture ( bool  enable,
uint8  srcBlend,
uint8  destBlend,
uint8  bank,
uint8  offset,
uint8  size,
uint8  source,
uint8  srcOffset 
)

Does a capture.


Generated on Sat Jul 14 23:39:33 2007 by  doxygen 1.5.2