- Main Page
- Classes
- Files

- File List
- File Members

# flGraphics2d.h File Reference

`#include "flGlobal.h"`
`#include "flTexture.h"`

Go to the source code of this file.

## Defines
#define | graphics2dDrawLineGradStruct(inLine, inSourceColor, inTargetColor) graphics2dDrawLineGrad(inLine.linePoints[0].x, inLine.linePoints[0].y, inSourceColor, inLine.linePoints[1].x, inLine.linePoints[1].y, inTargetColor)
#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)
#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)
#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)
#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)
#define | graphics2dDrawEllipseFilledGradStruct(inEllipse, inInnerColor, inOuterColor) graphics2dDrawEllipseFilledGrad(inEllipse.ellipseCenter.x, inEllipse.ellipseCenter.y, inEllipse.ellipseSize.x, inEllipse.ellipseSize.yx, inInnerColor, inOuterColor)
## Functions
void | graphics2dDrawLineGrad (int inSourceX, int inSourceY, u32 inSourceColor, int inTargetX, int inTargetY, u32 inTargetColor)
void | graphics2dDrawTriangleGrad (int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2)
void | graphics2dDrawTriangleFilledGrad (int inX0, int inY0, u32 inColor0, int inX1, int inY1, u32 inColor1, int inX2, int inY2, u32 inColor2)
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)
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)
void | graphics2dDrawEllipseFilledGrad (int inX, int inY, int inWidth, int inHeight, u32 inInnerColor, u32 inOuterColor)
void | graphics2dDrawPoint (int inX, int inY, u32 inColor)
void | graphics2dDrawLine (int inSourceX, int inSourceY, int inTargetX, int inTargetY, u32 inColor)
void | graphics2dDrawTriangle (int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, u32 inColor)
void | graphics2dDrawTriangleFilled (int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, u32 inColor)
void | graphics2dDrawQuad (int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, int inX3, int inY3, u32 inColor)
void | graphics2dDrawQuadFilled (int inX0, int inY0, int inX1, int inY1, int inX2, int inY2, int inX3, int inY3, u32 inColor)
void | graphics2dDrawRect (int inX, int inY, int inWidth, int inHeight, u32 inColor)
void | graphics2dDrawRectFilled (int inX, int inY, int inWidth, int inHeight, u32 inColor)
void | graphics2dDrawEllipse (int inX, int inY, int inWidth, int inHeight, u32 inColor)
void | graphics2dDrawEllipseFilled (int inX, int inY, int inWidth, int inHeight, u32 inColor)
void | graphics2dDrawSpheroidShaded (int inX, int inY, int inWidth, int inHeight, u32 inColor, float inShadeAngle)
void | graphics2dDrawTexture (int inX, int inY, int inWidth, int inHeight, Texture *inTex)
void | graphics2dDrawTextureSection (int inX, int inY, int inWidth, int inHeight, Texture *inTex, unsigned int inSrcX, unsigned int inSrcY, unsigned int inSrcWidth, unsigned int inSrcHeight)

## Define Documentation

#define graphics2dDrawEllipseFilledGradStruct | ( | inEllipse,
|  | inInnerColor,
|  | inOuterColor |  | ) | graphics2dDrawEllipseFilledGrad(inEllipse.ellipseCenter.x, inEllipse.ellipseCenter.y, inEllipse.ellipseSize.x, inEllipse.ellipseSize.yx, inInnerColor, inOuterColor)

Definition at line 39 of file flGraphics2d.h.

#define graphics2dDrawLineGradStruct | ( | inLine,
|  | inSourceColor,
|  | inTargetColor |  | ) | graphics2dDrawLineGrad(inLine.linePoints[0].x, inLine.linePoints[0].y, inSourceColor, inLine.linePoints[1].x, inLine.linePoints[1].y, inTargetColor)

Definition at line 34 of file flGraphics2d.h.

#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)

Definition at line 38 of file flGraphics2d.h.

#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)

Definition at line 37 of file flGraphics2d.h.

#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)

Definition at line 36 of file flGraphics2d.h.

#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)

Definition at line 35 of file flGraphics2d.h.

## Function Documentation

void graphics2dDrawEllipse | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inColor |
| ) |  |  |

Definition at line 359 of file flGraphics2d.c.

References FL_GRAPHICS_2D_ELLIPSE_EDGESPERRAD, FL_GRAPHICS_2D_ELLIPSE_MINLINES, MATH_PI, mathCosf(), mathSinf(), max, pos, vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by ntfyShowTime().

void graphics2dDrawEllipseFilled | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inColor |
| ) |  |  |

Definition at line 397 of file flGraphics2d.c.

References graphics2dDrawEllipseFilledGrad().

Referenced by ntfyShowTime().

void graphics2dDrawEllipseFilledGrad | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inInnerColor,
|  | u32 | inOuterColor |
| ) |  |  |

Definition at line 178 of file flGraphics2d.c.

References FL_GRAPHICS_2D_ELLIPSE_EDGESPERRAD, FL_GRAPHICS_2D_ELLIPSE_MINLINES, MATH_PI, mathCosf(), mathSinf(), max, pos, vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by graphics2dDrawEllipseFilled().

void graphics2dDrawLine | ( | int | inSourceX,
|  | int | inSourceY,
|  | int | inTargetX,
|  | int | inTargetY,
|  | u32 | inColor |
| ) |  |  |

