_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
linedraw_gl Namespace Reference

Functions

void DrawPixel (Uint32 color, int x, int y)
 
void DrawTransPixel (Uint32 color, int x, int y, unsigned char alpha)
 
void DrawPixelClip (Uint32 color, int x, int y)
 
void DrawTransPixelClip (Uint32 color, int x, int y, unsigned char alpha)
 
void DrawHLine (Uint32 color, int x, int y, int width)
 
void DrawTransHLine (Uint32 color, int x, int y, int width, unsigned char alpha)
 
void DrawHLineClip (Uint32 color, int x, int y, int width)
 
void DrawTransHLineClip (Uint32 color, int x, int y, int width, unsigned char alpha)
 
void DrawVLine (Uint32 color, int x, int y, int height)
 
void DrawTransVLine (Uint32 color, int x, int y, int height, unsigned char alpha)
 
void DrawVLineClip (Uint32 color, int x, int y, int height)
 
void DrawTransVLineClip (Uint32 color, int x, int y, int height, unsigned char alpha)
 
void DrawLine (Uint32 color, int x1, int y1, int x2, int y2)
 
static int ClipCodeLine (int x, int y)
 
static int LineIsUnclippedOnSameSide (int code1, int code2)
 
static int LineIsUnclipped (int code1, int code2)
 
void DrawLineClip (Uint32 color, int x1, int y1, int x2, int y2)
 
void DrawTransLine (Uint32 color, int sx, int sy, int dx, int dy, unsigned char)
 
void DrawTransLineClip (Uint32 color, int sx, int sy, int dx, int dy, unsigned char)
 
void DrawRectangle (Uint32 color, int x, int y, int w, int h)
 
void DrawTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void DrawRectangleClip (Uint32 color, int x, int y, int w, int h)
 
void DrawTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void FillRectangle (Uint32 color, int x, int y, int w, int h)
 
void FillTransRectangle (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void FillRectangleClip (Uint32 color, int x, int y, int w, int h)
 
void FillTransRectangleClip (Uint32 color, int x, int y, int w, int h, unsigned char alpha)
 
void DrawCircle (Uint32 color, int x, int y, int radius)
 
void DrawCircleClip (Uint32 color, int x, int y, int radius)
 
void DrawTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha)
 
void DrawTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha)
 
void FillCircle (Uint32 color, int x, int y, int radius)
 
void FillTransCircle (Uint32 color, int x, int y, int radius, unsigned char alpha)
 
void FillCircleClip (Uint32 color, int x, int y, int radius)
 
void FillTransCircleClip (Uint32 color, int x, int y, int radius, unsigned char alpha)
 
void InitLineDraw ()
 Init line draw. More...
 

Function Documentation

static int linedraw_gl::ClipCodeLine ( int  x,
int  y 
)
static

Delivers bitmask denoting given point is left/right/above/below clip rectangle, used for faster determinination of clipped position.

Parameters
xpixel's x position (not restricted to screen width)
ypixel's y position (not restricted to screen height)
void linedraw_gl::DrawCircle ( Uint32  color,
int  x,
int  y,
int  radius 
)

Draw circle.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
void linedraw_gl::DrawCircleClip ( Uint32  color,
int  x,
int  y,
int  radius 
)

Draw circle clipped.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
void linedraw_gl::DrawHLine ( Uint32  color,
int  x,
int  y,
int  width 
)

