- Main Page
- Classes
- Files

- File List
- File Members

# flGraphics2d.h

Go to the documentation of this file.

    00001 // Funclib Graphics2d v1.0.0
    00002 //
    00003 // This module contains functions for dealing with simple 2d graphics.
    00004 // Use it to draw in 2d games, or for huds/menus in 3d games.
    00005 // This module requires GRAPHICS to be compiled in, some functions only work
    00006 // when TEXTURES is also compiled in.
    00007 //
    00008 // Contributor(s): Flatmush
    00009
    00010
    00011
    00012 #ifndef FLGRAPHICS2D_H
    00013 #define FLGRAPHICS2D_H
    00014
    00015 #include "flGlobal.h"
    00016
    00017 #if FL_GRAPHICS_2D != 0
    00018
    00019 #if FL_TEXTURE != 0
    00020 #include "flTexture.h"
    00021 #endif
    00022
    00023 #ifdef __cplusplus
    00024 extern "C" {
    00025 #endif
    00026
    00027 extern void graphics2dDrawLineGrad(int inSourceX, int inSourceY, u32 inSourceColor, int inTargetX, int inTargetY, u32 inTargetColor);
    00028 extern void graphics2dDrawTriangleGrad(int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2);
    00029 extern void graphics2dDrawTriangleFilledGrad(int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2);
    00030 extern void graphics2dDrawQuadGrad(int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2, int inX3, int inY3, u32 inColor3);
    00031 extern void graphics2dDrawQuadFilledGrad(int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2, int inX3, int inY3, u32 inColor3);
    00032 extern void graphics2dDrawEllipseFilledGrad(int inX, int inY, int inWidth, int inHeight, u32 inInnerColor, u32 inOuterColor);
    00033
    00034 #define graphics2dDrawLineGradStruct(inLine, inSourceColor, inTargetColor)                 graphics2dDrawLineGrad(inLine.linePoints[0].x, inLine.linePoints[0].y, inSourceColor, inLine.linePoints[1].x, inLine.linePoints[1].y, inTargetColor)
    00035 #define graphics2dDrawTriangleGradStruct(inTriangle, inColor0, inColor1, inColor2)         graphics2dDrawTriangleGrad(inTriangle.triPoints[0].x, inTriangle.triPoints[0].y, inColor0, inTriangle.triPoints[1].x, inTriangle.triPoints[1].y, inColor1, inTriangle.triPoints[2].x, inTriangle.triPoints[2].y, inColor2)
    00036 #define graphics2dDrawTriangleFilledGradStruct(inTriangle, inColor0, inColor1, inColor2)   graphics2dDrawTriangleFilledGrad(inTriangle.triPoints[0].x, inTriangle.triPoints[0].y, inColor0, inTriangle.triPoints[1].x, inTriangle.triPoints[1].y, inColor1, inTriangle.triPoints[2].x, inTriangle.triPoints[2].y, inColor2)
    00037 #define graphics2dDrawQuadGradStruct(inQuad, inColor0, inColor1, inColor2, inColor3)       graphics2dDrawQuadGrad(inQuad.quadPoints[0].x, inQuad.quadPoints[0].y, inColor0, inQuad.quadPoints[1].x, inQuad.quadPoints[1].y, inColor1, inQuad.quadPoints[2].x, inQuad.quadPoints[2].y, inColor2, inQuad.quadPoints[3].x, inQuad.quadPoints[3].y, inColor3)
    00038 #define graphics2dDrawQuadDilledGradStruct(inQuad, inColor0, inColor1, inColor2, inColor3) graphics2dDrawQuadFiledGrad(inQuad.quadPoints[0].x, inQuad.quadPoints[0].y, inColor0, inQuad.quadPoints[1].x, inQuad.quadPoints[1].y, inColor1, inQuad.quadPoints[2].x, inQuad.quadPoints[2].y, inColor2, inQuad.quadPoints[3].x, inQuad.quadPoints[3].y, inColor3)
    00039 #define graphics2dDrawEllipseFilledGradStruct(inEllipse, inInnerColor, inOuterColor)       graphics2dDrawEllipseFilledGrad(inEllipse.ellipseCenter.x, inEllipse.ellipseCenter.y, inEllipse.ellipseSize.x, inEllipse.ellipseSize.yx, inInnerColor, inOuterColor)
    00040
    00041 extern void graphics2dDrawPoint(int inX, int inY, u32 inColor);
    00042 extern void graphics2dDrawLine(int inSourceX, int inSourceY, int inTargetX, int inTargetY, u32 inColor);
    00043 extern void graphics2dDrawTriangle(int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, u32 inColor);
    00044 extern void graphics2dDrawTriangleFilled(int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, u32 inColor);
    00045 extern void graphics2dDrawQuad(int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, int inX3, int inY3, u32 inColor);
    00046 extern void graphics2dDrawQuadFilled(int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, int inX3, int inY3, u32 inColor);
    00047 extern void graphics2dDrawRect(int inX, int inY, int inWidth, int inHeight, u32 inColor);
    00048 extern void graphics2dDrawRectFilled(int inX, int inY, int inWidth, int inHeight, u32 inColor);
    00049 extern void graphics2dDrawEllipse(int inX, int inY, int inWidth, int inHeight, u32 inColor);
    00050 extern void graphics2dDrawEllipseFilled(int inX, int inY, int inWidth, int inHeight, u32 inColor);
    00051
    00052 #if (FL_COLOR && FL_MATH)
    00053 extern void graphics2dDrawSpheroidShaded(int inX, int inY, int inWidth, int inHeight, u32 inColor, float inShadeAngle);//, bool inHShading);
    00054 #endif
    00055
    00056 #if FL_TEXTURE
    00057 extern void graphics2dDrawTexture(int inX, int inY, int inWidth, int inHeight, Texture* inTex);
    00058 extern void graphics2dDrawTextureSection(int inX, int inY, int inWidth, int inHeight, Texture* inTex, unsigned int inSrcX, unsigned int inSrcY, unsigned int inSrcWidth, unsigned int inSrcHeight);
    00059 #endif
    00060
    00061 #ifdef __cplusplus
    00062 }
    00063 #endif
    00064
    00065 #endif
    00066
    00067 #endif