Definition at line 253 of file flGraphics2d.c.

References vertVs::vertX, vertVs::vertY, and vertVs::vertZ.

Referenced by ntfyShowBattery(), and ntfyShowTime().

void graphics2dDrawLineGrad | ( | int | inSourceX,
|  | int | inSourceY,
|  | u32 | inSourceColor,
|  | int | inTargetX,
|  | int | inTargetY,
|  | u32 | inTargetColor |
| ) |  |  |

Definition at line 24 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

void graphics2dDrawPoint | ( | int | inX,
|  | int | inY,
|  | u32 | inColor |
| ) |  |  |

Definition at line 233 of file flGraphics2d.c.

References vertVs::vertX, vertVs::vertY, and vertVs::vertZ.

void graphics2dDrawQuad | ( | int | inX0,
|  | int | inY0,
|  | int | inX1,
|  | int | inY1,
|  | int | inX2,
|  | int | inY2,
|  | int | inX3,
|  | int | inY3,
|  | u32 | inColor |
| ) |  |  |

Definition at line 285 of file flGraphics2d.c.

References graphics2dDrawQuadGrad().

void graphics2dDrawQuadFilled | ( | int | inX0,
|  | int | inY0,
|  | int | inX1,
|  | int | inY1,
|  | int | inX2,
|  | int | inY2,
|  | int | inX3,
|  | int | inY3,
|  | u32 | inColor |
| ) |  |  |

Definition at line 289 of file flGraphics2d.c.

References graphics2dDrawQuadFilledGrad().

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 |
| ) |  |  |

Definition at line 144 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by graphics2dDrawQuadFilled().

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 |
| ) |  |  |

Definition at line 107 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by graphics2dDrawQuad().

void graphics2dDrawRect | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inColor |
| ) |  |  |

Definition at line 293 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by ntfyShowBattery().

void graphics2dDrawRectFilled | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inColor |
| ) |  |  |

Definition at line 337 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by ntfyShowBattery(), ntfyShowTime(), and ntfyTrayShow().

void graphics2dDrawSpheroidShaded | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | u32 | inColor,
|  | float | inShadeAngle |
| ) |  |  |

Definition at line 406 of file flGraphics2d.c.

References colorLumMult8888(), FL_GRAPHICS_2D_ELLIPSE_EDGESPERRAD, FL_GRAPHICS_2D_ELLIPSE_MINLINES, MATH_PI, mathCosf(), mathSinf(), max, pos, vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

void graphics2dDrawTexture | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | Texture * | inTex |
| ) |  |  |

Definition at line 471 of file flGraphics2d.c.

References debugWarning, graphicsDrawBuffer, SCREEN_PITCH, Texture::texAlpha, texBind(), Texture::texData, Texture::texDataWidth, Texture::texHeight, Texture::texPixelFormat, Texture::texStride, Texture::texWidth, vertTsVs::vertU, vertTsVs::vertV, vertTsVs::vertX, vertTsVs::vertY, vertTsVs::vertZ, and vmemAbsolutePtr.

void graphics2dDrawTextureSection | ( | int | inX,
|  | int | inY,
|  | int | inWidth,
|  | int | inHeight,
|  | Texture * | inTex,
|  | unsigned int | inSrcX,
|  | unsigned int | inSrcY,
|  | unsigned int | inSrcWidth,
|  | unsigned int | inSrcHeight |
| ) |  |  |

Definition at line 546 of file flGraphics2d.c.

References graphicsDrawBuffer, SCREEN_PITCH, Texture::texAlpha, texBind(), Texture::texData, Texture::texPixelFormat, Texture::texStride, vertTsVs::vertU, vertTsVs::vertV, vertTsVs::vertX, vertTsVs::vertY, vertTsVs::vertZ, and vmemAbsolutePtr.

void graphics2dDrawTriangle | ( | int | inX0,
|  | int | inY0,
|  | int | inX1,
|  | int | inY1,
|  | int | inX2,
|  | int | inY2,
|  | u32 | inColor |
| ) |  |  |

Definition at line 277 of file flGraphics2d.c.

References graphics2dDrawTriangleGrad().

void graphics2dDrawTriangleFilled | ( | int | inX0,
|  | int | inY0,
|  | int | inX1,
|  | int | inY1,
|  | int | inX2,
|  | int | inY2,
|  | u32 | inColor |
| ) |  |  |

Definition at line 281 of file flGraphics2d.c.

References graphics2dDrawTriangleFilledGrad().

void graphics2dDrawTriangleFilledGrad | ( | int | inX0,
|  | int | inY0,
|  | u32 | inColor0,
|  | int | inX1,
|  | int | inY1,
|  | u32 | inColor1,
|  | int | inX2,
|  | int | inY2,
|  | u32 | inColor2 |
| ) |  |  |

Definition at line 78 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by graphics2dDrawTriangleFilled().

void graphics2dDrawTriangleGrad | ( | int | inX0,
|  | int | inY0,
|  | u32 | inColor0,
|  | int | inX1,
|  | int | inY1,
|  | u32 | inColor1,
|  | int | inX2,
|  | int | inY2,
|  | u32 | inColor2 |
| ) |  |  |

Definition at line 46 of file flGraphics2d.c.

References vertCVs::vertColor, vertCVs::vertX, vertCVs::vertY, and vertCVs::vertZ.

Referenced by graphics2dDrawTriangle().