Loading...
Searching...
No Matches
rectangle.c File Reference
`#include "arc/graphics/rectangle.h"`
`#include "renderer.h"`
`#include <stdlib.h>`

Go to the source code of this file.

## Functions

void | ARC_Rect_Render (ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
void | ARC_Rect_RenderFill (ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
void | ARC_FRect_Render (ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color)
void | ARC_FRect_RenderFill (ARC_FRect *rect, ARC_Renderer *renderer, ARC_Color *color)

## Function Documentation

## ARC_FRect_Render()

void ARC_FRect_Render | ( | ARC_FRect * | rect,
|  | ARC_Renderer * | renderer,
|  | ARC_Color * | color )

Definition at line 15 of file rectangle.c.

{
ARC_Rect casted = ARC_FRect_CastToRect(rect);
ARC_Rect_Render(&casted, renderer, color);
}
ARC_Rect_Render
void ARC_Rect_Render(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:5
ARC_FRect_CastToRect
ARC_Rect ARC_FRect_CastToRect(ARC_FRect *rect)
casts FRect to Rect
Definition rectangle.c:25
ARC_Rect
Definition rectangle.h:12

References ARC_FRect_CastToRect(), and ARC_Rect_Render().

## ARC_FRect_RenderFill()

void ARC_FRect_RenderFill | ( | ARC_FRect * | rect,
|  | ARC_Renderer * | renderer,
|  | ARC_Color * | color )

Definition at line 20 of file rectangle.c.

{
ARC_Rect casted = ARC_FRect_CastToRect(rect);
ARC_Rect_RenderFill(&casted, renderer, color);
}
ARC_Rect_RenderFill
void ARC_Rect_RenderFill(ARC_Rect *rect, ARC_Renderer *renderer, ARC_Color *color)
Definition rectangle.c:10

References ARC_FRect_CastToRect(), and ARC_Rect_RenderFill().

## ARC_Rect_Render()

void ARC_Rect_Render | ( | ARC_Rect * | rect,
|  | ARC_Renderer * | renderer,
|  | ARC_Color * | color )

Definition at line 5 of file rectangle.c.

{
SDL_SetRenderDrawColor((SDL_Renderer *)renderer, color->r, color->g, color->b, color->a);
SDL_RenderDrawRect((SDL_Renderer *)renderer, (SDL_Rect *) rect);
}
ARC_Color::a
uint8_t a
Definition color.h:11
ARC_Color::r
uint8_t r
Definition color.h:11
ARC_Color::b
uint8_t b
Definition color.h:11
ARC_Color::g
uint8_t g
Definition color.h:11

References ARC_Color::a, ARC_Color::b, ARC_Color::g, and ARC_Color::r.

Referenced by ARC_FRect_Render().

## ARC_Rect_RenderFill()

void ARC_Rect_RenderFill | ( | ARC_Rect * | rect,
|  | ARC_Renderer * | renderer,
|  | ARC_Color * | color )

Definition at line 10 of file rectangle.c.

{
SDL_SetRenderDrawColor((SDL_Renderer *)renderer, color->r, color->g, color->b, color->a);
SDL_RenderFillRect((SDL_Renderer *)renderer, (SDL_Rect *) rect);
}

References ARC_Color::a, ARC_Color::b, ARC_Color::g, and ARC_Color::r.

Referenced by ARC_FRect_RenderFill().