Xors3d Engine
Brushes

Functions

BBDECL void BBCALL xBrushAlpha (Brush *brush, float alpha)
 Sets the alpha level of a brush.
BBDECL void BBCALL xBrushBlend (Brush *brush, int blend)
 Sets the blending mode for a brush.
BBDECL void BBCALL xBrushColor (Brush *brush, int red, int green, int blue)
 Sets the colour of a brush.
BBDECL void BBCALL xBrushFX (Brush *brush, int FX)
 Sets miscellaneous effects for a brush.
BBDECL void BBCALL xBrushName (Brush *brush, const char *name)
 Sets brush name.
BBDECL void BBCALL xBrushShininess (Brush *brush, float shininess)
 Sets the specular shininess of a brush.
BBDECL void BBCALL xBrushTexture (Brush *brush, Texture *texture, int frame=0, int index=0)
 Assigns a texture to a brush.
BBDECL Brush *BBCALL xCreateBrush (float red=255.0f, float green=255.0f, float blue=255.0f)
 Creates a brush and returns a brush handle.
BBDECL void BBCALL xFreeBrush (Brush *brush)
 Frees up a brush.
BBDECL float BBCALL xGetBrushAlpha (Brush *brush)
 Returns brush alpha value.
BBDECL int BBCALL xGetBrushBlend (Brush *brush)
 Returns brush blend mode.
BBDECL int BBCALL xGetBrushBlue (Brush *brush)
 Returns brush blue diffuse color.
BBDECL int BBCALL xGetBrushFX (Brush *brush)
 Returns brush FX flags.
BBDECL int BBCALL xGetBrushGreen (Brush *brush)
 Returns brush green diffuse color.
BBDECL const char *BBCALL xGetBrushName (Brush *brush)
 Returns brush name.
BBDECL int BBCALL xGetBrushRed (Brush *brush)
 Returns brush red diffuse color.
BBDECL float BBCALL xGetBrushShininess (Brush *brush)
 Returns brush shininess value.
BBDECL Texture *BBCALL xGetBrushTexture (Brush *brush, int index=0)
 Returns texture assigned to brush.
BBDECL Brush *BBCALL xLoadBrush (const char *path, int flags=9, float xScale=1.0f, float yScale=1.0f)
 Creates a brush, loads and assigns a texture to it, and returns a brush handle.

Function Documentation

BBDECL Brush* BBCALL xLoadBrush ( const char *  path,
int  flags = 9,
float  xScale = 1.0f,
float  yScale = 1.0f 
)

Creates a brush, loads and assigns a texture to it, and returns a brush handle.

Parameters:
pathFilename of texture
flagsLoading flags. See 'Texture loading flags' for more information
xScaleBrush u scale
yScaleBrush v scale
BBDECL Brush* BBCALL xCreateBrush ( float  red = 255.0f,
float  green = 255.0f,
float  blue = 255.0f 
)

Creates a brush and returns a brush handle.

The green, red and blue values allow you to set the colour of the brush. Values should be in the range [0; 255]. If omitted the values default to 255. A brush is a collection of properties such as color, alpha, shininess, textures, etc that are all stored as part of the brush. Then, all these properties can be applied to an entity, mesh or surface at once just by using xPaintEntity(), xPaintMesh() or xPaintSurface(). When creating your own mesh, if you wish for certain surfaces to look differently from one another, then you will need to use brushes to paint individual surfaces. Using commands such as xEntityColor(), xEntityAlpha() will apply the effect to all surfaces at once, which may not be what you wish to achieve.

Parameters:
redBrush red value
greenBrush green value
blueBrush blue value
BBDECL void BBCALL xFreeBrush ( Brush *  brush)

Frees up a brush.

Parameters:
brushBrush handle
BBDECL Texture* BBCALL xGetBrushTexture ( Brush *  brush,
int  index = 0 
)

Returns texture assigned to brush.