Draw horizontal line unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
widthwidth of line (0=don't draw).
void linedraw_gl::DrawHLineClip ( Uint32  color,
int  x,
int  y,
int  width 
)

Draw horizontal line clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
widthwidth of line (0=don't draw).
void linedraw_gl::DrawLine ( Uint32  color,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draw line unclipped into 32bit framebuffer.

Parameters
colorcolor
x1Source x coordinate on the screen
y1Source y coordinate on the screen
x2Destination x coordinate on the screen
y2Destination y coordinate on the screen
void linedraw_gl::DrawLineClip ( Uint32  color,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draw line clipped. Based on Sutherland-Cohen clipping technique (Replaces Liang/Barksy clipping algorithm in CVS version 1.18, which might be faster, but that one contained some BUGs)

Parameters
colorcolor
x1Source x coordinate on the screen
y1Source y coordinate on the screen
x2Destination x coordinate on the screen
y2Destination y coordinate on the screen
void linedraw_gl::DrawPixel ( Uint32  color,
int  x,
int  y 
)

Draw pixel unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
void linedraw_gl::DrawPixelClip ( Uint32  color,
int  x,
int  y 
)

Draw pixel clipped to current clip setting.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
void linedraw_gl::DrawRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Draw rectangle.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
void linedraw_gl::DrawRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Draw rectangle clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
void linedraw_gl::DrawTransCircle ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Draw translucent circle.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
alphaalpha value of pixels.
void linedraw_gl::DrawTransCircleClip ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Draw translucent circle clipped.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
alphaalpha value of pixels.
void linedraw_gl::DrawTransHLine ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)

Draw translucent horizontal line unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
widthwidth of line (0=don't draw).
alphaalpha value of pixels.
void linedraw_gl::DrawTransHLineClip ( Uint32  color,
int  x,
int  y,
int  width,
unsigned char  alpha 
)

Draw translucent horizontal line clipped.

Parameters
colorColor index
xX pixel coordinate on the screen
yY c pixeloordinate on the screen
widthWidth of line (0=don't draw)
alphaAlpha value of pixels
void linedraw_gl::DrawTransLine ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned  char 
)

Draw a transparent line

void linedraw_gl::DrawTransLineClip ( Uint32  color,
int  sx,
int  sy,
int  dx,
int  dy,
unsigned  char 
)

Draw a transparent line clipped

void linedraw_gl::DrawTransPixel ( Uint32  color,
int  x,
int  y,
unsigned char  alpha 
)

Draw translucent pixel unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
alphaalpha value of pixel.
void linedraw_gl::DrawTransPixelClip ( Uint32  color,
int  x,
int  y,
unsigned char  alpha 
)

Draw translucent pixel clipped to current clip setting.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
alphaalpha value of pixel.
void linedraw_gl::DrawTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
alphaalpha value of pixel.
void linedraw_gl::DrawTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
alphaalpha value of pixels.
void linedraw_gl::DrawTransVLine ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)

Draw translucent vertical line unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
heightheight of line (0=don't draw).
alphaalpha value of pixels.
void linedraw_gl::DrawTransVLineClip ( Uint32  color,
int  x,
int  y,
int  height,
unsigned char  alpha 
)

Draw translucent vertical line clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
heightheight of line (0=don't draw).
alphaalpha value of pixels.
void linedraw_gl::DrawVLine ( Uint32  color,
int  x,
int  y,
int  height 
)

Draw vertical line unclipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
heightheight of line (0=don't draw).
void linedraw_gl::DrawVLineClip ( Uint32  color,
int  x,
int  y,
int  height 
)

Draw vertical line clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
heightheight of line (0=don't draw).
void linedraw_gl::FillCircle ( Uint32  color,
int  x,
int  y,
int  radius 
)

Fill circle.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
void linedraw_gl::FillCircleClip ( Uint32  color,
int  x,
int  y,
int  radius 
)

Fill circle clipped.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
void linedraw_gl::FillRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Fill rectangle.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
void linedraw_gl::FillRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h 
)

Fill rectangle clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
void linedraw_gl::FillTransCircle ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Fill translucent circle clipped.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
alphaalpha value of pixels.
void linedraw_gl::FillTransCircleClip ( Uint32  color,
int  x,
int  y,
int  radius,
unsigned char  alpha 
)

Fill translucent circle clipped.

Parameters
colorcolor
xCenter x coordinate on the screen
yCenter y coordinate on the screen
radiusradius of circle
alphaalpha value of pixels.
void linedraw_gl::FillTransRectangle ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Draw translucent rectangle.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
alphaalpha value of pixel.
void linedraw_gl::FillTransRectangleClip ( Uint32  color,
int  x,
int  y,
int  w,
int  h,
unsigned char  alpha 
)

Fill rectangle translucent clipped.

Parameters
colorcolor
xx coordinate on the screen
yy coordinate on the screen
hheight of rectangle (0=don't draw).
wwidth of rectangle (0=don't draw).
alphaalpha value of pixels.
void linedraw_gl::InitLineDraw ( )

Init line draw.

Initialize line draw

static int linedraw_gl::LineIsUnclipped ( int  code1,
int  code2 
)
static

Denotes part of (or entire) line located outside clip rectangle (point 1 and/or 2 is outside clip rectangle)

Parameters
code1ClipCode of one point of line
code2ClipCode of second point of line
static int linedraw_gl::LineIsUnclippedOnSameSide ( int  code1,
int  code2 
)
static

Denotes entire line located at the same side outside clip rectangle (point 1 and 2 are both as left/right/above/below the clip rectangle)

Parameters
code1ClipCode of one point of line
code2ClipCode of second point of line
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.