Fireset
Loading...
Searching...
No Matches
Render

Basic 2D rendering primitives. More...

Classes

struct  FsColor
 RGB color representation. More...
struct  FsQuad
 Quadrilateral primitive. More...
struct  FsTriangle
 Triangle primitive. More...
struct  FsPoint
 Point primitive. More...
struct  FsCircle
 Circle primitive. More...
struct  FsLine
 Line primitive. More...
struct  FsSprite
 Sprite structure. More...

Functions

void fsDrawPixel (const FsPoint *p)
 Draws a pixel.
void fsDrawLine (const FsLine *line)
 Draws a line.
void fsDrawTriangle (const FsTriangle *tri)
 Draws a triangle.
void fsDrawQuad (const FsQuad *quad)
 Draws a quadrilateral.
void fsDrawCircle (const FsCircle *circle)
 Draws a circle.
void fsDrawSprite (const FsSprite *sprite)
 Draws a 2D sprite.
void fsOrthoSet (int width, int height)
 Sets the orthographic projection.
void fsClear (FsColor color)
 Clears the window.
FsColor FsColor_new (uint8_t r, uint8_t g, uint8_t b)
 Creates a color.

Detailed Description

Basic 2D rendering primitives.

Function Documentation

◆ fsClear()

void fsClear ( FsColor color)

Clears the window.

Clears the window and the OpenGL context using the specified color.

Parameters
colorClear color.

◆ FsColor_new()

FsColor FsColor_new ( uint8_t r,
uint8_t g,
uint8_t b )

Creates a color.

Parameters
rRed component (0-255).
gGreen component (0-255).
bBlue component (0-255).
Returns
Resulting color.

◆ fsDrawCircle()

void fsDrawCircle ( const FsCircle * circle)

Draws a circle.

Draws a colored circle.

Parameters
circleCircle to draw.

◆ fsDrawLine()

void fsDrawLine ( const FsLine * line)

Draws a line.

Draws a colored line using the provided line parameters.

Parameters
lineLine to draw.

◆ fsDrawPixel()

void fsDrawPixel ( const FsPoint * p)

Draws a pixel.

Draws a colored point at the specified position.

Parameters
pPoint to draw.

◆ fsDrawQuad()

void fsDrawQuad ( const FsQuad * quad)

Draws a quadrilateral.

Draws a colored quadrilateral.

Parameters
quadQuadrilateral to draw.

◆ fsDrawSprite()

void fsDrawSprite ( const FsSprite * sprite)

Draws a 2D sprite.

Renders a sprite on the window using its position, size, rotation angle, and texture. The sprite is drawn as a textured quad with OpenGL.

Parameters
spritePointer to the FsSprite to draw.
Note
The sprite's texture must be loaded and valid.
Uses OpenGL immediate mode for rendering.

◆ fsDrawTriangle()

void fsDrawTriangle ( const FsTriangle * tri)

Draws a triangle.

Draws a colored triangle.

Parameters
triTriangle to draw.

◆ fsOrthoSet()

void fsOrthoSet ( int width,
int height )

Sets the orthographic projection.

Defines the orthographic rendering view for the current window.

Parameters
widthWidth of the orthographic view.
heightHeight of the orthographic view.