Parameters:
brushBrush handle
indexTexture layer index. Must be in range 0-7
BBDECL void BBCALL xBrushColor ( Brush *  brush,
int  red,
int  green,
int  blue 
)

Sets the colour of a brush.

The green, red and blue values should be in the range [0; 255]. The default brush color is 255, 255, 255. Please note that if xEntityFX() or xBrushFX() flag FX_VERTEXCOLOR is being used, brush colour will have no effect and vertex colours will be used instead.

Parameters:
brushBrush handle
redRed value of brush
greenGreen value of brush
blueBlue value of brush
BBDECL void BBCALL xBrushAlpha ( Brush *  brush,
float  alpha 
)

Sets the alpha level of a brush.

The alpha value should be in the range [0.0; 1.0]. The default brush alpha setting is 1.0. The alpha level is how transparent an entity is. A value of 1.0 will mean the entity is non-transparent, i.e. opaque. A value of 0.0 will mean the entity is completely transparent, i.e. invisible. Values between 0.0 and 1.0 will cause varying amount of transparency accordingly, useful for imitating the look of objects such as glass and ice.

Parameters:
brushBrush handle
alphaAlpha level of brush
BBDECL void BBCALL xBrushShininess ( Brush *  brush,
float  shininess 
)

Sets the specular shininess of a brush.

The shininess value should be in the range [0.0; 1.0]. The default shininess setting is 0.0 Shininess is how much brighter certain areas of an object will appear to be when a light is shone directly at them. Setting a shininess value of 1.0 for a medium to high poly sphere, combined with the creation of a light shining in the direction of it, will give it the appearance of a shiny snooker ball

Parameters:
brushBrush handle
shininessShininess of brush
BBDECL void BBCALL xBrushBlend ( Brush *  brush,
int  blend 
)

Sets the blending mode for a brush.

Parameters:
brushBrush handle
blendBlending type. See 'Blending modes' for more infromation
BBDECL void BBCALL xBrushFX ( Brush *  brush,
int  FX 
)

Sets miscellaneous effects for a brush.

Flags can be added to combine two or more effects.

Parameters:
brushBrush handle
FXffects flags See 'FX flags' for more infromation
BBDECL void BBCALL xBrushTexture ( Brush *  brush,
Texture *  texture,
int  frame = 0,
int  index = 0 
)

Assigns a texture to a brush.

The optional frame parameter specifies which animation frame, if any exist, should be assigned to the brush. The optional index parameter specifies texture layer that the texture should be assigned to.

Parameters:
brushBrush handle
textureTexture handle
frameTexture frame
indexTexture layer
BBDECL const char* BBCALL xGetBrushName ( Brush *  brush)

Returns brush name.

Parameters:
brushBrush handle
BBDECL void BBCALL xBrushName ( Brush *  brush,
const char *  name 
)

Sets brush name.

Parameters:
brushBrush handle
nameNew brush name
BBDECL float BBCALL xGetBrushAlpha ( Brush *  brush)

Returns brush alpha value.

Parameters:
brushBrush handle
BBDECL int BBCALL xGetBrushBlend ( Brush *  brush)

Returns brush blend mode.

Parameters:
brushBrush handle
BBDECL int BBCALL xGetBrushRed ( Brush *  brush)

Returns brush red diffuse color.

Parameters:
brushBrush handle
BBDECL int BBCALL xGetBrushGreen ( Brush *  brush)

Returns brush green diffuse color.

Parameters:
brushBrush handle
BBDECL int BBCALL xGetBrushBlue ( Brush *  brush)

Returns brush blue diffuse color.

Parameters:
brushBrush handle
BBDECL int BBCALL xGetBrushFX ( Brush *  brush)

Returns brush FX flags.

Parameters:
brushBrush handle
BBDECL float BBCALL xGetBrushShininess ( Brush *  brush)

Returns brush shininess value.

Parameters:
brushBrush handle